Tags

    Tags let you attach custom key:value metadata to chat completion and embedding requests sent through Kimchi. Once attached, tags appear in the Analytics page, where you can filter usage and cost data by any combination of tags.

    Common tagging patterns include environment (env:prod), team (team:ml-platform), project (project:search-v2), and cost center (cost-center:engineering).

    Tag format

    Tags follow a key:value format. Both the key and value must start and end with an alphanumeric character, and can contain letters, numbers, hyphens (-), underscores (_), and dots (.) in between.

    ConstraintLimit
    Key length1–64 characters
    Value length1–64 characters
    Tags per request10 maximum
    Allowed charactersa-z, A-Z, 0-9, -, _, .
    📘
    Valid example tags: env:prod, team:ml-platform, experiment.v2:run-42, region:us.west.1, cost-center:engineering, app:chat-bot.v3

    Attaching tags to requests

    You can attach tags via the request body, HTTP headers, or both. When you use both methods, the proxy merges and deduplicates the tags.

    Request body

    Add a tags array to the JSON request body:

    bash
    curl -X POST https://llm.kimchi.dev/openai/v1/chat/completions \
      -H "Authorization: Bearer $KIMCHI_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "gpt-4",
        "messages": [
          {"role": "user", "content": "Hello!"}
        ],
        "tags": ["env:prod", "team:ml", "feature:onboarding"]
      }'

    The same tags field works for embedding requests.

    HTTP headers

    Send tags as comma-separated values in the X-Tags header:

    bash
    curl -X POST https://llm.kimchi.dev/openai/v1/chat/completions \
      -H "Authorization: Bearer $KIMCHI_API_KEY" \
      -H "Content-Type: application/json" \
      -H "X-Tags: env:prod,team:ml,feature:onboarding" \
      -d '{
        "model": "gpt-4",
        "messages": [
          {"role": "user", "content": "Hello!"}
        ]
      }'

    Two header names are supported:

    HeaderDescription
    X-TagsPrimary tag header
    X-LiteLLM-TagsAlternative header for LiteLLM compatibility

    Filtering analytics by tags

    After you start sending tagged requests, use the Tags filter on the Analytics page to break down usage and cost data by tag.

    Navigate to Kimchi → Analytics and select one or more tags from the Tags dropdown. The page updates to show metrics only for requests matching the selected tags. The tag filter can be combined with other filters as well.