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:
Tags
tags lists the tags recorded for the call, merged from the API key’s default tags, the X-EdenAI-Tags header and the tags body field, with keys in lowercase. It is {} when the call has none.
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. - Checking your tags.
tagsshows exactly what was recorded for your usage breakdown, after the key’s default tags, the header and the body are merged.
Scope
The block is also omitted when the response is served from cache, because no provider was called for it.
Universal AI
Universal AI never ranks sellers: you name the provider and, optionally, fallbacks. The block has nostrategy or endpoints, and reports mode instead:
The other fields, including
tags, mean the same as above. A failed attempt reports the provider’s own status, even though Universal AI always answers HTTP 200 with "status": "fail".
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