API Overview
The AIUS API is the server-side brain behind the AIUS agent. It exposes an OpenAI-wire-compatible LLM proxy, a backend-driven agent run loop over WebSocket, and account/billing endpoints for users, clients (organizations), projects, and API tokens. This reference documents the public HTTP/WebSocket contract so you can build your own client — a CLI, a backend integration, or a custom tool-executor — without using the official AIUS CLI. Everything here is the externally observable behavior of the service.Base URLs
Against the dev gateway, send
Accept-Encoding: identity on HTTP requests.
The dev edge can return compressed bodies that some HTTP clients mishandle;
asking for an identity (uncompressed) encoding avoids decoding surprises.Authentication model
AIUS uses two credential types, for two different layers:| Credential | Looks like | Used for | How you get it |
|---|---|---|---|
| Session token | an HS256 JWT (eyJ…) | Minting API tokens; account/billing reads | Returned by POST /v1/login / POST /v1/register (and POST /v1/2fa/login) as session_token |
| API token (PAT) | aius_… | All day-to-day API calls (chat proxy, run loop) | Minted once via POST /v1/tokens using a session |
Authenticate
Register or log in with email + password to obtain a
session_token
(completing a 2FA challenge if the account requires it).Mint a durable API token
Exchange the session for a long-lived
aius_… token via POST /v1/tokens.
Store it securely — it is shown only once.AIUS_API_KEY (a pre-issued aius_… token) works
identically to a minted token — it is just a bearer credential.
Endpoint map
Authentication
/v1/register, /v1/login, /v1/2fa/*, /v1/tokensChat proxy
POST /v1/chat/completions, GET /v1/modelsRun-loop WebSocket
wss://…/v1/runs/ws — backend-driven agent loopClients & projects
/v1/clients, /v1/projects, /v1/tokensBuild a minimal client
End-to-end Python + TypeScript walkthrough
Errors
The
detail error shape and common codesModels
The chat proxy and run loop accept Anthropic Claude model slugs in OpenRouter form, e.g.:GET /v1/models (with a bearer token) for the live list the gateway will
accept.
Rate limits
The gateway applies per-IP rate limits to sensitive endpoints:| Endpoint | Limit |
|---|---|
POST /v1/chat/completions | 60 / minute |
POST /v1/tokens | 10 / minute |
POST /v1/login | 10 / minute |
POST /v1/register | 5 / minute |
429 Too Many Requests. Back off and retry.