Klawd is warming up
Preparing your workspace...
Fetching your latest data and tuning the fox engines.
Klawd is warming up
Fetching your latest data and tuning the fox engines.
Build with Klawd's unified LLM proxy. One API, every model. OpenAI-compatible from day one.
Get from zero to your first API call in under 5 minutes.
Create your account
Sign up to get $5 in free credits, then create an API key from Mission Control.
Install an SDK (optional)
Use any OpenAI-compatible client. The official openai package works out of the box.
Make your first call
Hit the chat completions endpoint with your key and model of choice.
curl https://api.klawd.studio/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-opus-4",
"messages": [{"role": "user", "content": "Hello"}]
}'All requests require a valid API key sent via the Authorization header.
Authorization: Bearer YOUR_API_KEY| Plan | Requests/Day | Requests/Min |
|---|---|---|
| Free | 100 | 10 |
| Pro ($29/mo) | 10,000 | 100 |
| Enterprise | Custom | Custom |
Klawd exposes OpenAI-compatible endpoints plus image generation. Base URL for chat & models: https://api.klawd.studio/v1 — Image endpoints use https://api.klawd.studio/api
Create a chat completion using OpenAI-compatible request/response format. Supports streaming via SSE.
{
"model": "klawd/auto",
"messages": [
{ "role": "system", "content": "You are a concise coding assistant." },
{ "role": "user", "content": "Write a TypeScript debounce function." }
],
"temperature": 0.7,
"max_tokens": 600,
"stream": false
}| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | required | Model ID to use (e.g. "anthropic/claude-opus-4") |
messages | array | required | Array of message objects with role and content |
temperature | number | optional(1) | Sampling temperature (0-2) |
max_tokens | integer | optional(4096) | Maximum tokens in the response |
stream | boolean | optional(false) | Enable SSE streaming |
top_p | number | optional(1) | Nucleus sampling threshold |
stop | string | array | optional | Stop sequences |
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1707500000,
"model": "anthropic/claude-opus-4",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 9,
"total_tokens": 21
}
}Set stream: true to receive Server-Sent Events. Each event is a data: line with a JSON chunk. The stream ends with data: [DONE].
const response = await fetch("https://api.klawd.studio/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "anthropic/claude-opus-4",
messages: [{ role: "user", content: "Tell me a story" }],
stream: true,
}),
});
const reader = response.body?.getReader();
const decoder = new TextDecoder();
while (reader) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
const lines = chunk.split("\n").filter(line => line.startsWith("data: "));
for (const line of lines) {
const data = line.replace("data: ", "");
if (data === "[DONE]") break;
const parsed = JSON.parse(data);
const content = parsed.choices?.[0]?.delta?.content;
if (content) process.stdout.write(content);
}
}List all available models with metadata and pricing hints.
Generate one or more images from a prompt. Requires Pro or Enterprise plan.
Route to any model through a single API. Pricing is per million tokens unless noted otherwise.
| Model | Provider | Context | Cost (input/output) |
|---|---|---|---|
klawd/autoSmart routing | Klawd | Varies | Varies |
klawd/standard | Klawd | Varies | Varies |
anthropic/claude-opus-4Most capable | Anthropic | 200K | $15 / $75 |
anthropic/claude-sonnet-4Best value | Anthropic | 200K | $3 / $15 |
openai/gpt-4-turbo | OpenAI | 128K | $10 / $30 |
google/gemini-2.0-flashLargest context | 1M | $0.075 / $0.30 | |
replicate/seedream-4.5Image gen | Replicate | N/A | $0.02/image |
Costs listed are per million tokens (per image for image generation). Actual billing reflects usage via your plan.
Copy-paste these examples to get started. Replace YOUR_API_KEY with your actual key from Mission Control.
curl https://api.klawd.studio/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-opus-4",
"messages": [{"role": "user", "content": "Hello"}]
}'$0/mo
100 req/day
10 req/min
$29/mo
10,000 req/day
100 req/min
Custom
Custom limits
Custom limits
Need more details? View full pricing page
All errors return a JSON body with an error object containing type and message fields.
| Code | Type | Description | Retryable |
|---|---|---|---|
400 | invalid_request | Malformed request body or missing required parameters | No |
401 | authentication_error | Invalid, expired, or missing API key | No |
429 | rate_limit_exceeded | Too many requests. Check Retry-After header | Yes |
500 | internal_error | Unexpected server error | Yes |
503 | service_unavailable | Upstream provider temporarily unavailable | Yes |
For retryable errors (429, 500, 503), implement exponential backoff with jitter. Here is a reference implementation:
async function callWithRetry(body: object, maxRetries = 3) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
const res = await fetch("https://api.klawd.studio/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
if (res.ok) return res.json();
if (res.status === 429 || res.status >= 500) {
const delay = Math.pow(2, attempt) * 1000 + Math.random() * 500;
console.log(`Retry ${attempt + 1}/${maxRetries} in ${delay}ms`);
await new Promise(r => setTimeout(r, delay));
continue;
}
// Client error — do not retry
const error = await res.json();
throw new Error(`API error ${res.status}: ${error.error?.message}`);
}
throw new Error("Max retries exceeded");
}Webhooks let you receive real-time notifications about events in your account. Configure your endpoint URL in Mission Control.
| Event | Description |
|---|---|
usage.updated | Fired when your usage metrics are updated (hourly) |
billing.invoice.paid | Fired when a subscription payment is successfully processed |
Every webhook includes an X-Klawd-Signature header. Verify it using HMAC-SHA256 with your webhook secret:
import crypto from "crypto";
function verifySignature(payload: string, signature: string, secret: string): boolean {
const expected = crypto
.createHmac("sha256", secret)
.update(payload)
.digest("hex");
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}We are here to help you build. Reach out via any channel below.
support@klawd.ai
Contact Us
Get in touch
Status Page
status.klawd.studio
Pricing & Plans
View plans and upgrade
Sign up for free credits, then create an API key from Mission Control.
Get started free