SDKs and frameworks
Anthropic SDK
The official Anthropic SDKs work unchanged: set the base URL to https://vioneer.xyz/api (the SDK adds /v1/messages) and use your Vioneer key.
Python
# pip install anthropic
import os
import anthropic
client = anthropic.Anthropic(
api_key=os.environ["VIONEER_API_KEY"],
base_url="https://vioneer.xyz/api", # the SDK adds /v1/messages
)
message = client.messages.create(
model="claude-sonnet-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}],
)
print(message.content[0].text)
TypeScript
// npm install @anthropic-ai/sdk
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
apiKey: process.env.VIONEER_API_KEY,
baseURL: 'https://vioneer.xyz/api',
});
const stream = client.messages.stream({
model: 'claude-sonnet-5-5',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Write a haiku about the sea.' }],
});
for await (const event of stream) {
if (event.type === 'content_block_delta' && event.delta.type === 'text_delta') {
process.stdout.write(event.delta.text);
}
}
With environment variables
export ANTHROPIC_BASE_URL="https://vioneer.xyz/api"
export ANTHROPIC_API_KEY="$VIONEER_API_KEY"
Without an SDK
curl https://vioneer.xyz/api/v1/messages \
-H "x-api-key: $VIONEER_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello!"}]
}'
If something does not work
- 401: the key is wrong, revoked or missing. Keys are shown once, when you create them; make a new one in the dashboard if in doubt.
- 402: the account is out of credit. Top up and the next request goes through.
- 403: the key is not allowed that model. Check its model allowlist under Keys.
- 404 on a model: the id is not in the catalogue. Copy it from the price list.
- 429: a rate or concurrency limit was hit. Wait for the
retry-afterseconds, or raise the key’s limit.
Every request, failed ones included, is listed in the dashboard’s activity log with its status and cost.