Tags and metadata
Label each request with what it was for: a team, a feature, an environment or one of your users. Then find it on the Requests page and see what each tag costs in Analytics.
Send them
Tags go in the x-klinn-tags header as a comma-separated list. Metadata goes in the body as metadata, and the end user in OpenAI's user field. Every call made with an API key takes them, on chat, messages and decisions.
curl https://api.klinn.dev/v1/chat/completions \
-H "Authorization: Bearer $KLINN_API_KEY" \
-H "Content-Type: application/json" \
-H "x-klinn-tags: team:search, env:prod" \
-d '{
"model": "gpt-oss-120b",
"messages": [{ "role": "user", "content": "Hello" }],
"metadata": { "session": "s_42", "feature": "summary" },
"user": "user_1029"
}'client.chat.completions.create(
model="gpt-oss-120b",
messages=[{"role": "user", "content": "Hello"}],
user="user_1029",
extra_headers={"x-klinn-tags": "team:search,env:prod"},
extra_body={"metadata": {"session": "s_42", "feature": "summary"}},
)await client.chat.completions.create(
{ model: "gpt-oss-120b", messages: [{ role: "user", content: "Hello" }], user: "user_1029", metadata: { session: "s_42", feature: "summary" } },
{ headers: { "x-klinn-tags": "team:search,env:prod" } },
);The rules
Tags: up to 10 a request, each 1 to 64 characters of a-z A-Z 0-9 _ . : / -. You can also send them as metadata.tags, a comma-separated list or an array; both sources are combined. A tag that breaks these rules is dropped and the request still runs. Pairs like team:search or feature:summary read well in the console.
Metadata: up to 16 pairs. Keys are up to 64 characters, and a pair with a longer key is dropped. Values are text up to 512 characters, and longer ones are cut. A number or true/false is kept as text, and other values are dropped. We remove metadata from the body before the request goes to the model.
End user: OpenAI's user, or Anthropic's metadata.user_id when there is no user. Up to 128 characters, and longer ids are cut.
Where they show up
Requests: every request lists its tags. Open one to see its metadata and end user, and click a tag there to see only the requests with it. Request records are kept 30 days.
Analytics, by tag: requests, tokens and spend at our price for each tag, and for requests without one. A request with several tags counts under each of them. Daily totals by tag are kept 90 days. A day keeps up to 200 different tags; new ones past that count under Other tags, so put ids that change with every request in metadata.
