Skip to content

feat(gateway): serve Anthropic Messages alongside the OpenAI protocols - #15

Merged
dinhdev666 merged 1 commit into
mainfrom
feat/anthropic-messages
Nov 24, 2026
Merged

dinhdev666 merged 1 commit into
mainfrom
feat/anthropic-messages

Conversation

@dinhdev666

Copy link
Copy Markdown
Owner

What

Adds the provider's third wire protocol as a first-class surface:

  • POST /v1/messages (Anthropic Messages) routed only to messages-typed providers,
    answering 404 endpoint_not_available when the fleet has none.
  • A messages provider API type, with one table each for the upstream path
    (API_TYPE_PATHS) and the body validator, so the third protocol cannot half-exist.
  • Vision, tool calling and reasoning forwarded unchanged on all three routes; only the
    parts the provider itself refuses (input_audio, file) are rejected, with a 400 that
    names the position and the type.
  • Bounds on client-controlled arrays and the tool schema before a provider slot is spent.
  • STREAM_BY_DEFAULT for the absent-stream case only; an explicit stream: false
    still answers JSON.
  • The dashboard's API-type select now derives its options from the server's apiTypes.

Verification

  • pnpm run check — syntax and imports (62 files), workflow pinning.
  • pnpm run typecheck — clean.
  • pnpm run test:web — 35 tests pass.
  • pnpm test — 159 unit checks, 497 smoke checks (524 with SMOKE_SLOW=1).
  • pnpm run check:commits — the branch's commit follows CONTRIBUTING.md.

The provider speaks three wire protocols and the router answered two: a
client of Anthropic Messages had no route, no validator and no provider
type. Add POST /v1/messages, a `messages` API type, and one table each
for the per-type upstream path and the validator that reads the body.

Forward vision, tool calling and reasoning unchanged on all three
routes, and refuse only what the provider itself refuses (`input_audio`,
`file`) with a 400 that names the position and the type. Bound the
client arrays and the tool schema before a provider slot is spent.

Add STREAM_BY_DEFAULT for the absent-`stream` case only, the provider
contract the tests read against, and a dashboard option list derived
from the server's own apiTypes answer.
@dinhdev666
dinhdev666 merged commit 8276c23 into main Nov 24, 2026
6 checks passed
@dinhdev666
dinhdev666 deleted the feat/anthropic-messages branch November 24, 2026 13:17
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