Your First Call
Get your API key and make your first LLM call in under 5 minutes.
1. Get Your API Key
- Sign up at console.zihin.ai
- Go to Settings > API Keys
- Create a new key
Keys follow the format:
zhn_live_xxxxx (production)
zhn_test_xxxxx (sandbox)
2. Make Your First Call
- curl
- Node.js
- Python
curl -X POST https://llm.zihin.ai/api/v3/llm/public/call \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What is the capital of France?",
"model": "auto"
}'
const response = await fetch('https://llm.zihin.ai/api/v3/llm/public/call', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
query: 'What is the capital of France?',
model: 'auto',
}),
});
const data = await response.json();
console.log(data.response);
import requests
response = requests.post(
"https://llm.zihin.ai/api/v3/llm/public/call",
headers={
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"query": "What is the capital of France?",
"model": "auto",
},
)
data = response.json()
print(data["response"])
3. Response
{
"success": true,
"response": "The capital of France is Paris.",
"model": "gpt-4o-mini",
"provider": "openai",
"usage": {
"input_tokens": 15,
"output_tokens": 8,
"total_tokens": 23
},
"cost": 0.00015,
"latency_ms": 450
}
Using Auto-Routing
Set model: "auto" to let the system automatically select the best model for your task:
{
"query": "Write a Python function to sort a list",
"model": "auto"
}
The system analyzes your prompt and routes to the optimal model based on:
- Task complexity
- Cost efficiency
- Response quality requirements
Next Steps
- Authentication — Learn about JWT and API keys
- Core Concepts — Understand tenants, models, and agents
- API Reference — Full API documentation
- Models — Available models and providers