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.

As default tags on an API key

Tags set on an API key are added to every call made with it. A key that serves one customer or one environment then needs nothing in its requests. Set them when you create or edit a key: in the dashboard, under Default Tags on the API Keys page, or with the key’s default_tags field in the Management API. They follow the rules below, with at most 10 per key, and apply from the next call.

Combining sources

When a call gets tags from more than one place, they are merged by key and the call’s own tags win: the header over the key’s defaults, the body over both.

Rules

Tags are kept with your usage data and are visible to everyone in your organization with access to Monitoring. Avoid personal data such as emails or names; to split spend per person, use a pseudonymous id from your own system. Every distinct value is a separate line in your usage breakdown, so use a small set of stable values, such as a customer, project, environment or feature name, and do not tag per request or per session.

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, and tagging does not change how they are handled.
  • /v2 endpoints ignore tags, including API key default 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