Skip to main content
Eden AI makes decisions on your behalf on every LLM request: which provider serves a model sold by several, which region it runs in, whether to retry elsewhere when one fails, and whether to use your own provider key. None of that is visible in a normal response, because the answer looks the same whoever produced it. Send the x-edenai-metadata header to have Eden AI attach what it decided.

Enabling it

cURL
The value is case-insensitive. Any value other than 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.
If a stream fails partway through, the error frame carries a corrected block. The retry that happened after the first chunk would otherwise leave you holding a report that says the request succeeded. Read the block from the first chunk, and let a later error frame overwrite it.

What it is useful for

  • Confirming which provider answered. With provider routing the seller varies per request; summary and attempts name the one that produced your tokens.
  • Explaining a slow or failed request. attempts records every provider tried with its status, so a retry is visible rather than inferred from latency.
  • Verifying BYOK. is_byok confirms your own key was used, without reading a bill.
  • Verifying data residency. region reports where the request was actually served, not merely what you asked for.
  • Attributing cost. The provider in attempts is 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 chosen

Fallback

Name your own backup models

BYOK

Use your own provider keys

Monitoring

Account-level consumption and credits