Skip to content
English

Authentication

All API requests require an API key in the Authorization header. In production, keep that key on the server side and let your backend call HiAPI.

  1. Sign up at hiapi.ai
  2. Go to Dashboard → API Keys
  3. Click Create New Key
  4. Copy the key and store it securely — it won’t be shown again

Include the key in the Authorization header with the Bearer prefix:

Terminal window
curl https://api.hiapi.ai/v1/images/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"model": "qwen-image-2.0", "prompt": "minimal product icon, warm orange accent"}'
  • Never expose your API key in browser code, mobile bundles, or public repositories
  • Use environment variables to store your key: HIAPI_API_KEY
  • Rotate keys regularly from the Dashboard and re-verify the request path after rotation
  • Use separate keys for development and production
  • Proxy requests through your backend if end users can submit prompts or files
Status CodeMeaning
401Invalid or missing API key
403API key doesn’t have permission
429Rate limit exceeded