Skip to main content
Tags are key/value labels you put on a call, such as client=acme or project=invoices. Eden AI stores them with the request, so you can split your usage and cost per customer, project or environment in the dashboard, without creating one API key for each. There is nothing to set up: add tags to a call and they appear in your usage within a minute.

Adding tags to a call

With the X-EdenAI-Tags header

The header works on every v3 endpoint that runs a model, including the ones that take a file (transcriptions, image edits, video generation) and collections. Write key=value pairs separated by commas:
cURL
Spaces around a pair are ignored. If the header is sent more than once, for example because a proxy adds its own, all of its pairs are kept.

With a tags field in the body

On JSON endpoints, send a tags object instead: chat completions, Responses, Messages, embeddings, image generation, moderations, decisions, text to speech and Universal AI.
Python
Endpoints that take a file upload (transcriptions, image edits) read the header only. Video generation does too, and refuses a tags field in its body. A tags field that is not an object, such as the list some SDKs send, is ignored rather than refused.

Sending both

The header and the body are merged by key. When both set the same key, the body wins:

Rules

Tags are kept as long as your usage data, and every distinct value is a separate line in your usage breakdown. Use a small set of stable values, such as a customer, project, environment or feature name. Do not put personal data (emails, names) or per-request ids in tags.

Examples by client

For Claude Code and OpenCode, start from their setup pages; the lines above only add the tags. LiteLLM’s edenai/ provider needs LiteLLM 1.104 or later.

Reading the tags back

Add the x-edenai-metadata: enabled header and the response lists the tags recorded for the call in edenai_metadata.tags, after the merge and with keys in lowercase:
An untagged call returns "tags": {}. See Request Metadata for the rest of the block and the endpoints that return it.

Invalid tags

A call with an invalid tag is refused with HTTP 400 before any provider is called, so it is not billed. The message names the tag and the rule it breaks, and the error uses the endpoint’s own format:
Other messages you may see: The refused call still appears in your request log with status 400.

Seeing your usage by tag

In the dashboard, open Monitoring:
  • Filters, then Tags: pick a key, then one or more values, to include or exclude them. Active filters show as badges above the charts.
  • Explore, Group by, then Tag: choose a key to split cost and calls by its values. Calls without that key are grouped as Untagged.
  • Requests: each request shows its tags. In a request’s details, click a tag to filter the list by it.
  • Export CSV on the Requests tab: every request in the selected period and filters, with one column per tag key. An export holds up to 100,000 requests and 50 tag columns; tags beyond those are grouped in an other_tags column. You can export 20 times per hour.
Tags apply from the call that carries them: calls made before you started tagging show as untagged.

Good to know

  • Tags are never sent to the model provider.
  • /v3/upload only stores a file for later calls and is not part of your usage, so tags sent to it are ignored. Tag the call that uses the file.
  • Two calls that differ only by their tags return the same cached response.
  • The OpenAI metadata and user fields are not tags: they are forwarded to the provider as before.
  • /v2 endpoints ignore tags.

Next Steps

Request Metadata

See the tags and routing recorded for a call

Monitoring

Pull account-level usage into your own tools

Custom API Keys

Separate keys with their own spending limits

Caching

How repeated calls are served