Clients, Projects & Tokens
These endpoints let a client app manage the account-side resources: clients (organizations), projects that belong to a client, and the API tokens used to authenticate. All endpoints accept either a session cookie (__Host-aius_session) or a
bearer aius_… token, unless noted. Your identity is derived from the
credential — you cannot act on another user’s resources.
Clients (organizations)
A client is an organization that owns projects, billing, and tokens. A default client is created automatically when you register.List clients
200:
Create a client
200:
owner_id.
Projects
A project belongs to a client. List/create operations are scoped by the client id.List projects
org_id query parameter (the client id) is required.
200:
Create a project
| Field | Type | Required |
|---|---|---|
org_id | string | Yes — the owning client id |
name | string | Yes |
description | string | No |
200: the created project (same shape as the list item above).
Get a project
Delete a project
200: { "deleted": true }
Accessing a project in a client you don’t belong to returns 403 NO_ACCESS; an
unknown id returns 404 NOT_FOUND.
Fork a project
Create a point-in-time copy of a project as a brand-new project. The fork duplicates the brief, artifacts, and reports, records its lineage (forked_from_id), and gets an auto-uniqued name — <name> (fork), then
<name> (fork 2), <name> (fork 3), … <name> (fork N) if that name is already
taken. The original project is untouched.
{ "name": "...", "target_org_id": "client_abc" } to
override the fork’s name or land it in another of your clients (ADR-0059) —
omit the body for the classic same-client fork.
Response 200: the new project, e.g.
{ "id": "proj_456", "name": "Churn analysis (fork)", "forked_from_id": "proj_123", ... }
Transfer a project
Move a project from one of your clients to another you also own (ADR-0059) — the destructive counterpart to fork (re-points the project’sorg_id instead of
copying). Both clients must be yours; billing follows the destination client.
200: the moved project (now with the destination org_id).
Tokens
API tokens are theaius_… credentials you use as bearer tokens. Minting
requires a session (cookie), not a bearer token. Listing and revoking also
require a session.
Mint a token
200:
A token’s
client_id is the organization id (an org_… value) it bills
against — never an email. If you pass client_id when minting, send an org id
you own; omit it to default to your account’s org.List tokens
200: { "data": [ ... ] }. The secret token value is never
returned again after minting — only metadata is listed.
Revoke a token
200: { "id": 42, "revoked_at": 1717124500 }. A revoked token is
rejected on all subsequent requests with 401 invalid token. Missing id →
400; unknown id → 404.
Billing (overview)
Billing is in AIUS tokens. The token balance is held at the account-owner level and allocated across the owner’s clients (ADR-0060): read it withGET /v1/owner/balance and move tokens to a client with
PUT /v1/owner/orgs/{org_id}/allocation. Each client also exposes Stripe-backed
endpoints (subscription checkout, token top-ups and balance, invoices, payment
methods, and a billing portal) under /v1/clients/{client_id}/…, typically
driven from the web dashboard. See Billing for details.