HTTP API reference
The current routes, authentication requirements, response shapes, and intentionally disabled capabilities.
In this chapter
Conventions#
The canonical origin is https://idleai.xyz. Browser account APIs use HttpOnly wallet-session cookies and same-origin mutation checks. The developer completion route uses a bearer API key instead. Treat error bodies as route-specific: browser routes commonly return an error string, while the OpenAI-shaped route uses an error object.
Examples use placeholders and are not credentials. Do not extract or publish HttpOnly session cookies to follow an example. Use the actual browser sign-in flow, and keep developer keys in an authorized secret store.
Route index#
| Method and path | Authorization | Current behavior |
|---|---|---|
| GET /api/auth | Optional wallet session | Returns the authenticated address or null. |
| POST /api/auth | Same-origin challenge flow | Creates a challenge or verifies a signature. |
| DELETE /api/auth | Same-origin wallet session | Revokes that session and clears cookies. |
| GET /api/state | Optional wallet session | Returns owner-scoped account metadata; no fabricated market data. |
| POST /api/keys | Wallet session | Creates a real API key; full secret is returned once. |
| DELETE /api/keys | Wallet session | Revokes a key belonging to that owner. |
| GET /api/suppliers | Wallet session | Returns the owner's application or null. |
| POST /api/suppliers | Wallet session | Stores one pending application per wallet. |
| GET /api/v1/models | Public | Returns the live catalog of published models with active offers. |
| POST /api/v1/chat/completions | Bearer API key | Executes a billed request through the pipeline; 401 invalid key, 402 unfunded, 409 replayed request_id. |
| POST /api/chat | Wallet session | Same pipeline for the workspace composer; requires a funded balance. |
| POST /api/deposits | Wallet session | Claims a USDG transfer to the treasury by tx hash; on-chain verification before crediting. |
| GET /api/receipts | Wallet session | Lists the account's usage receipts. |
| GET/POST/DELETE /api/chats | Wallet session | Lists, saves, and deletes saved conversations. GET /api/chats?export=1 downloads every chat as JSON. |
| GET/POST/DELETE /api/profile | Wallet session | Profile fields (display name, referral code) and sign-out-everywhere. |
| GET /api/activity | Wallet session | Append-only feed: top-ups, usage charges, referral credits, payouts. |
| GET /api/payouts · POST /api/payouts | Wallet session | Lists and requests supplier payouts; escrowed pending operator settlement. |
| POST /api/account | Wallet session | Funding/reset operations are unavailable; no faucet. |
| POST or DELETE /api/orders | Wallet session | Trading is unavailable; no synthetic fill. |
| GET /api/config | Public | Reports capability flags; peer matching remains unavailable. |
| POST /api/config | Same-origin | Cannot enable peer matching; returns unavailable. |
| GET or POST /api/early | Public registration/stats | Waitlist operations; administrative exports have a separate gate. |
Authentication payloads#
{
"action": "challenge",
"address": "<YOUR_EVM_WALLET_ADDRESS>"
}{
"action": "verify",
"signature": "<SIGNATURE_OF_THE_SERVER_MESSAGE>"
}{
"address": null
}API key payloads#
{
"label": "production-backend"
}{
"ok": true,
"key": {
"id": "<KEY_ID>",
"label": "production-backend",
"key": "<SECRET_SHOWN_ONCE>",
"created": 0
}
}{
"id": "<KEY_ID>"
}Supplier application payload#
{
"name": "<SUPPLIER_NAME>",
"endpoint": "https://<YOUR_AUTHORIZED_ENDPOINT>/v1",
"model": "<EXACT_MODEL_ID>",
"email": "<OPERATIONS_CONTACT>",
"retention": "<ACCURATE_DATA_HANDLING_DESCRIPTION>",
"rights": true
}Successful creation returns 201 with an application ID and pending review status. An existing application returns 409 rather than being overwritten. The server requires nonempty string fields within the current bounds, an appropriate HTTPS URL, a contact email, and explicit rights confirmation.
Errors and retries#
| Status | Typical meaning | Action |
|---|---|---|
| 400 | Invalid wallet, key label, or application payload. | Correct the request; do not retry unchanged. |
| 401 | No valid session/key, or rejected/expired sign-in challenge. | Sign in again or use an active credential. |
| 403 | Origin or cross-site request rejected. | Use the canonical site; do not disable the check. |
| 404 | Unknown owner-scoped resource or unregistered waitlist address. | Check the resource and account context. |
| 409 | A supplier application already exists. | Read the existing status instead of duplicating it. |
| 413 | Request exceeds a transport/body limit. | Reduce the payload. |
| 429 | A configured request/capacity limit was reached. | Back off; no universal public quota or SLA is promised here. |
| 503 | Storage/verification unavailable or a capability intentionally disabled. | Distinguish an outage from a feature that is not live; do not loop retries. |
A waitlist storage failure returns a retry hint and does not claim successful persistence. For future paid inference, timeout/retry handling must use reconciled request identities; an HTTP error alone is not enough to decide whether work happened or money moved.
