Debug Mode
Request `normalizations`, `deprecations`, or `routing` with `extra.debug` and inspect the top-level response shape across supported OpenGateway endpoints.
Request debug data#
Set extra.debug to one or more of the supported categories. For example, this
Chat Completions request asks for all three:
curl "https://apis.opengateway.ai/v1/chat/completions" \-H "Authorization: Bearer $OPENGATEWAY_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "openai/gpt-5-mini","messages": [{"role": "user", "content": "Hello"}],"max_completion_tokens": 64,"extra": {"debug": ["normalizations", "deprecations", "routing"]}}'
Response shape#
On supported responses, debug is a top-level object alongside the normal
response fields; it is not nested inside extra. Only requested categories
appear. A requested category with no captured entries can be an empty array.
This illustrative response fragment shows the field shape. The sample entries are independent illustrations, not a promise that one request produces all of them. Actual entries depend on the request, provider mapping, and routes attempted:
{"debug": {"normalizations": [{"param": "temperature", "action": "override", "before": 0.5, "after": 1.0}],"deprecations": [{"param": "max_tokens", "message": "Use max_completion_tokens instead."}],"routing": [{"provider": "anthropic", "region": "global", "status": "failed"},{"provider": "openai", "region": "global", "status": "succeeded"}]}}
normalizations#
Each entry describes a difference between the request and the provider request
body. param names the field, and action is add, strip, or override.
before and after contain the compared values; one can be null when a
field was added or removed. Provider-specific conversions can produce more
than one entry.
deprecations#
Each entry has param and message. OpenGateway records request fields marked
deprecated when the request actually supplies them. For example, Chat
Completions max_tokens is deprecated in favor of max_completion_tokens.
routing#
This is the ordered list of attempted routes. Each entry includes provider,
region, and status (failed or succeeded); a target field can also be
present when the route selects one. The example omits target values.
Endpoint support#
Non-streaming Chat Completions, Responses, Decisions, embeddings, image
generation, and image edit responses can include debug. In Chat Completions
streaming, it appears on the final chunk with a finish reason. Responses
streaming does not currently attach a debug object to its events.
The Anthropic Messages endpoint (POST /v1/messages) does not capture or return
this debug object. It accepts extra.fallbacks, but that does not make
extra.debug available on its passthrough response. Which entries are
populated can also vary by endpoint and model adapter.