x-edenai-metadata header to have Eden AI attach what it decided.
Enabling it
cURL
enabled, including disabled, is treated as off.
The block is absent unless you ask for it, and adding the header changes nothing else: the rest of the response is identical. It is safe to enable per request, for a subset of traffic, or only while debugging.
What you get
The response gains one extra top-level key,edenai_metadata:
Strategy values
strategy tells you how much Eden AI chose for you:
Reading it on a stream
For streaming requests the block rides the first chunk, not the last. Routing is settled before the first token is generated, so the answer is already known, and putting it first means you get it even from providers that never send a terminal usage chunk.What it is useful for
- Confirming which provider answered. With provider routing the seller varies per request;
summaryandattemptsname the one that produced your tokens. - Explaining a slow or failed request.
attemptsrecords every provider tried with its status, so a retry is visible rather than inferred from latency. - Verifying BYOK.
is_byokconfirms your own key was used, without reading a bill. - Verifying data residency.
regionreports where the request was actually served, not merely what you asked for. - Attributing cost. The provider in
attemptsis the one you were billed for.
Scope
Available on the LLM endpoints (/v3/chat/completions, /v3/responses and /v3/v1/messages) in both streaming and non-streaming form. It is not returned by /v3/universal-ai.
Next Steps
Provider Routing
How the provider in
attempts was chosenFallback
Name your own backup models
BYOK
Use your own provider keys
Monitoring
Account-level consumption and credits