Getting started
Authentication
Authenticate every request with a team API key in the
Authorization header.Authorization: Bearer aio_3kq…API keys#
- Owners and admins create keys in Team settings → API keys. The full key is shown once; only a SHA-256 hash is stored.
- A key belongs to exactly one team. Generations it creates are charged to that team and appear in its library.
- A key acts with the current role of the member who created it, capped at
editor. If that member is downgraded to viewer the key becomes read-only; if they leave the team the key stops working. - Revoking a key takes effect immediately.
Keep keys server-side
CORS is open on/api/v1 so you can prototype from a browser, but a key embedded in client code can be copied and spend your credits. In production, call the API from your backend.What a key can do#
| Creator role | Key acts as | Read catalog & generations | Generate / upload / delete |
|---|---|---|---|
| owner, admin, editor | editor | yes | yes |
| viewer | viewer | yes | no, returns FORBIDDEN |
Check a key#
GET
/api/v1/meReturns the team the key belongs to, the effective role and the credit balance. Useful as a health check at startup.
curl https://<your-host>/api/v1/me -H "Authorization: Bearer $AIO_KEY"{
"object": "account",
"user": { "id": "a41c…", "email": "dev@example.com" },
"team": { "id": "7e02…", "name": "Studio North", "slug": "studio-north", "plan": "pro", "is_personal": false },
"role": "editor",
"auth": "api_key",
"credits": { "balance": 1840, "low": false, "low_threshold": 50, "top_up_url": "https://<your-host>/pricing" }
}Failures#
A missing, malformed or revoked key returns 401 UNAUTHORIZED. A valid key whose role is too low for the action returns 403 FORBIDDEN. See Errors.
{ "error": { "code": "UNAUTHORIZED", "message": "Invalid or revoked API key." } }