Headers for authentication and metadata in the AI Gateway
Authorization
header:
Name | Description |
---|---|
Authorization | Your TrueFoundry API key as bearer token |
x-tfy-metadata | Stringified JSON where both keys and values must be strings. Used for request routing and metrics filtering |
x-tfy-provider-name | Required for responses API, file upload API, and batch APIs to route requests to the correct provider account |
x-tfy-strict-openai | Boolean flag to enable strict OpenAI compatibility (set to false for Claude reasoning model responses with thinking tokens) |
x-tfy-retry-config | JSON object to configure retry behavior for failed requests (see example below) |
x-tfy-request-timeout | Number in milliseconds specifying the maximum time to wait for a response |
Name | Description |
---|---|
x-tfy-resolved-model | The final TrueFoundry model ID used to process the request (may differ from requested model due to load balancing or fallbacks) |
x-tfy-applied-configurations | Dictionary of applied configurations including load balancing, fallback, model config, applied guardrails, and rate limiting |
server-timing | For non-streaming requests only. Contains timing information for different processing stages including middlewares, guardrails, and model calls |
server-timing
header with timing information like this:
Server-timing header in browser developer tools