Claude Code & Anthropic SDK
Run Claude Code, Anthropic Python SDK, and other Anthropic-compatible tools directly against staik — Swedish GPU infrastructure with full data residency.
Quickstart
staik offers an Anthropic Messages API-compatible endpoint:
POST https://api.staik.se/v1/messagesSame auth as all other staik endpoints — send your API key via x-api-key header or Authorization: Bearer.
Claude Code
Point Claude Code at staik by setting two environment variables:
# Set environment variables
export ANTHROPIC_BASE_URL=https://api.staik.se
export ANTHROPIC_API_KEY=sk-st-your-key
# Launch Claude Code
claudeClaude Code will now use staik's Swedish GPUs instead of Anthropic's cloud service. All tools work — file reading, searching, code editing, and more.
Tip
You can add the variables to your .bashrc, .zshrc, or .env file so they are set automatically every time you open a terminal.
# ~/.zshrc
export ANTHROPIC_BASE_URL=https://api.staik.se
export ANTHROPIC_API_KEY=sk-st-your-keyImportant about token usage
Claude Code is token-intensive: each request sends the system prompt, tool definitions, CLAUDE.md files and the full conversation history — often 20,000–30,000 prompt tokens per call. The Early Adopter plan's 100,000 tokens/day limit therefore typically only lasts 3–4 requests.
For serious Claude Code usage we recommend the Early Agent plan (50,000 tokens/hour rolling window) or one of the Agent plans. Contact customercare@staik.se and we'll upgrade you.
Anthropic SDK
Use the Anthropic Python or TypeScript SDK directly with staik.
import anthropic
client = anthropic.Anthropic(
base_url="https://api.staik.se",
api_key="sk-st-your-key",
)
message = client.messages.create(
model="qwen3.5:35b-a3b",
max_tokens=1024,
messages=[
{"role": "user", "content": "Explain how a transformer works."}
],
)
print(message.content[0].text)import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://api.staik.se",
apiKey: "sk-st-your-key",
});
const message = await client.messages.create({
model: "qwen3.5:35b-a3b",
max_tokens: 1024,
messages: [
{ role: "user", content: "Explain how a transformer works." }
],
});
console.log(message.content[0].text);import anthropic
client = anthropic.Anthropic(
base_url="https://api.staik.se",
api_key="sk-st-your-key",
)
with client.messages.stream(
model="qwen3.5:35b-a3b",
max_tokens=1024,
messages=[{"role": "user", "content": "Write a haiku about Stockholm"}],
) as stream:
for text in stream.text_stream:
print(text, end="", flush=True)Model Mapping
You can send either staik model names or Claude model names — both work. Claude names are automatically mapped:
| Sent model name | Maps to |
|---|---|
| qwen3.5:35b-a3b | qwen3.5:35b-a3b |
| qwen3.5:9b | qwen3.5:9b |
| gemma4:31b | gemma4:31b |
| claude-sonnet-4-6 | qwen3.5:35b-a3b |
| claude-opus-4-6 | qwen3.5:35b-a3b |
| claude-haiku-4-5-20251001 | qwen3.5:9b |
Recommendation: use staik model names directly for clarity. Claude mapping exists primarily for seamless Claude Code integration.
Supported Features
Text responses
Full support for single and multi-turn conversations.
Streaming
Server-sent events in Anthropic format (message_start, content_block_delta, message_stop).
Tool calling
Tools are automatically translated between Anthropic (tool_use/tool_result) and OpenAI format.
System prompt
Support for system as string or list of content blocks.
Auth & rate limiting
Same token limits, queues, and circuit breaker as the OpenAI endpoint.
Model selection
Choose staik model via the model field — all models available.
Limitations
The following Anthropic-specific features are not supported because the backend models (Qwen, Gemma) do not have these capabilities:
- !Extended thinking — the thinking parameter is ignored. The model thinks inline instead.
- !Images in messages — Anthropic format for images (base64 image content blocks) is not yet supported via this endpoint. Use the OpenAI endpoint for vision.
- !PDF / document — Anthropic's document content block type is not supported.
- !Prompt caching — the cache_control field is ignored. All requests are fully processed.
Ready to start?
All plans have access to the Anthropic endpoint. Use your existing staik API key.