API // v1
Developers
A versioned REST API for the lab. Available to members whose plan includes API access — create a key in your Account.
Base URL: /api/public/v1 · every response carries the header AOI-API-Version: 1.
Auth: Authorization: Bearer aoi_…. Keys are shown once; revoke them anytime.
Errors: { error: { code, message } } with codes like unauthorized (401), insufficient_tokens (402), api_not_enabled (403), provider_not_connected (409).
Versioning: breaking changes ship as /v2; /v1 keeps working.
| GET | /v1 | Index of endpoints (no key) |
| GET | /v1/models | Models, ratios, study base phrase (no key) |
| GET | /v1/me | Your account and token balance |
| POST | /v1/generations | Create an image: { model, prompt, ratio?, study? } |
| GET | /v1/generations?limit=48 | List your images |
| DELETE | /v1/generations/:id | Delete an image |
| GET | /v1/styles | List your saved styles |
| POST | /v1/styles | Save a style: { name, description } |
| DELETE | /v1/styles/:id | Delete a style |
| GET | /v1/pipelines | List your pipelines |
| POST | /v1/pipelines | Create: { name, steps: [{ type, detail }] } |
| PUT | /v1/pipelines/:id | Replace name and steps |
| DELETE | /v1/pipelines/:id | Delete a pipeline |
curl -X POST https://<your-site>/api/public/v1/generations \
-H "Authorization: Bearer aoi_your_key" \
-H "Content-Type: application/json" \
-d '{"model":"lovable/image-fast","prompt":"Đông Hồ woodblock, red and ochre","ratio":"1:1","study":true}'Manage API keys