AI 网关支持各种标头来帮助您配置、自定义和管理您的 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-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 trigger a fallback provider based on a predetermined response time (measured in milliseconds). |
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 | cf-aig-step identifies the processing step in the AI Gateway flow for better tracking and debugging. |
cf-cache-ttl | Deprecated: This header is replaced by |
cf-skip-cache | Deprecated: This header is replaced by |
AI 网关中的设置可以在三个级别配置:提供商、请求和网关。由于相同的设置可以在多个位置配置,以下层次结构确定应用哪个值:
- 提供商级别标头: 仅在使用通用端点时相关,这些标头优先于所有其他配置。
- 请求级别标头: 如果未设置提供商级别标头,则应用此级别。
- 网关级别设置: 仅在提供商或请求级别未设置标头时作为默认值。
此层次结构确保一致的行为,优先考虑最具体的配置。使用提供商级别和请求级别标头进行更精细的控制,使用网关设置作为通用默认值。
- @2025 Cloudflare Ubitools
- Cf Repo