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.
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:
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.