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).
OpenAI format
Section titled “OpenAI format”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!"}] }'$body = @{ model = "gpt-6.1-sol" messages = @(@{ role = "user"; content = "Hello!" })} | ConvertTo-Json -Depth 5
Invoke-RestMethod -Method Post -Uri "https://api.kloria.dev/v1/chat/completions" ` -Headers @{ Authorization = "Bearer $env:KLORIA_API_KEY" } ` -ContentType "application/json" -Body $bodyAnthropic format
Section titled “Anthropic format”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!"}] }'$body = @{ model = "claude-sonnet-5" max_tokens = 512 messages = @(@{ role = "user"; content = "Hello!" })} | ConvertTo-Json -Depth 5
Invoke-RestMethod -Method Post -Uri "https://api.kloria.dev/v1/messages" ` -Headers @{ "x-api-key" = $env:KLORIA_API_KEY; "anthropic-version" = "2023-06-01" } ` -ContentType "application/json" -Body $bodyThe Authorization: Bearer header also works on /v1/messages, as Claude Code uses it.
Streaming
Section titled “Streaming”Add "stream": true to the body and -N to cURL to see events arrive without buffering:
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."}] }'Check a key without spending credits
Section titled “Check a key without spending credits”/v1/models generates no tokens: it’s the cheapest way to know whether a key is valid.
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