API Reference
Request and Response Headers
The AI Gateway supports the following headers:
Request Headers
Name | Description |
---|---|
Authorization | You can send your API key as bearer token in the Authorization header. |
x-tfy-metadata | You can send metadata in the x-tfy-metadata header. This is stringified json of key value pairs. This can be used to route your request based on config and also filter out metrics. |
x-tfy-provider-name | This required for responses api, file upload api and batch apis. You can send the provider account name in the x-tfy-provider-account header. This is used to route your request to the correct provider account. |
x-tfy-strict-openai | boolean, This is used to enable strict openai compatibility. This needs to be set false for claude reasoning model responses with thinking tokens in response |
Response Headers
Name | Description |
---|---|
x-tfy-resolved-model | This field contains the final truefoundry model id that was used to process the request. The original model id can be overriden due to load balancing or fallback models |
x-tfy-applied-configurations | This field contains the applied configurations (as a dictionary) including load balancing, fallback, model config, applied guardrails and rate limiting |