base_url at your
gateway, swap the key for a ManyLayers key, and the code keeps working — across every
provider the gateway routes to, not only OpenAI.
Endpoints
ManyLayers also serves endpoints OpenAI does not:
/v1/rerank, /v1/kb/*,
/v1/docsets/*, /v1/mcp/{server} and /v1/async/*. See Endpoints.
Chat completions parameters
Supported — accepted, validated, and either forwarded or translated for the resolved provider:model · messages · stream · stream_options · temperature · top_p ·
max_tokens · max_completion_tokens · stop · user · tools · tool_choice ·
response_format
Provider dependent — honored where the provider’s adapter can express them,
otherwise refused with 400 and the parameter named:
n · seed · presence_penalty · frequency_penalty · logprobs ·
top_logprobs · logit_bias · parallel_tool_calls · reasoning_effort ·
response_format
Passed through untouched — unknown parameters are forwarded to
OpenAI-wire-format providers rather than stripped, so a new OpenAI parameter works
before ManyLayers has heard of it.
Validation
Requests are validated against the OpenAI schema before any provider is contacted. An invalid request comes back as a400 naming the field, which is what the SDKs
surface as error.param:
temperature 0–2, top_p 0–1, presence_penalty and
frequency_penalty −2–2, n 1–128, top_logprobs 0–20, stop at most four
sequences, max_tokens and max_completion_tokens above zero, reasoning_effort
one of minimal/low/medium/high, and the structure of messages, tools,
tool_choice and response_format.
Provider parameter matrix
The gateway’s public API is uniform; the providers beneath it are not. This is what each adapter can translate. A ✗ is not a silent drop — the request is refused with400 unsupported_parameter and error.param set, so you learn it from the
response rather than from a wrong answer.
A parameter set to its default is never refused:
n: 1, presence_penalty: 0,
parallel_tool_calls: true, tool_choice: "auto", logprobs: false and an empty
tools array ask for the behavior you would get anyway, so they pass on every
provider. SDK wrappers that set them unconditionally keep working.Provider-specific translations
- Anthropic —
reasoning_effortbecomes an extended-thinking budget (minimal1k,low2k,medium8k,high16k tokens);temperatureandtop_pare dropped while thinking is on, because Anthropic rejects them.parallel_tool_calls: falsebecomestool_choice.disable_parallel_tool_use.userbecomesmetadata.user_id. Thinking traces stream asdelta.reasoning_content. - Gemini / Vertex —
response_formatbecomesresponseMimeTypeplusresponseSchema. JSON Schema keywords Gemini’s OpenAPI-subset schema rejects (additionalProperties,$defs,allOf,oneOf,const, …) are stripped, so a schema OpenAI accepts does not turn into a provider400. - Cohere —
response_format: json_schemamaps to Cohere v2’sresponse_format: json_objectwith the schema attached. A namedtool_choicedegrades toREQUIRED: Cohere can force a tool call but not a specific one. - Bedrock —
tool_choice: "none"has no Converse equivalent, so the tool config is withheld for that turn.
Streaming
Supported.Content-Type: text/event-stream, standard data: framing, a role
chunk first, incremental content deltas, tool-call deltas correlated by index,
a finish_reason chunk, and data: [DONE].
The gateway relays each SSE line as it arrives; a provider chunk is never held
waiting for the next one. Streams are only buffered when a policy requires the
whole completion before any byte may leave — output PII redaction in buffer mode,
or an enforcing after-phase guardrail.
Provider streams in native formats (Anthropic, Gemini, Vertex, Bedrock, Cohere) are
translated to OpenAI chunk framing incrementally, event by event.
Providers translated from a native format always emit a final usage chunk, whether
or not
stream_options.include_usage was set. It is an extra chunk with an empty
choices array, which the OpenAI SDKs ignore; OpenAI-wire-format providers follow
include_usage exactly.Cancellation
Closing the connection cancels the request end to end: the client disconnect cancels the gateway’s request context, which cancels the upstream HTTP request. No generation is left running for a client that has gone away.Tool calling
Supported on every provider in the matrix, streaming and non-streaming:tools,tool_choice(auto/none/required/ a named function)- single and parallel tool calls
- stable
tool_calls[].id, correlated byindexacross streamed fragments argumentsdelivered as fragments that concatenate into valid JSON- assistant tool-call turns and
role: "tool"result messages on the way back in finish_reason: "tool_calls"
tool_use/tool_result, Gemini
functionCall/functionResponse, Bedrock toolUse/toolResult, Cohere v2 tool
calls — are translated in both directions.
Structured outputs
Provider dependent.response_format of type text, json_object and
json_schema is validated by the gateway and then mapped to the provider’s own
mechanism. Where a provider has no mechanism, the request is refused:
Usage
Supported. Every provider’s usage is normalized into OpenAI’s shape:prompt_tokens means the same number on every provider. Anthropic reports cache
reads outside input_tokens, so they are folded in; Gemini counts thinking tokens
outside candidatesTokenCount, so they are folded into completion_tokens. The
detail blocks are present only when the provider reported them.
When a provider reports no usage, the gateway estimates it with the model’s
tokenizer and records usage_source: "estimated" in the audit
log — the response body still carries whatever the
provider sent.
Models
Supported.GET /v1/models returns what would actually resolve for the calling
key: your workspace’s own models for a workspace-bound key, or the configured
catalog for a team-scoped key, filtered by the team’s model policy.
provider and source are ManyLayers extensions; they name the upstream without
exposing endpoints or credentials. created is always 0: a catalog entry has no
training date to report, and the field is typed as required by the SDKs.
Resolution works for direct model ids, aliases, workspace-registered models,
routed models and fallback targets. See Model resolution.
Aliases
A model may declare additional names. Both resolve, both are listed, and a team policy naming either one grants both:Authentication
Supported. Standard bearer authentication is all an OpenAI SDK needs:Authorization header upstream.
Workspaces are isolated: a key resolves models from its own workspace and its
team’s policy only. A model another team can use is reported as forbidden on the
inference path and as absent on
GET /v1/models/{model}, because telling an
unauthorized caller that a model exists is itself a disclosure.
Errors
Supported. Every failure uses the OpenAI envelope, withparam set whenever a
specific field is at fault:
A provider 4xx becomes a
400 because the request is the caller’s to fix; a
provider 401 becomes a 502 because the credential that was rejected is the
gateway’s, not the caller’s.
Context-length errors arrive as the provider’s own 4xx and surface as 400
invalid_request_error. The provider’s wording stays in the gateway log rather
than in the response body.