cURL Examples
Make API requests directly from your terminal
Basic Chat Completion
#!/usr/bin/env sh
BASE_URL="https://api.llmzone.net/v1"
API_KEY="YOUR_API_KEY"
curl "$BASE_URL/chat/completions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-6",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'With Streaming
curl "$BASE_URL/chat/completions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-6",
"messages": [
{"role": "user", "content": "Hello!"}
],
"stream": true
}'Expected Response
{
"choices": [
{
"finish_reason": "stop",
"message": {
"content": "Hello! How are you doing today? Is there something I can help you with?",
"role": "assistant"
}
}
],
"usage": {
"completion_tokens": 20,
"prompt_tokens": 9,
"total_tokens": 29
},
"model": "claude-opus-4-6"
}