Skip to main content

Anthropic-Compatible API

Every CaseDesk deployment exposes an Anthropic Messages API-compatible endpoint at the same base URL as the OpenAI SDK — no format-specific path required:

https://getcasedesk.com/proxy/{deployment-id}/v1/messages

You can use it as a drop-in replacement for the Anthropic API by overriding the base URL in the official SDK.

:::warning Always call from your server — never from the browser CaseDesk does not expose CORS headers. Direct browser requests will fail. Always route requests through your own backend server. :::

API key

Every deployment has a production API key in cd_live_... format. Find it on the deployment detail page. Pass it as the x-api-key header (the standard Anthropic auth header):

x-api-key: cd_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

curl

curl https://getcasedesk.com/proxy/{deployment-id}/v1/messages \
-H "Content-Type: application/json" \
-H "anthropic-version: 2023-06-01" \
-H "x-api-key: cd_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-d '{
"model": "llama3.1:8b",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Explain quantum entanglement in simple terms."}]
}'

The anthropic-version: 2023-06-01 header is required — it matches the version expected by the Anthropic Messages API format.

Python

Install the SDK if you haven't already:

pip install anthropic
import anthropic

client = anthropic.Anthropic(
base_url="https://getcasedesk.com/proxy/{deployment-id}",
api_key="cd_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
)

message = client.messages.create(
model="llama3.1:8b",
max_tokens=1024,
messages=[
{"role": "user", "content": "Explain quantum entanglement in simple terms."}
],
)
print(message.content[0].text)

Node.js (server-side only)

Install the SDK if you haven't already:

npm install @anthropic-ai/sdk
import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic({
baseURL: 'https://getcasedesk.com/proxy/{deployment-id}',
apiKey: 'cd_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
});

const message = await client.messages.create({
model: 'llama3.1:8b',
max_tokens: 1024,
messages: [
{ role: 'user', content: 'Explain quantum entanglement in simple terms.' },
],
});

console.log(message.content[0].text);

Supported request fields

The endpoint accepts the standard Anthropic Messages API request body:

FieldRequiredNotes
modelYesThe model tag from your deployment (e.g. llama3.1:8b, deepseek-r1:14b)
messagesYesArray of {role, content} objects
max_tokensYesMaximum tokens to generate
systemNoSystem prompt string
temperatureNoSampling temperature (0–1)
streamNoSet to true for server-sent events streaming

Replace {deployment-id} with the ID shown on your deployment detail page, and cd_live_xxx... with your deployment's production API key.

Built-in tools

When workload-aware endpoint tools are active for your deployment, the model can call them automatically — no extra code needed on your side.

ToolWhat it does
Web SearchSearches the web for current information via SearXNG
Web ReaderFetches and reads the full text of a specific URL

The model decides when to call tools based on the user's question. Tool calls happen server-side — you receive the final answer as a normal Anthropic Messages API response.

:::note Streaming and tools When tools are enabled, the endpoint returns a buffered (non-streaming) response even if your request sets stream: true. This is because tool calls may require multiple model roundtrips before the final answer is ready. :::