Docs menu

Gateway

Attribution and sessions

Label calls by application and end user, group agent steps into sessions, and trace a request across systems.

Every call appears in Calls & usage with its model, tokens, latency and cost. Headers add context without changing the request body.

Label the application

Send X-Title with a short application name. It appears in the App column. If it is absent, Seldon uses the Referer header.

Python
client = OpenAI(
    api_key=os.environ["SELDON_API_KEY"],
    base_url=os.environ["SELDON_BASE_URL"],
    default_headers={"X-Title": "support-bot"},
)

Label the end user

Set the standard user field, or the X-Seldon-End-User header, to an opaque identifier for your end user. Values are truncated to 256 characters, and __all__ is reserved. Don't send names or email addresses.

Group calls into sessions

Agent frameworks make many calls per task. Correlation headers let Seldon group them:

HeaderPurpose
X-Seldon-Session-IdGroups calls that belong to one session or conversation. X-Seldon-Conversation-Id is an alias; if you send both, they must match.
X-Seldon-Run-Id, X-Seldon-Turn-IdIdentify a run or turn within the session.
X-Seldon-Span-IdYour ID for this call. It must be unique; reuse returns 409 duplicate_span_id. When omitted in a session, Seldon assigns one.
X-Seldon-Parent-Span-IdThe span that caused this call.
X-Seldon-Parent-Trace-IdA UUID: the X-Seldon-Trace-Id of the parent call.
X-Seldon-Span-Name, X-Seldon-Session-NameHuman-readable labels.
X-Seldon-Session-PathA path that starts with /, up to 512 bytes.
X-Seldon-Session-MetadataA JSON object of string values, up to 2 KiB. Keys match ^[a-z0-9_.-]{1,64}$.

IDs are at most 200 bytes, with no control characters and no /, ? or #. Invalid headers return 400 invalid_correlation before any provider is called. A parent span or trace must belong to the same session.

W3C trace context

Seldon also reads traceparent and baggage. The traceparent parent span is used as the parent span unless X-Seldon-Parent-Span-Id conflicts with it, which is rejected.

Response headers

HeaderMeaning
X-Seldon-Trace-IdSeldon's ID for this call, on every accepted JSON and streaming response. Include it in support requests.
X-Seldon-Span-IdThe span ID used for this call, when the call belongs to a session.
Retry-AfterSeconds to wait, on 429 and some 503 responses.
Attribution and sessions | Seldon