Anthropic
Configuration
Section titled “Configuration”| Variable | Required |
|---|---|
ANTHROPIC_API_KEY | Yes |
Gateway
Section titled “Gateway”curl -X POST http://localhost:8080/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{"model": "anthropic/claude-sonnet-4-20250514", "messages": [{"role": "user", "content": "Hello!"}]}'Library
Section titled “Library”use llmg_providers::anthropic::AnthropicClient;use llmg_core::provider::Provider;
let client = AnthropicClient::from_env()?;// orlet client = AnthropicClient::new("sk-ant-...");Features
Section titled “Features”- Chat completions (auto-converts to Anthropic format)
- Custom base URL
- Anthropic API version header
LLMG automatically converts between the OpenAI message format and Anthropic’s native format. System messages are extracted and sent via the system parameter.