Authentication

Every request sends your key in the Authorization header.

AERLESS_, then 32 letters, digits, - or _

Where it goes#

request
curl
curl https://api.aerless.ai/v1/models \
  -H "Authorization: Bearer $AERLESS_API_KEY"
Python
client = OpenAI(
    base_url="https://api.aerless.ai/v1",
    api_key=os.environ["AERLESS_API_KEY"],
)
Node
const client = new OpenAI({
  baseURL: "https://api.aerless.ai/v1",
  apiKey: process.env.AERLESS_API_KEY,
});

Limits on a key#

All optional, set per key in the dashboard.

Spend limit per day, week, month or lifetime. Past it: 402 key_limit, uncharged.
Expiry: the key stops working.

Models: limit a key to chosen models. Others get 403.

Keeping keys safe#

  • The full key is shown once. Lost it? Create a new one.
  • One key per app, so you can revoke one alone.
  • Keep keys on the server, never in a web page or mobile app.
  • Leaked? Delete it and create a new one. Report misuse to support@aerless.ai.

Errors#

StatusCodeMeaning
401invalid_api_keyNo key, or unknown, disabled, deleted or expired
403account_bannedThe account is banned
403account_suspendedSuspended for an hour after repeated blocks
429rate_limitedToo many invalid-key requests from your address; wait for Retry-After