#1672·gateway

azure-ai-inference: no Responses API support — requests silently fall back to `chatComplete` with data loss

Author: davidwhite-specCreated May 30, 2026Updated Sep 24, 2026
Labelsbugtriage

What Happened?

Related: #1527 (same missing createModelResponse pattern, different provider)


Summary

The azure-ai-inference provider has no Responses API support. Sending a /v1/responses request targeting an azure-ai virtual key does not return an error — the gateway silently falls back to the chatComplete translation path, mangling the request in the process. Fields that exist in the Responses API schema but have no equivalent mapping in the chatComplete config are dropped without warning. The caller receives a 200 with a plausible-looking response, with no indication that the request was not handled as intended.

The reasoning field is a concrete example of the data loss this causes, but the problem is not specific to reasoning — any Responses API field that doesn't have a 1:1 chatComplete equivalent (e.g. instructions, truncation, previous_response_id) is silently dropped in the same way.


Root cause

src/providers/azure-ai-inference/index.ts returns no createModelResponse key from getConfig(...). transformToProviderRequestJSON hits:

typescript
if (!providerConfig) {
  throw new GatewayError(`${fn} is not supported by ${provider}`);
}

Per the OSS gateway code, this GatewayError propagates and returns a 4xx/5xx. However, empirically, the hosted Portkey gateway returns a 200 with a degraded response (reasoning_tokens: 0), suggesting the cloud build handles the missing config differently — likely falling back to the chatComplete translation path.

Either way the outcome is bad: callers either get a hard error with no path forward, or a silent 200 where Responses API fields are dropped. transformUsingProviderConfig is a strict whitelist:

typescript
for (const configParam in providerConfig) {
  if (configParam in params) { ... }
}
// params absent from providerConfig are silently dropped

AzureAIInferenceChatCompleteConfig has reasoning_effort (flat) but no reasoning (the nested Responses API field). So even on the chatComplete fallback path, reasoning: { effort: "high" } is dropped before the request reaches the upstream.


Reproduction

bash
# Config: single azure-ai-inference target
CONFIG='{"strategy":{"mode":"single"},"targets":[{"virtual_key":"<azure-ai-vkey>","provider":"azure-ai","override_params":{"model":"DeepSeek-V4-Flash"},"request_timeout":60000}]}'

# Responses API — reasoning silently dropped
curl -s -X POST https://api.portkey.ai/v1/responses \
  -H "Content-Type: application/json" \
  -H "x-portkey-api-key: $PORTKEY_KEY" \
  -H "x-portkey-config: $CONFIG" \
  -d '{"model":"PORTKEY_CONFIG_USED","reasoning":{"effort":"high"},"input":"What is 17 * 23?","store":false}'
# → reasoning_tokens: 0

# chat/completions — reasoning_effort forwarded correctly
curl -s -X POST https://api.portkey.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "x-portkey-api-key: $PORTKEY_KEY" \
  -H "x-portkey-config: $CONFIG" \
  -d '{"model":"PORTKEY_CONFIG_USED","reasoning_effort":"high","messages":[{"role":"user","content":"What is 17 * 23?"}]}'
# → reasoning_content: "We need to compute 17 * 23 ..."  ✓

All Responses API variants produce reasoning_tokens: 0:

Body param Via Result
reasoning: {effort:"high"} /v1/responses + config 0 reasoning tokens
reasoning_effort: "high" (flat) /v1/responses + config 0 reasoning tokens
reasoning_effort: "high" override_params 0 reasoning tokens
reasoning_effort: "high" (flat) /v1/chat/completions + config reasoning works ✓

Proposed fix

Azure AI Foundry exposes a native /v1/responses endpoint, so no field translation is needed — Portkey just needs to route to it. The fix is the same pattern as #1527: register createModelResponse using the open-ai-base helper and add the endpoint mapping.

azure-ai-inference/index.ts

typescript
import { createModelResponseParams } from '../open-ai-base/index';

// in getConfig() return value:
createModelResponse: createModelResponseParams([]),

azure-ai-inference/api.ts

typescript
createModelResponse: '/v1/responses',

With this in place, reasoning: { effort: "high" } (and all other Responses API fields) pass through to Azure AI Foundry's native endpoint unchanged, with no custom translation layer required.

What Should Have Happened?

No response

Relevant Code Snippet

No response

Your Twitter/LinkedIn

No response