Skip to content

Parameter compatibility

Providers disagree about which request parameters they accept. Prism adjusts parameters so a request reaches the model you chose, without changing the model, and reports every adjustment in the X-Prism-Adjusted-Params response header.

On Chat Completions:

  • max_tokens is renamed to max_completion_tokens for the OpenAI o1, o3, o4 and gpt-5 families.
  • A non-default temperature or top_p is dropped for reasoning models that accept only 1 (not for gpt-5-chat variants). The value 1 is kept.
  • For automatic routing only, reasoning_effort (Responses: reasoning) is removed when the chosen model is a non-reasoning gpt-4o, gpt-4.1, gpt-4 or gpt-3.5 model.

These adjustments also apply to requests that name a concrete model.

When a provider answers 400 or 422 and names a parameter of the request that it does not support, Prism retries the same provider and model with the parameter changed:

  • set to the value the provider suggests, if it suggests one;
  • renamed to the field the provider names, if it names one;
  • otherwise dropped.

At most four such retries happen per attempt. A repaired rejection does not count as a failure of the model. For streaming chat the retry happens before any response bytes are sent; Prism never repairs a stream in the middle.

Prism remembers the fix for that provider, model and task type and applies it to later matching requests before sending them. A rule expires seven days after it was learned, so the original parameter is tried again; rules survive a restart. They are stored in <storage.dir>/learned-param-rules.json, at most 16 per provider, model and task type.

Learned rules never change model, messages, input, instructions, prompt, tools, functions, tool_choice, function_call, response_format, text, stream, n, modalities, audio, previous_response_id or conversation. Other wire parameters, including reasoning_effort, can change: naming a concrete model does not guarantee the request body reaches the provider byte for byte.

List and remove learned rules with the list_learned_rules and forget_learned_rules actions of the local control API, or in the web console.

Chat requests served through the Responses API

Section titled “Chat requests served through the Responses API”

Some models answer only on the Responses API. When a provider’s Chat endpoint rejects a request and points to /v1/responses, or the catalog marks a model as Responses-only on a provider that offers that API, Prism sends the chat request to /v1/responses and translates the answer back to Chat Completions, streamed or not. You keep calling /v1/chat/completions.

  • X-Prism-Adjusted-Params contains endpoint=set:responses, and X-Prism-Upstream-Endpoint: /v1/responses is set.
  • Chat-only fields are dropped and listed: stop, seed, presence_penalty, frequency_penalty, logit_bias, logprobs, top_logprobs, prediction, web_search_options.
  • Requests this path cannot carry stay on Chat: n greater than 1, audio or other non-text output, non-function tools, unsupported message roles, non-text system or developer content. For a Responses-only model such a request gets a 400 that names /v1/responses, and automatic routing does not pick that model for it.
  • If the provider’s /v1/responses answers 404, 405 or 501, Prism goes back to Chat for that model for seven days.
X-Prism-Adjusted-Params: temperature=dropped;max_tokens=renamed:max_completion_tokens

Entries are separated by ;: param=dropped, param=renamed:<field>, param=set:<value>. Browser JavaScript on another origin cannot read this header (it is not in Access-Control-Expose-Headers); server-side clients and same-origin pages can.