Skip to content

Authentication

All API requests require authentication using an API key passed in the Authorization header.

  1. Sign up at hiapi.ai
  2. Go to Dashboard → API Keys
  3. Click Create New Key
  4. Copy the key — 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/images/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"model": "dall-e-3", "prompt": "hello world"}'
  • Never expose your API key in client-side code or public repositories
  • Use environment variables to store your key: HIAPI_API_KEY
  • Rotate keys regularly from the Dashboard
  • Use separate keys for development and production
Status CodeMeaning
401Invalid or missing API key
403API key doesn’t have permission
429Rate limit exceeded