Bắt đầu nhanh

Bắt đầu nhanh

Everything you need to make your first request — sign up, grab a key, set your base URL, and go.

Tương thích với OpenAI SDK · Anthropic SDK · cURL

Bước 1 — Đăng ký & nhận tín dụng miễn phí

Bước 2 — Tạo API key

Bước 3 — Đặt base URL của bạn

Base URL tương thích OpenAI https://clauden.ai/v1
Base URL tương thích Anthropic https://clauden.ai/v1/anthropic

Bước 4 — Gửi yêu cầu đầu tiên

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!"}] }'

Gửi API key của riêng bạn (bắt đầu bằng sk-) dưới dạng Bearer token trong header Authorization.

Lấy API key của bạn Ví dụ →

API reference essentials

Authentication

Every request needs an Authorization header with your API key as a Bearer token. Keys are created in the console under API Keys and start with your account prefix. Keep keys server-side; never ship them in client-side code.

HTTP Header Authorization: Bearer $CLAUDEN_API_KEY

Streaming

Both endpoints support server-sent events. Set "stream": true in the request body and read the response line by line; chunks follow the OpenAI delta format on /v1/chat/completions and the Anthropic event format on /v1/anthropic. Remember to handle the final [DONE] line and network timeouts.

Model naming

The model parameter routes your request: claude-* names go to Anthropic, gpt-* to OpenAI, gemini-* to Google. The exact list of enabled model names and per-token prices is always on the pricing page — use those strings verbatim.

Xem bảng giá →

Error codes

HTTPLoại
401Invalid or missing API key. Check the Authorization header.
402Insufficient balance. Top up to continue; requests resume immediately after credit.
404Unknown model name or wrong endpoint path.
429Rate limited. Slow down or retry with exponential backoff.
500+Upstream or gateway error. Safe to retry once with backoff; contact support if it persists.

Helpful resources

Đăng ký và nhận $5 tín dụng miễn phí