feat: antropik cache — default anthropic-version, forward cache headers, model features, streaming usage, tests

- Auto-default anthropic-version to 2023-06-01 for prompt caching
- Forward cache headers (x-cache, cf-cache-status, age, etc.) from backend
- Add features: ["prompt_caching"] to /v1/models response
- Extract and report actual usage tokens in streaming message_delta
- Track output char count for token estimation when backend omits it
- Cache-aware usage reporting: cache_creation_input_tokens, cache_read_input_tokens
- Comprehensive tests for cache_control preservation in content blocks & system
This commit is contained in:
MythEclipse
2026-06-20 21:38:34 +07:00
parent 7bb1b443be
commit ccb1523692
5 changed files with 405 additions and 71 deletions
+1
View File
@@ -471,6 +471,7 @@ export default {
object: "model",
created: Math.floor(Date.now() / 1000),
owned_by: "proxy",
features: ["prompt_caching"],
}));
return new Response(
JSON.stringify({ object: "list", data: models }),