AONISDocs

Getting started / 04

Authentication

Authenticate every Aonis API request using your API key.

Authorization header

Create API keys in the Aonis Dashboard, then send them with Bearer authentication.

http · Authorization
Authorization: Bearer YOUR_AONIS_API_KEY

shell · cURL
curl https://api.aonis.space/v1/models \
  -H "Authorization: Bearer YOUR_AONIS_API_KEY"

Missing, invalid, and disabled API keys currently return HTTP 401.

Environment variables

Keep credentials outside source code and load them from the environment.

shell · Linux / macOS
export AONIS_API_KEY="YOUR_AONIS_API_KEY"

powershell · PowerShell
$env:AONIS_API_KEY="YOUR_AONIS_API_KEY"

Security best practices

  • Never expose API keys in frontend or client-side code.
  • Store keys in environment variables or a secret manager.
  • Never commit API keys to Git.
  • Rotate a key immediately if it may have been exposed.
  • Use separate keys for different applications or environments when appropriate.
View authentication errors →