Skip to content
Documentation menu

API keys

API keys authenticate your application's requests to the gateway.

Create a key

  1. Sign in to the dashboard.
  2. Open API keys and create a key.
  3. Copy it straight away. Keys start with acg_ and are shown once. They cannot be recovered, only replaced. We store only a hash.

You can hold several keys, for example one per app or environment.

Use a key

Send the key as a bearer token:

Authorization: Bearer acg_...

With the OpenAI SDKs, pass it as api_key (Python) or apiKey (JavaScript), together with the base URL https://api.aicloudgateway.com/v1.

Rotate without downtime

Create a new key, deploy it, then revoke the old one. A revoked key stops working within 60 seconds.

Limit a key's spend

Each key can have its own monthly budget: an estimated spend limit, a request limit, or both. See Budgets and guardrails.

Never put an API key in browser or mobile client code, or in source control. Call the gateway from your backend and keep keys in a secrets manager.

Full guide: api-reference.md on GitHub