Title: [AI Gateway] Missing usage.prompt_tokens_details.cached_tokens in /v1/chat/completions
Description
Vercel AI Gateway routes requests to models with automatic or explicit prompt caching (e.g. zai/glm-5.3, moonshotai/kimi-k3, deepseek/deepseek-v4-flash). While the Vercel dashboard and GET /v1/report endpoint accurately record cached_input_tokens, the OpenAI-compatible runtime endpoint (POST https://ai-gateway.vercel.sh/v1/chat/completions) drops the standard OpenAI prompt_tokens_details field.
Impact
Any tool, proxy, or SDK using the OpenAI compatibility standard (including LiteLLM, Langfuse, and corporate billing tools) receives prompt_tokens_details: null. This causes 5x+ phantom cost over-reporting in downstream accounting tools because callers cannot see which prompt tokens received cache-read discounts.
Affected Endpoints
POST https://ai-gateway.vercel.sh/v1/chat/completions(Non-streaming)POST https://ai-gateway.vercel.sh/v1/chat/completions(Streaming final chunk withstream_options: {"include_usage": true})POST https://ai-gateway.vercel.sh/v1/responses(OpenResponses endpoint)
Expected Behavior
POST /v1/chat/completions should adhere to the OpenAI usage schema:
"usage": { "prompt_tokens": 12847, "completion_tokens": 308, "total_tokens": 13155, "prompt_tokens_details": { "cached_tokens": 10920 }, "completion_tokens_details": { "reasoning_tokens": 0 }}Reference- Vercel Anthropic Messages endpoint (POST /v1/messages) already correctly exposes cache_read_input_tokens.- Vercel Custom Reporting (GET /v1/report) already tracks cached_input_tokens.- Please propagate this existing metadata into the usage.prompt_tokens_details object of /v1/chat/completions.