Skip to main content

Your First Call

Make your first Zihin LLM call in under 5 minutes: create an API key, then POST to the public endpoint https://llm.zihin.ai/api/v3/llm/public/call with a query and model: "auto". The response returns the answer plus the model chosen, token usage, cost, and latency. Examples in curl, Node.js, and Python below.

1. Get Your API Key​

  1. Sign up at console.zihin.ai
  2. Go to Settings > API Keys
  3. Create a new key

Keys follow the format:

zhn_live_xxxxx (production)
zhn_test_xxxxx (sandbox)

2. Make Your First Call​

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

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​