Skip to content
English

cURL

cURL is the fastest way to test HiAPI endpoints from the command line.

All requests need the Authorization header:

Terminal window
-H "Authorization: Bearer YOUR_API_KEY"
Terminal window
curl -X POST https://api.hiapi.ai/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-image-2.0",
"prompt": "a futuristic city at sunset",
"size": "1024x1024"
}'
Terminal window
curl -X POST https://api.hiapi.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Nano-Banana",
"stream": false,
"messages": [{"role": "user", "content": "draw a cute cat"}]
}'
Terminal window
curl -X POST https://api.hiapi.ai/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.7-t2v",
"prompt": "sunset timelapse over mountains",
"size": "1920*1080",
"seconds": "5"
}'
Terminal window
curl https://api.hiapi.ai/v1/dashboard/billing/usage \
-H "Authorization: Bearer YOUR_API_KEY"
  • Use jq to pretty-print responses: curl ... | jq .
  • Save API key as env variable: export HIAPI_KEY=sk-... then use -H "Authorization: Bearer $HIAPI_KEY"