See how a request was routed — the model asked for, the providers considered, the one that served, the retries — with one opt-in header.
Every request is routed: a provider is picked among those serving the model, a fallback may be tried, a plugin or a helper may run. Router metadata shows you what happened, on the answer itself — for debugging a routing choice, attributing latency, or auditing what ran.
Send X-OpenDunes-Metadata: enabled on a /v1/chat/completions request:
curl https://opendunes.com/v1/chat/completions \
-H "Authorization: Bearer $OPENDUNES_API_KEY" \
-H "Content-Type: application/json" \
-H "X-OpenDunes-Metadata: enabled" \
-d '{
"model": "anthropic/claude-sonnet-5",
"messages": [{ "role": "user", "content": "Marhba!" }]
}'enabled, in any case, turns it on; any other value, or no header, leaves it off.
The answer carries an opendunes_metadata object beside choices and usage:
{
"id": "gen-…",
"model": "anthropic/claude-sonnet-5",
"choices": [],
"usage": {},
"opendunes_metadata": {
"requested": "anthropic/claude-sonnet-5",
"strategy": "direct",
"summary": "…",
"attempt": 1,
"endpoints": {
"total": 1,
"available": [
{ "provider": "…", "model": "anthropic/claude-sonnet-5", "selected": true }
]
}
}
}| Field | Holds |
|---|---|
requested | the model you sent — it may differ from the one that served |
strategy | how the model was chosen: direct, auto, latest, fallback, pareto, bodybuilder and others |
summary | the decision in one line |
attempt | which attempt succeeded; above 1, earlier ones failed and a fallback served |
endpoints | the providers considered, and the one selected |
attempts | each attempt's provider, model and status, when there were retries |
pipeline | the plugins, helpers and filters that changed the request or the answer, when any did |
New fields and new pipeline stages may appear; treat the unknown ones as opaque.