Skip to content
English

Authentication

Every request needs an API keyAuthorization: Bearer YOUR_API_KEY

In production, keep the 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 -X POST https://api.hiapi.ai/v1/tasks \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-image-2", "input": {"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