Use this file to discover all available pages before exploring further.
ARouter’s request and response schemas are very similar to the OpenAI Chat API, with a few small differences. ARouter normalizes the schema across models and providers so you only need to learn one.
ARouter currently publishes the YAML specification. You can use it with tools like Swagger UI or Postman to explore the API or generate client libraries.
Here is the request schema as a TypeScript type. This will be the body of your POST request to the /v1/chat/completions endpoint.For a complete list of parameters, see the Parameters reference.
type Request = { // ARouter standardizes chat requests on "messages" messages?: Message[]; // If "model" is unspecified, defaults to the tenant's configured default model?: string; // e.g. "openai/gpt-5.4" or "anthropic/claude-sonnet-4.6" // Force the model to produce specific output format. // See "Structured Outputs" guide for supported models. response_format?: ResponseFormat; stop?: string | string[]; stream?: boolean; // Enable streaming // See Parameters reference max_tokens?: number; // Range: [1, context_length) temperature?: number; // Range: [0, 2] // Tool calling // Passed through to providers implementing OpenAI's interface. // For providers with custom interfaces, transformed accordingly. tools?: Tool[]; tool_choice?: ToolChoice; parallel_tool_calls?: boolean; // Default: true // Advanced optional parameters seed?: number; top_p?: number; // Range: (0, 1] top_k?: number; // Range: [1, Infinity) — not available for OpenAI models frequency_penalty?: number; // Range: [-2, 2] presence_penalty?: number; // Range: [-2, 2] repetition_penalty?: number; // Range: (0, 2] logit_bias?: { [key: number]: number }; top_logprobs?: number; min_p?: number; // Range: [0, 1] top_a?: number; // Range: [0, 1] // Reduce latency by providing a predicted output prediction?: { type: 'content'; content: string }; // ARouter routing parameters models?: string[]; // Ordered candidate model list — see Model Routing guide route?: string; // Routing mode used with models[] // A stable identifier for your end-users (for abuse detection) user?: string;};
ARouter’s OpenAI-compatible chat endpoint standardizes on messages. If you want to send a provider’s native request body instead, use the native endpoint for that provider or the Provider Proxy.
For detailed usage and examples, see Structured Outputs.When using JSON mode, you should still instruct the model to respond with JSON in your system or user message.
Specify the model using the provider/model format. ARouter parses the provider prefix and routes to the correct upstream.If the model parameter is omitted, the tenant’s configured default is used. See the Model Routing guide for the full routing logic, including ordered candidate model lists using models[] and route.
Set stream: true to receive token-by-token responses via Server-Sent Events. SSE streams can include comment lines in addition to data: payloads, and clients should ignore those comments. See the Streaming guide for SSE format, usage chunks, cancellation, and error handling.
If the chosen model doesn’t support a request parameter (such as logit_bias in non-OpenAI models, or top_k for OpenAI), the parameter is silently ignored. The rest are forwarded to the upstream model API.
ARouter normalizes the schema across models and providers to comply with the OpenAI Chat API.choices is always an array. Each choice contains a delta property if streaming was requested, and a message property otherwise.
type Response = { id: string; choices: (NonStreamingChoice | StreamingChoice)[]; created: number; // Unix timestamp model: string; // The model that was actually used (e.g. "openai/gpt-5.4") object: 'chat.completion' | 'chat.completion.chunk'; provider?: string; // The upstream provider that handled the request system_fingerprint?: string; // Only present if the provider supports it // Usage data is always returned for non-streaming. // When streaming, usage is returned exactly once in the final chunk, // before the [DONE] message, with an empty choices array. usage?: ResponseUsage;};