AI Gateway 支持多种标头,帮助你配置、自定义和管理 API 请求。本页提供所有支持标头的完整列表及简要说明。
| Term | Definition |
|---|---|
| cf-aig-backoff | Header to customize the backoff type for request retries of a request. |
| cf-aig-cache-key | The cf-aig-cache-key-aig-cache-key let you override the default cache key in order to precisely set the cacheability setting for any resource. |
| cf-aig-cache-status | Status indicator for caching, showing if a request was served from cache. |
| cf-aig-cache-ttl | Specifies the cache time-to-live for responses. |
| cf-aig-collect-log | The cf-aig-collect-log header allows you to bypass the default log setting for the gateway. |
| cf-aig-custom-cost | Allows the customization of request cost to reflect user-defined parameters. |
| cf-aig-dlp | A response header returned when a DLP policy matches a request or response. Contains JSON with the action taken (Flag or Block), matched policy IDs, matched profile IDs, and detection entry IDs. |
| cf-aig-event-id | cf-aig-event-id is a unique identifier for an event, used to trace specific events through the system. |
| cf-aig-log-id | The cf-aig-log-id is a unique identifier for the specific log entry to which you want to add feedback. |
| cf-aig-max-attempts | Header to customize the number of max attempts for request retries of a request. |
| cf-aig-metadata | Custom metadataallows you to tag requests with user IDs or other identifiers, enabling better tracking and analysis of your requests. |
| cf-aig-request-timeout | Header to set a request timeout (measured in milliseconds). If the provider does not respond within this time, the request returns an error. |
| cf-aig-retry-delay | Header to customize the retry delay for request retries of a request. |
| cf-aig-skip-cache | Header to bypass caching for a specific request. |
| cf-aig-step | The cf-aig-step response header identifies which step in a request flow successfully processed the request, useful for tracking and debugging. |
| cf-cache-ttl | Deprecated: This header is replaced by |
| cf-skip-cache | Deprecated: This header is replaced by |
AI Gateway 中的设置可在两个层级配置:请求和 Gateway。由于同一设置可在多个位置配置,以下层级决定应用哪个值:
- 请求级标头: 单个请求中包含的标头优先于 gateway 级设置。
- Gateway 级设置: 如果请求级未设置标头,则作为默认值。
此层级确保行为一致,优先应用最具体的配置。使用请求级标头进行精细控制,使用 gateway 设置作为通用默认值。