Skip to main content

Provider specific parameters

Besides the OpenAI parameters, every provider has options of its own, such as Anthropic's top_k and thinking, Bedrock's guardrail configuration or Vertex AI's safety settings. Spanway forwards these to the provider when you pass them, so you never lose access to a provider feature by going through the gateway. They can be fixed on a deployment by the admin, so every request gets them, or sent by the client per request.

Scenario​

A research team wants extended thinking on its Claude deployment for every request, without asking each application to send the setting. The admin adds thinking to the deployment's Spanway Params. One application also needs a higher thinking budget for a nightly job, so it sends its own thinking value in the request body, which overrides the deployment default for that call.

Steps​

  1. Set the parameter on the deployment. In the Admin UI open Models + Endpoints (/ui/models-and-endpoints), click the model in the Deployed Models table, click Edit on the Model Settings card and add the provider field to Spanway Params, for example "thinking": {"type": "enabled", "budget_tokens": 4096}, then save. In config.yaml the same lives under the deployment's spanway_params.

    model_list:
    - model_name: claude-sonnet-5-5-thinking
    spanway_params:
    model: anthropic/claude-sonnet-5-5
    api_key: os.environ/ANTHROPIC_API_KEY
    thinking: {"type": "enabled", "budget_tokens": 4096}
  2. Send a plain request. The deployment default applies, and the response carries reasoning_content in the message.

  3. Override it for one request. Any field in the body that is not an OpenAI parameter is forwarded to the provider.

    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-thinking", "messages": [{"role": "user", "content": "Plan a three day trip."}], "thinking": {"type": "enabled", "budget_tokens": 8192}, "top_k": 40}'

    With the OpenAI SDK, put the same fields in extra_body, which the SDK merges into the JSON body.

  4. Check what the provider received. Open API Playground (/ui/transform-request), paste the body and click Transform. The provider request shows thinking and top_k in Anthropic's own format.

Expected result​

The response is a normal chat completion. For the thinking example the message carries reasoning_content with the model's reasoning, and usage.completion_tokens_details.reasoning_tokens counts the thinking tokens. The request log in Logs shows the full request body including the provider fields.

Precedence​

Per-request values override per-deployment values. When a request is routed to a deployment of another provider, for example through a fallback, a parameter that provider does not understand is handled according to drop params.

Forwarding headers​

forward_client_headers_to_llm_api in general_settings forwards the client's headers to the provider, and extra_headers on a deployment adds fixed headers. Anthropic beta headers sent by clients are passed through to Anthropic.

Finding provider parameters​

Each provider's own API documentation lists its parameters. The Add Model tab on the Models + Endpoints page shows the provider credential fields the UI knows about, and the provider pages list the settings the gateway translates for each provider.

Errors​

StatusWhat it meansFix
400 from the providerThe provider rejected the value, for example a budget_tokens larger than max_tokens. The provider's message is in error.message.Correct the value according to the provider's documentation.
400 UnsupportedParamsError after a fallbackThe request landed on a deployment of another provider that does not know the parameter.Set drop_params: true on that deployment.
400 on a credential fieldThe body carries api_key, api_base or another credential field and the gateway does not allow client side credentials.Put credentials on the deployment, or allow the field with configurable_clientside_auth_params, see security settings.