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:
Each SSE chunk follows the standard OpenAI format:

Async chat completion

For long-running requests, enqueue as a background job and poll for the result:

Response

Poll status via 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

Anthropic messages endpoint

For clients using the Anthropic wire format:
Accepts Anthropic-format requests and routes them to the configured Anthropic upstream. Available when a model with provider: anthropic is configured.