The AI Gateway speaks the OpenAI-compatible API: point an existing SDK at SetCloud, swap the key, and you’re running.

Create a key

  1. AI Gateway → API Keys.
  2. Create key and name it. One key per app or environment — name them accordingly.
  3. Optional, per key:
    • Allowed models — restrict which models the key may call.
    • Rate limits — requests and tokens per minute, both configurable per key. Defaults: 60 requests/min, 100,000 tokens/min.

The key is shown once, prefixed sk-sc-. Store it in the secrets vault or your deployment’s environment. Lose it, and the move is revoke-and-reissue.

Accounts can have up to 25 active keys. Revoke unused keys to free a slot.

Use it

Three endpoints, OpenAI-compatible, with streaming on chat:

  • POST /v1/chat/completions
  • POST /v1/embeddings
  • GET /v1/models

Code samples and the base URL are in the API reference.

A key restricted to specific models gets 403 model_not_allowed for anything else — useful for keeping a cheap-model app from quietly calling an expensive one.

Revoke

Same tab, instant effect. Revoke immediately if a key leaks; create the replacement first if it’s serving production traffic.

Not the same as CLI tokens

Keys from AI Gateway → API Keys authenticate the AI API. Tokens from setcloud tokens create authenticate the CLI and platform automation. AI keys start with sk-sc-; platform tokens start with sc_live_. They are managed separately.