Create a chat completion
Response
Parameters
The gateway accepts the OpenAI chat completions schema and validates it before contacting a provider.model, messages, stream, stream_options,
temperature, top_p, max_tokens, max_completion_tokens, stop, user,
tools, tool_choice and response_format work on every provider.
n, seed, presence_penalty, frequency_penalty, logprobs, top_logprobs,
logit_bias, parallel_tool_calls and reasoning_effort are honored where the
resolved provider’s adapter can express them, and refused with a 400 naming the
parameter where it cannot — never dropped silently. Unknown parameters are
forwarded to OpenAI-wire-format providers untouched.
See OpenAI Compatibility for the full matrix.
Streaming
Set"stream": true to receive Server-Sent Events:
Async chat completion
For long-running requests, enqueue as a background job and poll for the result:Response
GET /v1/async/jobs/{id}. When complete, the response contains the full chat completion. Configure async.webhook_signing_secret to receive results via HMAC-signed webhook instead.
ManyLayers-specific headers
| Header | Description |
|---|---|
X-ManyLayers-Config | Named routing config to apply (failover, canary, etc.) |
X-Session-Id | Sticky session identifier — pins this request to a specific upstream |
X-Request-Id | Request ID (auto-generated if you do not provide one) |
Anthropic messages endpoint
For clients using the Anthropic wire format:provider: anthropic is configured.