Create a short-lived client token for browser SDK use.
Use case: Your backend calls this endpoint to generate a token, then passes it to your frontend. The frontend uses the token to make authenticated requests to /client/* endpoints.
Payload:
publicMetadata: Displayable properties, exposed via GET /client/token. For agent identity/attributes use serverContext.serverContext: Agent-facing context (identity, attributes, pass-through). Same shape as request context for chat/invoke. Never exposed to client.Security:
Example flow:
POST /v1/client-tokens with { publicMetadata: { displayName: "Jane", plan: "pro" }, serverContext: { identity: { user_id: "user_123" }, attributes: { user: { name: "Jane", email: "jane@example.com" } } } }/client/* endpointsAPI Key or Personal Access Token (PAT). When using PAT, include X-Project header.
Public metadata (display name, plan, etc.) exposed via GET /client/token. For agent identity/attributes use serverContext.
Agent-facing context (identity, attributes, pass-through). Only accessible to agents/handlers, never exposed to client. Same shape as request context for chat/invoke.
Time-to-live in seconds. Default: 3600 (1 hour). Max: 86400 (24 hours).
0 < x <= 86400