Skip to content

fix: support Anthropic-native API format through keyring proxy#11

Closed
djangobits wants to merge 1 commit intojgarzik:mainfrom
djangobits:fix/anthropic-proxy-support
Closed

fix: support Anthropic-native API format through keyring proxy#11
djangobits wants to merge 1 commit intojgarzik:mainfrom
djangobits:fix/anthropic-proxy-support

Conversation

@djangobits
Copy link

Summary

  • Accept x-api-key header in proxy for Anthropic-native bot auth (in addition to Authorization: Bearer)
  • Fix path doubling (/v1/v1/messages) when Anthropic SDK includes basePath in requests
  • Add anthropic-version header and /responses/messages path translation
  • Use vendor-native API format in bot templates (anthropic-messages for Anthropic, google-generative-ai for Google) instead of hardcoded openai-responses

Test plan

  • All 180 existing tests pass (103 backend + 77 proxy)
  • Verified end-to-end: bot → keyring-proxy → Anthropic API via Telegram and web chat

🤖 Generated with Claude Code

The proxy only accepted Bearer token auth and used a single path
construction strategy, which broke when OpenClaw used the native
Anthropic Messages API format (x-api-key header, /v1/messages paths).

- Accept x-api-key header for bot auth (Anthropic SDK sends keys this
  way instead of Authorization: Bearer)
- Avoid doubling /v1 basePath when the client SDK already includes it
- Add anthropic-version header and /responses to /messages path
  translation for OpenAI-compat mode
- Use vendor-native API format in bot templates (anthropic-messages for
  Anthropic, google-generative-ai for Google) instead of hardcoded
  openai-responses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@djangobits
Copy link
Author

Closing: all fixes in this PR were independently addressed by upstream in PR #10 (with different but equivalent approaches). No additional changes needed.

@djangobits djangobits closed this Feb 6, 2026
@djangobits djangobits deleted the fix/anthropic-proxy-support branch February 6, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant