Account API
Read your prices, Token Based multipliers, balance and ledger, and create USDT top-up invoices from your own scripts, without opening the website.
Account API keys
The account API uses its own key, separate from the model keys (sk-…) you use for /v1/*. Create one under Settings → Account API in your dashboard. It starts with nea_ and is shown only once; you can hold up to 5 active keys and revoke them there at any time.
- An account key cannot call models, and a model key cannot call the account API.
- Treat an account key like a password: it can read your balance and create top-up invoices for your account.
- Revoked keys, and keys of a disabled or deleted account, stop working immediately.
Send the key on every request as Authorization: Bearer nea_… to https://api.octalabs.id/api/account/v1. The API is for servers and scripts: it sends no CORS headers, so do not call it from a web page.
Responses
- Success:
{"data": …}. Failure:{"error": {"code": "…", "message": "…"}}; branch oncode, the message is for people. - Money is an integer string in nano-dollars, fields ending in
_usd_nanos(1 USD = 1,000,000,000). Prices are per 1M tokens, per image or per second, as their names say. A price of"0"is free. - On-chain USDT amounts are decimal strings, fields ending in
_usdt.
Model prices
GET /pricing returns every model you can call with the prices you pay, the same as the Models page. A list_… field is the original rate of a discounted dimension (null when it is not discounted).
GET /api/account/v1/pricing
curl https://api.octalabs.id/api/account/v1/pricing \ -H "Authorization: Bearer $ACCOUNT_API_KEY"200
{ "data": { "models": [ { "id": "MODEL_ID", "capabilities": ["streaming", "text_generation"], "formats": ["anthropic", "openai"], "price": { "input_usd_nanos_per_million": "3000000000", "output_usd_nanos_per_million": "15000000000", "list_input_usd_nanos_per_million": "4000000000", "list_output_usd_nanos_per_million": null, "…": "…" }, "context_tokens": 200000, "max_output_tokens": 64000 } ] }}Deposit networks
GET /deposit/networks says whether top-ups are open, which USDT networks can take one and the amount rules. When enabled is false, a reason explains why.
GET /api/account/v1/deposit/networks
curl https://api.octalabs.id/api/account/v1/deposit/networks \ -H "Authorization: Bearer $ACCOUNT_API_KEY"200
{ "data": { "enabled": true, "min_amount_usdt": "1.00", "amount_decimals": 2, "networks": [ { "network": "tron", "chain": "TRX", "contract": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" } ] }}Create a top-up invoice
POST /deposits with a JSON body of exactly network and amount (a USDT amount of at least min_amount_usdt, at most 2 decimals). The invoice is always credited to the key's own account. Send exactly amount_usdt (it carries a small unique suffix) to address on that network before expires_at.
POST /api/account/v1/deposits
curl -X POST https://api.octalabs.id/api/account/v1/deposits \ -H "Authorization: Bearer $ACCOUNT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"network": "tron", "amount": "25"}'201
HTTP/1.1 201 Created{ "data": { "id": "0b6f8c1e-1111-4222-8333-444455556666", "state": "open", "network": "tron", "chain": "TRX", "asset": "USDT", "address": "T…", "tag": null, "amount_usdt": "25.004217", "issued_at": "2026-11-07T08:00:00.000Z", "expires_at": "2026-11-07T08:30:00.000Z" }} An invalid amount or network answers 400. Too many open or recent invoices answers 429 with code invoice_limit_reached: pay or let an open invoice expire first.
Invoice status
GET /deposits/{id} returns one of your invoices in the same shape. state is open, expired, approved (credited), manual_review or review_hold (checked by an operator). Another account's invoice id answers 404.
GET /api/account/v1/deposits/{id}
curl https://api.octalabs.id/api/account/v1/deposits/$INVOICE_ID \ -H "Authorization: Bearer $ACCOUNT_API_KEY"Balance
GET /balance: your balance, the part held by requests still running, what new requests can use, and bonus credit (null if it could not be read).
GET /api/account/v1/balance
curl https://api.octalabs.id/api/account/v1/balance \ -H "Authorization: Bearer $ACCOUNT_API_KEY"200
{ "data": { "balance_usd_nanos": "12500000000", "reserved_usd_nanos": "4821000", "available_usd_nanos": "12495179000", "bonus_available_usd_nanos": "0", "updated_at": "2026-11-07T08:00:00Z" }}Ledger
GET /ledger?limit=25&offset=0: balance movements, newest first. limit is 1 to 500 (default 25); a page shorter than limit is the last one.
GET /api/account/v1/ledger
curl "https://api.octalabs.id/api/account/v1/ledger?limit=25&offset=0" \ -H "Authorization: Bearer $ACCOUNT_API_KEY"200
{ "data": { "entries": [ { "id": "…", "kind": "usage_debit", "amount_usd_nanos": "-4821000", "balance_after_usd_nanos": "12495179000", "reason": "settled usage", "created_at": "2026-11-07T08:00:00Z" } ], "limit": 25, "offset": 0 }}Errors and limits
| Status | code | Meaning |
|---|---|---|
| 400 | invalid_request | Invalid body, amount, network or invoice id. |
| 401 | unauthorized | The key is missing, wrong, revoked, or its account is disabled. |
| 404 | not_found | No such invoice for your account, or no such endpoint. |
| 405 | method_not_allowed | Wrong HTTP method; see the Allow header. |
| 429 | rate_limited / invoice_limit_reached | Too many requests (wait Retry-After seconds), or too many invoices. |
| 503 | unavailable | A service behind the API is busy or down; retry later. |
401
HTTP/1.1 401 Unauthorized{ "error": { "code": "unauthorized", "message": "Missing, invalid or revoked account API key." }}Each key may make 60 requests a minute and each network address 120. Repeated requests with a wrong key from one address are blocked for a while.