Repository navigation
Description
Feature Request
Add a bounded native Anthropic Messages client-to-provider path through the existing AI Proxy Protocol/Provider/Transport architecture. Applications using the native API should be able to use gateway routing, credentials, deadlines and observations without first rewriting requests into OpenAI Chat.
Current Baseline and Existing Work
At master 88883dc20fb1f57db6343ba811c1d1f3ee70a6bf, AI Proxy documents Chat/Responses support and explicitly excludes native Claude/Gemini upstream transports. #7382 delivers Chat/Responses and lists Anthropic as future work; #7871 delivered provider-native routing/conversion foundations. #8371 owns shared protocol detection and prompt-plugin adoption, not the upstream binding itself.
First Delivery
- Define an explicit native Messages protocol registration and an Anthropic provider binding, with a documented API-version/capability profile. Keep request/response semantics in Protocol and endpoint/authentication/target configuration in Provider; reuse the existing reactive transport and orchestration.
- Support text messages with normal JSON and incremental SSE responses. Preserve native content, stop/error semantics and unknown fields where forwarding is safe. Explicitly classify unsupported beta, multimodal or tool modes before opening the upstream; do not silently convert or drop fields.
- Bind credentials and required version headers to the configured target, preserving existing proxy-key authorization and fallback destination policies. Do not expose secrets in diagnostics or forward unrelated caller credentials.
- Validate raw completion evidence, error events, truncation and cancellation using the declared native stream contract. Do not apply the OpenAI
[DONE]convention to this protocol. - Integrate native usage observations through [Task] Integrate shared per-attempt LLM usage metering across supported protocols #7955/[Task][AI Proxy] Integrate AI Proxy attempt lifecycle with shared usage and invocation telemetry #8125 and declare which governance plugins can inspect the selected payload. Unsupported inspection is explicit; do not advertise Prompt/PII/Token policy parity without fixtures.
- Reuse current timeout, byte/event limits, backpressure and post-commit retry/fallback restrictions. Default Chat/Responses behavior and configuration remain compatible.
Acceptance Criteria
- A local native-protocol server fixture verifies endpoint, credentials/version binding and text request/response preservation for JSON and fragmented SSE.
- Tests cover UTF-8/event fragmentation, native terminal/error events, incomplete streams, byte/deadline limits and cancellation reaching the original upstream exchange.
- Unsupported declared modes fail explicitly before upstream execution; supported native fields are not silently lost.
- Usage is recorded once per actual attempt with unknown categories distinguished; no second ledger or budget debit is introduced.
- Document the tested API profile, supported governance matrix, opt-in configuration and rollback. A real-service smoke test, if performed, is identified separately from local fixtures.
Scope Boundaries
Start with the direct Messages HTTP API. Bedrock/Vertex variants, agent execution, automatic cross-protocol conversion and full beta/multimodal/tool coverage are separate increments. Coordinate detection with #8371 and completion evidence with #8123; do not add another HTTP stack.
Protocol References
The native endpoint and message representation are defined by the Messages API reference. Native incremental delivery is documented in Streaming messages. Pin the supported profile and fixtures during implementation; these references are not a claim of current ShenYu support.
Activity
hengyuss commentedon Nov 10, 2026
/assign