#21207·ai

AI Gateway silently drops reasoning effort for OpenAI models served by Amazon Bedrock

Author: iknow213Created Sep 20, 2026Updated Sep 30, 2026
Labelstask-identify-issue-type-donefactory-activefactory-blockedfactory-automatictask-identify-harness-labels-done

Description

When AI Gateway routes an OpenAI GPT-5.6 model to Amazon Bedrock, reasoning effort is silently discarded. The request succeeds (HTTP 200) and the model reasons at its provider default no matter what effort is requested. The same model served by openai honours effort normally, so switching a provider preference changes model behaviour with no error and no signal in the response.

This is the hosted gateway, not the @ai-sdk/amazon-bedrock package. It looks related to #19403, which fixed effort mapping for CRIS-prefixed OpenAI IDs inside that package; the gateway path appears unfixed.

Measured

Median reasoning tokens, identical prompt, 3 runs per cell, gateway pinned to one provider with providerOptions.gateway.only:

Serving provider reasoning: 'low' reasoning: 'xhigh'
openai 1,750 [1552, 1750, 1902] 6,711 [5696, 6711, 7128]
bedrock 2,704 [2588, 2704, 3303] 3,060 [2588, 3060, 3106]

On openai the two distributions do not overlap. On bedrock they overlap completely.

Five request shapes were tried against bedrock, all HTTP 200, all landing in the same inert band:

  • AI SDK top-level reasoning: 'xhigh'
  • providerOptions.openai.reasoningEffort: 'xhigh'
  • providerOptions.bedrock.additionalModelRequestFields.reasoning.effort
  • HTTP /v1/chat/completions with reasoning: { effort }
  • HTTP /v1/chat/completions with reasoning_effort

Bedrock itself honours effort

Called directly with SigV4, same prompt. Every Bedrock surface applies effort, each under its own field name:

Surface Field low xhigh
/openai/v1/responses reasoning: { effort } 1,451 reasoning tokens 8,689
/openai/v1/chat/completions reasoning_effort (flat) 1,552 reasoning tokens 8,275
Converse additionalModelRequestFields: {"reasoning":{"effort":…}} 3,047–3,352 output tokens 7,672–9,684

Bedrock rejects the wrong name per surface rather than ignoring it: Converse with flat reasoning_effort returns 400 unknown_parameter, and /openai/v1/chat/completions with nested reasoning returns 400 Unknown parameter: 'reasoning'.

Worth noting for #19403: that thread established HTTP 200 for the nested Converse shape but did not verify the effort was applied. It is — 2.7x spread between low and xhigh.

Which surface the gateway uses

Gateway responses served by Bedrock carry providerMetadata.openai.responseId starting resp_, plus serviceTier and reasoningContext. Direct Bedrock /openai/v1/responses returns id: resp_…, object: response; /openai/v1/chat/completions returns id: chatcmpl-…. So the gateway is already using the Responses surface — the one where reasoning: { effort } is native and verified working above. The effort object just is not being sent.

Expected

Effort requested through the gateway reaches Bedrock-served OpenAI models, matching the openai endpoint's behaviour. Failing that, a surfaced error or a catalog signal, rather than a silent downgrade.

GET /v1/models/openai/gpt-5.6-sol/endpoints currently lists "reasoning" in supported_parameters for the bedrock endpoint, identical to the openai and azure entries, which suggests it is supported.

Impact

Adding bedrock ahead of openai in a provider order silently cut reasoning by roughly 10x on our production agent's first-build turns (median 12,898 to about 1,200 reasoning tokens per turn) with no error anywhere. It was only caught by watching usage.outputTokenDetails.reasoningTokens.

Reproduction

typescript
import { generateText } from 'ai'

const PROMPT =
  'Consider the 5x5 Lights Out puzzle where pressing a cell toggles it and its four ' +
  'orthogonal neighbours. Determine the dimension of the GF(2) null space of the toggle ' +
  'matrix, justify from first principles, and state exactly which boards are solvable. ' +
  'Reason it out fully; do not cite a remembered result.'

for (const provider of ['openai', 'bedrock']) {
  for (const effort of ['low', 'xhigh']) {
    const r = await generateText({
      model: 'openai/gpt-5.6-sol',
      prompt: PROMPT,
      reasoning: effort,
      providerOptions: { gateway: { order: [provider], only: [provider] } },
    })
    console.log(
      provider,
      effort,
      r.providerMetadata?.gateway?.routing?.finalProvider,
      r.usage?.outputTokenDetails?.reasoningTokens,
    )
  }
}

openai separates cleanly by effort; bedrock does not. Requires BYOK Bedrock credentials configured for the team.

AI SDK Version

  • ai: 7.0.93
  • @ai-sdk/gateway: 4.0.75
  • @ai-sdk/openai: 4.0.60