Examples

Integration examples

Get from zero to your first response in minutes. Pick the client you already use — the endpoint is fully compatible.

Good to know All examples use the same endpoint. To switch models, change only the "model" value — no other code changes required.

The fastest way to test your key from any terminal.

cURL curl https://clauden.ai/v1/chat/completions \ -H "Authorization: Bearer $CLAUDEN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-6", "messages": [{"role": "user", "content": "Hello!"}] }'

Use the official OpenAI SDK — just point base_url at ClaudeN AI.

OpenAI Python SDK from openai import OpenAI client = OpenAI( api_key="$CLAUDEN_API_KEY", base_url="https://clauden.ai/v1", ) resp = client.chat.completions.create( model="gpt-5.4", messages=[{"role": "user", "content": "Hello!"}], ) print(resp.choices[0].message.content)

Prefer the Anthropic SDK? Use the /v1/anthropic base URL.

Anthropic Python SDK from anthropic import Anthropic client = Anthropic( api_key="$CLAUDEN_API_KEY", base_url="https://clauden.ai/v1/anthropic", ) msg = client.messages.create( model="claude-sonnet-4-6", max_tokens=1024, messages=[{"role": "user", "content": "Hello!"}], ) print(msg.content[0].text)

Replace $CLAUDEN_API_KEY with your own API key (it starts with sk-). It is sent in the Authorization header.

Get your API key Quick Start →

Sign up and get $5 free credit