Build on Axio

Run a trading bot on the shilling order book, or let customers pay your shop from their Axio balance. One signed API, keys you control.

What you can do

Trade

Place and cancel limit and market orders, read balances, orders and fills.

Pay with Axio

Create an invoice, send your customer the link, get a signed webhook when it is paid. Fee 0.5%, paid by the shop.

Safe by design

Keys can never withdraw or send money. Trading keys only work from IP addresses you list. Secrets are encrypted at rest.

Sign every request

Send three headers. The signature is HMAC-SHA256 with your secret over the timestamp, method, path with query, and the raw body. Requests older than 15 seconds, or repeated, are refused.

X-AXIO-KEY:  ak_...            your key ID
X-AXIO-TS:   1767225600000     time in milliseconds
X-AXIO-SIGN: hex(HMAC_SHA256(secret, TS + METHOD + PATH + BODY))
// Node.js 18+
import { createHmac } from "node:crypto";
const KEY = process.env.AXIO_KEY, SECRET = process.env.AXIO_SECRET;

async function axio(method, path, body) {
  const raw = body ? JSON.stringify(body) : "";
  const ts = String(Date.now());
  const sign = createHmac("sha256", SECRET).update(ts + method + path + raw).digest("hex");
  const r = await fetch("https://YOUR-AXIO-DOMAIN" + path, { method, body: raw || undefined,
    headers: { "content-type": "application/json", "x-axio-key": KEY, "x-axio-ts": ts, "x-axio-sign": sign } });
  if (!r.ok) throw new Error((await r.json()).error);
  return r.json();
}

await axio("POST", "/api/orders", { market: "BTC-KES", side: "buy", type: "limit", price: "9500000", amount: "0.001" });

Endpoints

CallPermissionWhat it does
GET /api/markets, /api/tickers, /api/depth/BTC-KES, /api/trades/BTC-KES, /api/candles/BTC-KES?interval=1hPublicMarkets, prices, order book, recent trades, candles
GET /api/balancesreadAvailable and held balance for each asset
GET /api/orders?status=open, GET /api/my-trades, GET /api/historyreadYour orders, fills and money movements
POST /api/orderstrade{ market, side: "buy"|"sell", type: "limit"|"market", price?, amount, total? }
DELETE /api/orders/:idtradeCancel an open order
POST /api/quicktradeInstant buy or sell at the best price, 0.5% fee
POST /api/merchant/invoicespay{ asset: "KES"|"USDT", amount, reference?, description?, callbackUrl?, expiresInMinutes? }
GET /api/merchant/invoices/:idpayInvoice status: pending, paid or expired

Amounts are strings in whole units, for example "0.001" BTC or "1500" KES. Errors come back as { "error": "message" } with a 4xx status.

Pay with Axio

  1. Your server creates an invoice and gets back payPath.
  2. Send the customer to https://YOUR-AXIO-DOMAIN + payPath. They log in, check your shop name and amount, and pay from their balance.
  3. Axio posts { "event": "invoice.paid", id, amount, asset, reference, paidAt } to your callbackUrl, signed with the same headers and your key secret. Check the signature, then ship the order.

Callback URLs must be public https:// addresses. A paid invoice can't be paid twice. Money lands in your Axio balance at once, minus 0.5%, and you can cash out to M-PESA.

AI agents

Give an AI assistant or trading bot an agent key (App → Account → AI agents). Axio checks every trading call against the key's limits before it runs. The agent never sees your password and can never withdraw or send money.

LimitWhat happens when it's hit
Markets403 "Agent limit: this key can only trade BTC-KES"
Biggest order, total per 24 hours, open orders403 with the limit in the message. Cancelling is always allowed.
Ask me first above an amount428 with { "status": "needs_approval", "approvalId" }. The owner approves in the app with a passkey. Poll GET /api/agents/approvals/:id (read). When it says approved, send the same request again with header X-AXIO-APPROVAL: <approvalId>. Within 30 minutes, once.
End date, pause, pause-all401 "This key has expired" or 403 "paused". The owner can stop every agent with one tap.

Tell your agent: never put the key secret in a prompt, a chat or a log. Keep it in the agent's secret settings.

API questions

Is there a sandbox?

Ask support for a test account before you go live with real money.

What are the rate limits?

30 orders per 10 seconds per account and 600 invoices per hour. Ask support if you need more.

Can a key withdraw?

No. Withdrawals and transfers only work in the app, confirmed with your passkey or 2FA code. Agent keys can't either.

I think my secret leaked

Delete the key in the app at once. It stops working immediately. Then create a new one.