Eleven routes, one source file
HTTP API reference
Every route on this page is served by arca server start. The addresses,
request bodies and response shapes below are the integration contract. Anything not
listed here is not part of the public surface.
Response conventions
- Every response body is JSON with
Content-Type: application/json. - A handler-level failure still returns HTTP 200. The failure is reported as an
errorstring field in the body, so check the field, not the status code. - A body that is not valid JSON, or that is missing a required field, is rejected by
axum's
Jsonextractor before the handler runs, with a 4xx status and a plain-text reason. - No route reads a query string. Path parameters are single segments.
Route index
| Method | Path | Returns |
|---|---|---|
| GET | /api/v1/wallets | wallet names and addresses |
| GET | /api/v1/wallet/{name} | one wallet, with an existence flag |
| GET | /api/v1/balance/{address} | USDC balance on Base |
| GET | /api/v1/transaction/{tx_hash} | USDC transfer verification |
| GET | /api/v1/contracts | all payment contracts |
| GET | /api/v1/contract/{id} | one payment contract |
| POST | /api/v1/contract | creates a payment contract |
| GET | /.well-known/x402 | x402 discovery document |
| GET | /api/v1/x402/invoice/{feature} | price for one feature |
| POST | /api/v1/x402/verify | payment verification verdict |
Service
Wallets
GET /api/v1/wallets
Every wallet name in the vault, with its derived address at index 0.
[
{
"name": "treasury",
"address": "0x1111111111111111111111111111111111111111"
}
]
address is an empty string when the stored record cannot be resolved into
a mnemonic. An empty vault returns [].
GET /api/v1/wallet/{name}
No request body. The route has two response shapes, and both are HTTP 200.
{
"name": "treasury",
"address": "0x1111111111111111111111111111111111111111",
"exists": true
}
{
"name": "treasury",
"exists": false
}
The route opens the vault with an empty passphrase. A wallet stored with a non-empty
passphrase reports "exists": false here even though the file is present.
Chain reads
GET /api/v1/balance/{address}
Reads the USDC balance for an address against the configured Base RPC endpoint.
{
"address": "0x1111111111111111111111111111111111111111",
"usdc": "12.400000",
"eth": "0.000000",
"network": "base"
}
usdcis a string with six decimals. If the RPC call fails, the value is"0.000000"and the response is still 200.ethis always"0.000000"andnetworkis always"base". This route does not query an ETH balance.
GET /api/v1/transaction/{tx_hash}
Verifies a USDC transfer by hash. Success shape:
{
"tx_hash": "0x9f2c...",
"from": "0x1111111111111111111111111111111111111111",
"to": "0x…",
"amount": "12.400000",
"confirmed": true,
"block_number": 21840311
}
Failure shape:
{
"error": "<message from the chain client>"
}
amount is a string. block_number is a number. The two shapes are
distinguished by the presence of error, not by the status code.
Payment contracts
GET /api/v1/contracts
Every contract on disk, as an array of the object below. If the directory cannot be
read, the response is [] rather than an error.
[
{
"contract_id": "6b0f1f2a9c3d4e5f8091a2b3c4d5e6f708",
"title": "Q1 retainer",
"description": "",
"payer": "0x28C6...",
"payee": "0x9a1B...",
"amount_usdc": 250.0,
"network": "base",
"currency": "USDC",
"terms": [],
"created_at": "2026-11-28T09:14:02.311+00:00",
"expires_at": null,
"status": "Draft",
"signature": null
}
]
status is one of "Draft", "Pending",
"Active", "Completed", "Cancelled" or
"Disputed". expires_at and signature are a string
or null.
GET /api/v1/contract/{id}
One contract, in exactly the shape shown above.
{
"error": "<message from the contract store>"
}
POST /api/v1/contract
Request body. All four fields are required.
{
"title": "Q1 retainer",
"payer": "0x28C6...",
"payee": "0x9a1B...",
"amount": 250.0
}
Success. The new contract is written to disk with status Draft.
{
"status": "created",
"contract_id": "6b0f1f2a9c3d4e5f8091a2b3c4d5e6f708",
"title": "Q1 retainer",
"amount_usdc": 250.0
}
Failure.
{
"error": "<message from the contract store>"
}
Only title, payer, payee and amount
are read from the body. description and terms start empty,
network is "base", currency is
"USDC", and signature is null. Signing happens
through the CLI, not through this route.
x402
GET /.well-known/x402
The discovery document. It lists the two x402 routes and nothing else.
{
"version": "x402-1.0",
"currency": "USDC",
"network": "base",
"receiver": "0x…",
"endpoints": [
"/api/v1/x402/invoice/{feature}",
"/api/v1/x402/verify"
]
}
receiver is the wallet the handler was constructed with. The shipped
start_server constructs it with the zero address, so this field is
0x… until the binary is changed.
GET /api/v1/x402/invoice/{feature}
Priced from a fixed list, keyed by feature name.
{
"feature": "web-search",
"amount_usdc": 0.005,
"receiver": "0x…",
"network": "base",
"currency": "USDC",
"expires_at": "<timestamp>"
}
An unknown feature name returns:
{
"error": "unknown feature"
}
expires_at is supplied by the deployment.
| Feature | amount_usdc |
|---|---|
pqc-encrypt | 0.001 |
web-search | 0.005 |
ai-analysis | 0.01 |
crypto-data | 0.005 |
sec-filings | 0.01 |
news-sentiment | 0.005 |
company-intel | 0.01 |
POST /api/v1/x402/verify
Request body. Both fields are required.
{
"tx_hash": "0x9f2c...",
"feature": "web-search"
}
Three possible bodies, all HTTP 200:
{
"valid": true,
"message": "Payment verified successfully"
}
{
"valid": false,
"message": "Payment not confirmed"
}
{
"valid": false,
"message": "Verification error: Unknown feature: teleport"
}
The check compares the transfer amount against the price of the named feature and requires the transfer to be confirmed. An unknown feature, or a failing chain call, lands in the third shape.
Nothing here is authenticated and nothing is rate limited. The server is loopback-only for that reason. See Operations for the exposure rule and Architecture for the module layout.