Providers

Claude API proxy: call Anthropic through the OpenAI SDK or the native Anthropic SDK

Route Claude calls through an LLM gateway two ways: the OpenAI SDK (change the model name to claude-*) or the native Anthropic SDK passthrough. Per-feature cost tracking, prompt-cache-aware costing and budgets enforced before the call.

Claude reaches Cognocient AI two ways. Both use the same proxy key, the same budgets and the same attribution headers, and both show up in the same dashboard.

OpenAI SDK routeNative Anthropic SDK route
Base URLhttps://api.cognocient.com/v1https://api.cognocient.com (no /v1)
Request formatOpenAI Chat Completions, translated for youAnthropic Messages API, passed through unchanged
Best forOne client for every provider; switching models by nameAnthropic-only features, betas, Claude Code
Budgets, Emergency Freeze, attribution, cost tracking✅✅
Prompt guardrails, response caching, routing rules, failover✅❌

Setup

Add your Anthropic API key in Settings → AI Providers, then pick a route.

The SDKs also read ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY from the environment, which is how Claude Code is pointed at the gateway.

The OpenAI SDK route: what is translated

Any model name starting with claude- is sent to Anthropic. The gateway converts the request to the Messages API and the reply back to the OpenAI shape:

OpenAI fieldBecomes
system messagesThe system prompt
max_tokens or max_completion_tokensmax_tokens (4,096 if neither is set)
temperature, top_pSame
stop (string or list)stop_sequences
toolsAnthropic tool definitions, on streamed and non-streamed calls
tool_choice: auto / required / none / {"function": {"name"}}auto / any / none / tool
parallel_tool_calls: falsedisable_parallel_tool_use
role: "tool" messagestool_result blocks
image_url content partsImage blocks (https URLs and base64 data: URLs)
StreamingAnthropic SSE converted to OpenAI chunks, tool calls included, with a final usage chunk

response_format (JSON mode) is not translated. For structured output from Claude on this route, use a forced tool call (tool_choice with a function name), which is what LangChain's with_structured_output does.

The native route: passthrough

On https://api.cognocient.com/v1/messages your request body and anthropic-* headers reach Anthropic unchanged, so new models, beta headers, extended thinking, PDFs and prompt-caching controls work the day Anthropic ships them. Budgets, the Emergency Freeze, attribution headers and cost tracking apply. Prompt guardrails, response caching, routing rules and provider failover don't, because they need to read or rewrite the request in OpenAI form.

Prompt caching and cost

Anthropic reports cache reads and cache writes separately, and they are priced differently: reads well below the input rate, writes above it (with a higher rate for 1-hour writes). Cognocient AI prices each part at its own rate, so a call that hits the cache shows its real cost, and Context Tax (Growth plan) can tell you which features would benefit from caching their system prompt.

Claude on AWS Bedrock

Claude models hosted on Bedrock use Bedrock model IDs (anthropic.claude-..., or us. / eu. / global. inference profiles) and your AWS credentials. See AWS Bedrock.

Frequently asked questions

On this page