Skip to content

feat: add direct Anthropic API support (CLAUDE-ANTHROPIC)#448

Merged
jmacAJ merged 1 commit intoaj-archipelago:mainfrom
data-angel:feat/anthropic-direct-api
Jan 21, 2026
Merged

feat: add direct Anthropic API support (CLAUDE-ANTHROPIC)#448
jmacAJ merged 1 commit intoaj-archipelago:mainfrom
data-angel:feat/anthropic-direct-api

Conversation

@data-angel
Copy link
Copy Markdown
Contributor

Summary

Adds support for direct access to Anthropic's API at api.anthropic.com, without requiring Google Vertex AI.

  • New plugin: ClaudeAnthropicPlugin extends Claude4VertexPlugin to reuse all message/content conversion logic
  • New model type: CLAUDE-ANTHROPIC
  • New models: claude-sonnet-4, claude-45-sonnet, claude-45-opus

Key differences from CLAUDE-4-VERTEX:

  • Uses x-api-key header authentication (via CLAUDE_API_KEY env var)
  • Model specified in request body, not URL
  • anthropic-version header instead of body parameter
  • Stream parameter in request body

Features supported:

  • Streaming and non-streaming chat completions
  • Tool calling
  • Vision (images)
  • Document input (PDF)
  • System messages

Files Changed

  • server/plugins/claudeAnthropicPlugin.js - New plugin
  • server/modelExecutor.js - Import and case statement
  • config.js - Model configurations and claudeApiKey config entry
  • tests/unit/plugins/claudeAnthropicPlugin.test.js - Unit tests
  • tests/integration/rest/vendors/claude_anthropic_direct.test.js - Integration tests

Test Plan

  • Unit tests pass: npm test -- tests/unit/plugins/claudeAnthropicPlugin.test.js
  • Integration tests pass (requires CLAUDE_API_KEY): npm test -- tests/integration/rest/vendors/claude_anthropic_direct.test.js
  • Manual test streaming with claude-45-sonnet model

Add ClaudeAnthropicPlugin for direct access to Anthropic's API at
api.anthropic.com, bypassing the need for Google Vertex AI.

Key differences from CLAUDE-4-VERTEX:
- Uses x-api-key header authentication
- Model specified in request body
- anthropic-version header instead of body parameter
- Stream parameter in request body

Added models:
- claude-sonnet-4: Claude Sonnet 4 via direct API
- claude-45-sonnet: Claude 4.5 Sonnet via direct API
- claude-45-opus: Claude 4.5 Opus via direct API

All models support streaming, tool calling, vision, and document
(PDF) input via the inherited Claude4VertexPlugin functionality.

Includes unit tests and integration tests.
@jmacAJ jmacAJ merged commit 5971c14 into aj-archipelago:main Jan 21, 2026
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.

3 participants