Introduction
Claudly is a high-performance, unified API provider. We offer a drop-in replacement for both Anthropic and OpenAI SDKs, routed through our optimized global network.
Anthropic Format
Use your standard Anthropic API requests. Simply change the base URL to api.claudly.com and use your Claudly API key.
bash
curl https://api.claudly.com/v1/messages \
-H "x-api-key: $CLAUDLY_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-3-5-sonnet-20240620",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello, world"}
]
}'OpenAI Format
We fully support the OpenAI API format. You can use the official OpenAI SDKs to connect to Claudly models by overriding the base URL.
typescript
import OpenAI from "openai";
const openai = new OpenAI({
baseURL: "https://api.claudly.com/v1",
apiKey: process.env.CLAUDLY_API_KEY,
});
const response = await openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello, world" }],
});