Observability Traces Metadata

Metadata

Every call is traced automatically, with no setup required. Grouping calls into a session, attributing them to a particular user, and similar views all build on top of that automatic trace, but they are not automatic themselves: each depends on a small piece of information, called metadata, being sent along with the call.

What metadata is

Metadata is a set of your own key-value pairs, attached to a call at the time it is made. Forgebench does not interpret most of what you send; it is recorded and made available for filtering exactly as sent. A small number of keys are treated specially, described below, because they drive a particular view in Forgebench rather than acting as a plain filter.

What is already attached, without you sending anything

Alongside anything you send yourself, Forgebench writes a further set of information onto every trace automatically. This part is not something you configure, and it cannot be altered or forged by a caller. It is what makes a trace trustworthy for questions of attribution and billing:

FieldWhat it is
agent_idWhich agent made the call, when it was made by an agent rather than a direct API call.
actorThe identity of the person or service account that authenticated the call.
audit_idThe entry in the audit log for this exact call.
api_key_prefixThe non-secret, displayable prefix of the API key used to make the call (for example, sk_ab12...), never the key itself, which Forgebench never stores in a recoverable form.
requested_modelThe model actually requested, useful when a fallback model ended up serving the call instead.
latency_msThe true time the call took at the gateway.
user_idWho the call is attributed to for the Users view: your account email, the agent, or the key, in that order. This is why Users needs nothing sent to work.

Sending metadata

Metadata is sent as a metadata.dimensions object alongside the rest of the call. Each entry in it becomes both a filter you can search on later and part of the permanent record of that call.

curl -X POST https://api.forgebench.ai/v1/chat/completions \
-H "Authorization: Bearer sk_..." \
-H "Content-Type: application/json" \
-d '{
  "model": "mock-gpt",
  "messages": [{"role": "user", "content": "Hello"}],
  "metadata": {
    "dimensions": {
      "feature": "checkout-assistant",
      "session": "conv_8f21",
      "customer": "acct_4471"
    }
  }
}'

The two keys with special meaning

KeyWhat it does
dimensions.featureNames the call, in place of the generic default. Use this to tell apart different kinds of calls your application makes, such as checkout-assistant versus order-lookup.
dimensions.sessionGroups every call sharing the same value into one session. See Sessions for the full picture.

Any other key is your own choice, and is recorded as a plain, searchable filter, for example dimensions.customer in the example above. There is no fixed list of allowed keys beyond the two above.

Limits

LimitValue
Keys per call8
Key formatLowercase letters, numbers, underscores, and hyphens only
Value length128 characters, beyond which the value is shortened

Next