Input parameters
Every provider has its own request format and its own names for the same settings. Spanway exposes one set of input parameters, the OpenAI chat completion parameters, and translates them to each provider's API, so an application sends the same body whether the model behind the public name is from OpenAI, Anthropic, Bedrock or a self-hosted server. A parameter the provider supports natively is mapped to its equivalent, and a parameter the provider does not support raises an error or is dropped, depending on your drop params setting.
Scenario
A team moves its chat application from an OpenAI model to a Claude model. The application sends max_tokens, temperature, tools and a response_format with a JSON schema. Through the gateway the body stays the same. The gateway maps max_tokens to Anthropic's limit field, translates the tool definitions, and emulates the JSON schema format where the provider has no native support. Before the switch the team checks on the Models + Endpoints page which parameters the new model supports.
Steps
-
Look up what the model supports. In the Admin UI open Models + Endpoints (
/ui/models-and-endpoints), click the public model name in the Deployed Models table and read the Overview tab, which lists the supported OpenAI parameters and the capability flags such as function calling and vision. The Model Hub (/ui/model-hub-table) shows the same flags for every public model. -
Ask the gateway the same question from the command line.
curl "http://localhost:4000/model_group/info?model_group=claude-sonnet-5-5" \-H "Authorization: Bearer $SPANWAY_API_KEY" -
Send a request that uses the parameters.
curl -X POST http://localhost:4000/v1/chat/completions \-H "Authorization: Bearer $SPANWAY_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "claude-sonnet-5-5","messages": [{"role": "user", "content": "List three fruits as JSON."}],"max_tokens": 200,"temperature": 0,"response_format": {"type": "json_object"}}' -
Check how the request was translated. Open API Playground (
/ui/transform-request), paste the same body and click Transform to see the exact provider request the gateway builds, with the mapped parameter names.
Expected result
The model_group/info call returns supported_openai_params and capability flags for the model group. The chat completion call returns a normal chat completion object, and the transformed request shows the body the provider receives, for example max_tokens carried over and response_format turned into the provider's structured output setting.
Messages
messages is a list of objects with role (system, developer, user, assistant or tool) and content. Content is a string or a list of parts.
| Part type | Fields | Notes |
|---|---|---|
text | text | Plain text. |
image_url | image_url.url, image_url.detail | A URL or a data URL. Converted to base64 for providers that require it. |
input_audio | input_audio.data, input_audio.format | Base64 audio for audio capable models. |
file | file.file_id or file.file_data, file.filename | Documents such as PDFs for providers with document input. |
video_url | video_url.url | Video for models with video input. |
Assistant messages can carry tool_calls, and tool messages carry tool_call_id and the tool result. Anthropic style cache_control on a content part marks a prompt cache breakpoint, see prompt caching.
Generation parameters
| Parameter | Effect |
|---|---|
temperature, top_p, n, seed, stop | Sampling controls. |
max_tokens, max_completion_tokens | Output length limit. The gateway maps between the two names as the provider expects. |
presence_penalty, frequency_penalty, logit_bias | Repetition controls, where supported. |
logprobs, top_logprobs | Token log probabilities. |
reasoning_effort | none, minimal, low, medium, high, xhigh, max or default for reasoning models. Mapped to each provider's thinking controls. |
verbosity | low, medium or high. |
response_format | text, json_object or json_schema. |
tools, tool_choice, parallel_tool_calls | Function calling. |
stream, stream_options | Streaming. |
modalities, audio | Audio output. |
web_search_options | Provider web search, or gateway web search interception. |
user, safety_identifier | End user identifiers. |
service_tier, store, prompt_cache_key, prediction | Provider specific features passed through where supported. |
Provider only parameters, such as Anthropic's thinking or top_k, can be passed too, see provider specific params.
Gateway only fields
Fields such as metadata, tags, cache, guardrails, fallbacks, prompt_id and prompt_variables are read by the gateway and removed before the provider call.
Errors
| Status | What it means | Fix |
|---|---|---|
400 UnsupportedParamsError | The request carries a parameter the provider behind the model does not support and drop_params is off. The message names the parameter. | Remove the parameter, or turn on drop params globally, per deployment or per request. |
400 BadRequestError | A parameter has an invalid value, for example temperature out of range or a malformed content part. | Correct the value. The provider's message is passed through in error.message. |
400 on response_format | The model does not support structured output and JSON schema validation is on. | Pick a model with the supports_response_schema flag, or turn on structured output repair. |
Related
- Chat completions for the endpoint itself.
- Output format for the response fields.
- Provider specific parameters for settings only one provider understands.
- Drop params for what happens to unsupported settings.
- API Playground for seeing the translated provider request.