Skip to content

cURL

cURL is the most direct way to check a key or reproduce an issue without any tool in between. The examples assume your key is in KLORIA_API_KEY (see Quickstart).

Fenêtre de terminal
curl https://api.kloria.dev/v1/chat/completions \
-H "Authorization: Bearer $KLORIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6.1-sol",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Fenêtre de terminal
curl https://api.kloria.dev/v1/messages \
-H "x-api-key: $KLORIA_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5",
"max_tokens": 512,
"messages": [{"role": "user", "content": "Hello!"}]
}'

The Authorization: Bearer header also works on /v1/messages, as Claude Code uses it.

Add "stream": true to the body and -N to cURL to see events arrive without buffering:

Fenêtre de terminal
curl -N https://api.kloria.dev/v1/chat/completions \
-H "Authorization: Bearer $KLORIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5",
"stream": true,
"messages": [{"role": "user", "content": "Count to five."}]
}'

/v1/models generates no tokens: it’s the cheapest way to know whether a key is valid.

Fenêtre de terminal
curl -sS -o /dev/null -w "%{http_code}\n" https://api.kloria.dev/v1/models \
-H "Authorization: Bearer $KLORIA_API_KEY"

200: the key is valid. 401: it’s invalid, disabled or expired.

© 2026 Kloria — private beta