feat(anthropic): Track A core protocol parity for /claude messages#119
Closed
joeblack2k wants to merge 14 commits intoSoju06:mainfrom
Closed
feat(anthropic): Track A core protocol parity for /claude messages#119joeblack2k wants to merge 14 commits intoSoju06:mainfrom
joeblack2k wants to merge 14 commits intoSoju06:mainfrom
Conversation
Add a dedicated `/claude/v1/messages` Anthropic-compatible endpoint backed by the local Claude SDK runtime while keeping existing OpenAI routes active in the same server. Wire Anthropic request logs, pricing, and usage windows into existing dashboard metrics, including OAuth usage polling and corrected cached input token accounting for Claude usage payloads.
Serve Anthropic-compatible messages over both the existing SDK-backed /claude endpoint and a new direct /claude-api endpoint so clients can choose runtime parity needs without changing servers. Add OAuth refresh-aware API transport plumbing, configuration docs, and integration coverage for both non-streaming and streaming paths.
Switch the default Anthropic route to the direct OAuth API transport at /claude/v1/messages and move the Claude SDK transport to /claude-sdk/v1/messages. Update docs, examples, and integration coverage so route semantics are explicit and consistent for testing and rollout.
Retry Anthropic API requests after token refresh not only on 401, but also on revoked-token 403 responses returned by OAuth-backed endpoints. This preserves automatic recovery when access tokens are revoked but a valid refresh token is still available.
This was referenced Feb 27, 2026
Contributor
Author
|
Update from this weekend’s canary->main rollout and incident fixes. What was pushed to this PR branch:
Why:
Validation performed:
Important scope note:
Next follow-up proposed:
|
…custom-mode limits
Contributor
Author
|
Follow-up from requested cleanup is now pushed. Added:
Validation:
|
Reintroduce settings force-model contract, model-overrides backend/frontend, and /v1/embeddings route support in track-a branch. Includes request-log compatibility alignment for override_id so logging no longer throws at runtime.
…isibility Fix request-logs/options 500 unpack regression, restore forced-model and client-app visibility in recent requests, persist store_requested in logs, increase auto-refresh cadence, and add response-context/store metrics fields for dashboard stats.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #114 and implements Track A from #115.
This PR introduces Anthropic core protocol support with API-first routing:
POST /claude/v1/messages-> Anthropic API transport (default)POST /claude-sdk/v1/messages-> Claude SDK transportWhy
We need a focused, reviewable baseline for Claude compatibility without bundling full dashboard/runtime/UI changes in one mega-PR. This slice establishes the protocol surface that Claude-style clients depend on.
Validation
Executed locally on this branch:
uv run ruff check app/modules/anthropic app/core/clients/anthropic_api_proxy.py app/core/clients/anthropic_proxy.py tests/unit/test_anthropic_api_proxy.py tests/integration/test_anthropic_messages_api.pyuv run pytest tests/unit/test_anthropic_api_proxy.py tests/unit/test_anthropic_credentials.py tests/unit/test_anthropic_service.py tests/integration/test_anthropic_messages_api.pyResult: all checks/tests passed.
Risks
Rollback
Rollout policy (important)