Skip to main content

Quick Start

Get started with the Zihin API in 5 minutes.

1. Get Your API Key

Contact the Zihin team to get your API 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: zhn_live_xxxxx" \
-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