Accounts
One credit account per token, its ledger, and credit bought in USDC.
Every token has one credit account, in dollars. The AI's share of each payout lands in it, and its router keys spend it. You can also buy credit for it in USDC. Credit never expires. See AI credit.
List accounts
Each token has its own account: its AI share from every payout lands there, and its router keys spend it.
Send the project's secret key as Authorization: Bearer rf_sk_..., from a server.
curl https://relayfor.si/api/project/v1/accounts \ -H "Authorization: Bearer $RELAYFOR_SECRET_KEY"Query
limitinteger1 to 100; default 20.
cursorstringnext_cursor from the page before.
Answer
Answers 200 with AccountList.
{ "data": [ { "id": "acc_arqp1qhbpvjhzifE", "token": { "mint": "MASi45ub7Qe4ZE36UT5G6cU4ud8Fhhe4deS4F3cw9KTA", "symbol": "NOVA", "name": "Nova" }, "spendable_usd": "41.208734", "balance_usd": "41.228734", "reserved_usd": "0.02", "credited_usd": "108.4105", "spent_usd": "67.181766", "running_calls": 1, "created_at": "2026-10-07T09:12:31.000Z" } ], "next_cursor": null}Its fields
dataobject[]RequiredThe items, newest first.
idstringRequiredThe account's id: acc_ and 16 characters.
tokenobject | nullRequiredThe token whose AI share lands here.
mintstringRequiredThe token's mint address.
namestringRequiredThe token's name.
symbolstringRequiredThe token's ticker.
spendable_usdstringRequiredWhat new calls can reserve now: the balance less what is reserved.
balance_usdstringRequiredCredit left, what running calls reserved included.
reserved_usdstringRequiredHeld by calls still running or waiting on their cost.
credited_usdstringRequiredEvery credit the account ever received.
spent_usdstringRequiredEverything its calls were charged.
running_callsintegerRequiredCalls running on it now: it allows 8 at once.
created_atstringRequiredWhen it was made, in UTC.
next_cursorstring | nullRequiredPass it as cursor for the next page; null on the last page.
Errors
A 429 or 503 answer carries Retry-After: wait that many seconds, then send the same request again.
Get an account
Send the project's secret key as Authorization: Bearer rf_sk_..., from a server.
curl https://relayfor.si/api/project/v1/accounts/acc_arqp1qhbpvjhzifE \ -H "Authorization: Bearer $RELAYFOR_SECRET_KEY"Path
idstringRequiredThe account's id (acc_...) or its token's mint.
Answer
Answers 200 with Account.
{ "id": "acc_arqp1qhbpvjhzifE", "token": { "mint": "MASi45ub7Qe4ZE36UT5G6cU4ud8Fhhe4deS4F3cw9KTA", "symbol": "NOVA", "name": "Nova" }, "spendable_usd": "41.208734", "balance_usd": "41.228734", "reserved_usd": "0.02", "credited_usd": "108.4105", "spent_usd": "67.181766", "running_calls": 1, "created_at": "2026-10-07T09:12:31.000Z"}Its fields
idstringRequiredThe account's id: acc_ and 16 characters.
tokenobject | nullRequiredThe token whose AI share lands here.
mintstringRequiredThe token's mint address.
namestringRequiredThe token's name.
symbolstringRequiredThe token's ticker.
spendable_usdstringRequiredWhat new calls can reserve now: the balance less what is reserved.
balance_usdstringRequiredCredit left, what running calls reserved included.
reserved_usdstringRequiredHeld by calls still running or waiting on their cost.
credited_usdstringRequiredEvery credit the account ever received.
spent_usdstringRequiredEverything its calls were charged.
running_callsintegerRequiredCalls running on it now: it allows 8 at once.
created_atstringRequiredWhen it was made, in UTC.
Errors
A 429 or 503 answer carries Retry-After: wait that many seconds, then send the same request again.
Read the ledger
Send the project's secret key as Authorization: Bearer rf_sk_..., from a server.
curl https://relayfor.si/api/project/v1/accounts/acc_arqp1qhbpvjhzifE/ledger \ -H "Authorization: Bearer $RELAYFOR_SECRET_KEY"Path
idstringRequiredThe account's id (acc_...) or its token's mint.
Query
limitinteger1 to 100; default 20.
cursorstringnext_cursor from the page before.
Answer
Answers 200 with LedgerList.
{ "data": [ { "kind": "call_charge", "amount_usd": "-0.000338", "ref": "call:918273", "note": null, "created_at": "2026-10-07T14:02:58.000Z" }, { "kind": "fee_credit", "amount_usd": "7.6104", "ref": "payout:dYmM6J4tmCUz5J2h6tH6fwF5Hx8W1NcTJg93anG8BH4CDLhLaqEKVZkCJPt2H312oZcDZXGV7juiUjYbvySZLmEF:0", "note": null, "created_at": "2026-10-07T13:40:01.000Z" } ], "next_cursor": "eyJ0IjoiMjAyNi0xMC0wN1QxMzo0MDowMVoifQ"}Its fields
dataobject[]RequiredThe items, newest first.
kind"call_charge" | "fee_credit" | "purchase" | "adjustment"Requiredfee_credit: a payout's AI share; purchase: credit bought; call_charge: a settled call; adjustment: by hand.
amount_usdstringRequiredPositive for a credit, negative for a charge.
refstringRequiredWhat made it, once: call:<id>, payout:<signature>:<event>, purchase:<signature>.
notestring | nullRequiredWhy it was made, for an adjustment by hand.
created_atstringRequiredWhen it was made, in UTC.
next_cursorstring | nullRequiredPass it as cursor for the next page; null on the last page.
Errors
A 429 or 503 answer carries Retry-After: wait that many seconds, then send the same request again.
Buy credit
Answers with a transaction for the payer's wallet: a USDC transfer to relayfor's AI treasury carrying a one-time reference key, checked by simulation. Once the transfer is final the account is credited $1 a USDC for what arrived; poll the purchase, or watch its signature. The same payment as a Solana Pay link, for wallets and QR codes.
Send the project's secret key as Authorization: Bearer rf_sk_..., from a server.
Send an Idempotency-Key (any unique string, a UUID): a retry with the same key and body gets the first answer back for 24 hours, a secret it carried included.
curl -X POST https://relayfor.si/api/project/v1/accounts/acc_arqp1qhbpvjhzifE/purchases \ -H "Authorization: Bearer $RELAYFOR_SECRET_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "amount_usd": "50", "payer": "yc4GDJ3r7ZVc2qz5VMgZfZDmJVZbtXZGmayyHczDvV9T" }'Path
idstringRequiredThe account's id (acc_...) or its token's mint.
Body
amount_usdstring | numberRequiredDollars of credit, $20 to $1,000,000, like "20" or "49.50": as many USDC.
payerstringRequiredThe wallet that pays: it signs the transaction.
Answer
Answers 201 with Purchase.
{ "id": "pur_YhFVG0Tp4lxWvY5g", "account": "acc_arqp1qhbpvjhzifE", "status": "pending", "amount_usd": "50", "credited_usd": null, "payer": "yc4GDJ3r7ZVc2qz5VMgZfZDmJVZbtXZGmayyHczDvV9T", "reference": "PzWjeuzaTuyZ9bAaZ2xVrCf1rtACAXgo8c4MkaacXsr7", "recipient": "Xgzgv1XiPti6vj8RsnqDXyCUshN6toSWSp6oBB92AezW", "token_account": "tiAgufXjPAcc921toi7ap9UxDuxE2HEKZGqeMHbTv94p", "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "solana_pay_url": "solana:Xgzgv1XiPti6vj8RsnqDXyCUshN6toSWSp6oBB92AezW?amount=50&spl-token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&reference=PzWjeuzaTuyZ9bAaZ2xVrCf1rtACAXgo8c4MkaacXsr7&label=relayfor&message=Credit+for+acc_arqp1qhbpvjhzifE", "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...", "signature": null, "created_at": "2026-10-07T10:05:44.000Z", "credited_at": null}Its fields
idstringRequiredThe purchase's id: pur_ and 16 characters.
accountstringRequiredThe account it credits: acc_...
status"pending" | "credited"Requiredpending: waits for the transfer; credited: it arrived and was credited.
amount_usdstringRequiredAsked for, in dollars: as many USDC.
credited_usdstring | nullRequiredWhat arrived and was credited, once final.
payerstring | nullRequiredThe wallet the transaction was made for; null for a dashboard payment request.
referencestringRequiredThe one-time key the transfer names: how the payment is found.
recipientstring | nullRequiredrelayfor's AI treasury, the wallet paid.
token_accountstring | nullRequiredIts USDC account, which receives.
mintstringRequiredUSDC's mint.
solana_pay_urlstring | nullRequiredA Solana Pay transfer request for the same payment, for a wallet or a QR code.
transactionstring | nullRequiredIn the answer that made the purchase only: the transaction (v0, base64) for the payer's wallet to sign and send. It expires with its blockhash in about a minute; make another purchase if it does.
signaturestring | nullRequiredThe payment's transaction, once credited.
created_atstringRequiredWhen it was made, in UTC.
credited_atstring | nullRequiredWhen it was credited; null while it waits for payment.
Errors
- 400invalid_request
- 400missing_idempotency_key
- 401unauthorized
- 404not_found
- 409idempotency_in_progress
- 413payload_too_large
- 415unsupported_media_type
- 422idempotency_mismatch
- 422insufficient_funds
- 429rate_limited
- 500internal
- 503unavailable
- 503purchases_closed
A 409, 429, or 503 answer carries Retry-After: wait that many seconds, then send the same request again.
List purchases
Send the project's secret key as Authorization: Bearer rf_sk_..., from a server.
curl https://relayfor.si/api/project/v1/accounts/acc_arqp1qhbpvjhzifE/purchases \ -H "Authorization: Bearer $RELAYFOR_SECRET_KEY"Path
idstringRequiredThe account's id (acc_...) or its token's mint.
Query
limitinteger1 to 100; default 20.
cursorstringnext_cursor from the page before.
Answer
Answers 200 with PurchaseList.
{ "data": [ { "id": "pur_YhFVG0Tp4lxWvY5g", "account": "acc_arqp1qhbpvjhzifE", "status": "credited", "amount_usd": "50", "credited_usd": "50", "payer": "yc4GDJ3r7ZVc2qz5VMgZfZDmJVZbtXZGmayyHczDvV9T", "reference": "PzWjeuzaTuyZ9bAaZ2xVrCf1rtACAXgo8c4MkaacXsr7", "recipient": "Xgzgv1XiPti6vj8RsnqDXyCUshN6toSWSp6oBB92AezW", "token_account": "tiAgufXjPAcc921toi7ap9UxDuxE2HEKZGqeMHbTv94p", "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "solana_pay_url": "solana:Xgzgv1XiPti6vj8RsnqDXyCUshN6toSWSp6oBB92AezW?amount=50&spl-token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&reference=PzWjeuzaTuyZ9bAaZ2xVrCf1rtACAXgo8c4MkaacXsr7&label=relayfor&message=Credit+for+acc_arqp1qhbpvjhzifE", "transaction": null, "signature": "NDvynoh9SP4v915hpyHUB46jvRxZjKfGmK3WCBJV1HQNcMG3yLEPC1NR6XJZiDGZr16Hu6ASe3S2LLhF6eawqAjz", "created_at": "2026-10-07T10:05:44.000Z", "credited_at": "2026-10-07T10:06:10.000Z" } ], "next_cursor": null}Its fields
dataobject[]RequiredThe items, newest first.
idstringRequiredThe purchase's id: pur_ and 16 characters.
accountstringRequiredThe account it credits: acc_...
status"pending" | "credited"Requiredpending: waits for the transfer; credited: it arrived and was credited.
amount_usdstringRequiredAsked for, in dollars: as many USDC.
credited_usdstring | nullRequiredWhat arrived and was credited, once final.
payerstring | nullRequiredThe wallet the transaction was made for; null for a dashboard payment request.
referencestringRequiredThe one-time key the transfer names: how the payment is found.
recipientstring | nullRequiredrelayfor's AI treasury, the wallet paid.
token_accountstring | nullRequiredIts USDC account, which receives.
mintstringRequiredUSDC's mint.
solana_pay_urlstring | nullRequiredA Solana Pay transfer request for the same payment, for a wallet or a QR code.
transactionstring | nullRequiredIn the answer that made the purchase only: the transaction (v0, base64) for the payer's wallet to sign and send. It expires with its blockhash in about a minute; make another purchase if it does.
signaturestring | nullRequiredThe payment's transaction, once credited.
created_atstringRequiredWhen it was made, in UTC.
credited_atstring | nullRequiredWhen it was credited; null while it waits for payment.
next_cursorstring | nullRequiredPass it as cursor for the next page; null on the last page.
Errors
A 429 or 503 answer carries Retry-After: wait that many seconds, then send the same request again.
Get a purchase
Send the project's secret key as Authorization: Bearer rf_sk_..., from a server.
curl https://relayfor.si/api/project/v1/accounts/acc_arqp1qhbpvjhzifE/purchases/pur_YhFVG0Tp4lxWvY5g \ -H "Authorization: Bearer $RELAYFOR_SECRET_KEY"Path
idstringRequiredThe account's id (acc_...) or its token's mint.
purchasestringRequiredThe purchase's id: pur_...
Answer
Answers 200 with Purchase.
{ "id": "pur_YhFVG0Tp4lxWvY5g", "account": "acc_arqp1qhbpvjhzifE", "status": "credited", "amount_usd": "50", "credited_usd": "50", "payer": "yc4GDJ3r7ZVc2qz5VMgZfZDmJVZbtXZGmayyHczDvV9T", "reference": "PzWjeuzaTuyZ9bAaZ2xVrCf1rtACAXgo8c4MkaacXsr7", "recipient": "Xgzgv1XiPti6vj8RsnqDXyCUshN6toSWSp6oBB92AezW", "token_account": "tiAgufXjPAcc921toi7ap9UxDuxE2HEKZGqeMHbTv94p", "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "solana_pay_url": "solana:Xgzgv1XiPti6vj8RsnqDXyCUshN6toSWSp6oBB92AezW?amount=50&spl-token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&reference=PzWjeuzaTuyZ9bAaZ2xVrCf1rtACAXgo8c4MkaacXsr7&label=relayfor&message=Credit+for+acc_arqp1qhbpvjhzifE", "transaction": null, "signature": "NDvynoh9SP4v915hpyHUB46jvRxZjKfGmK3WCBJV1HQNcMG3yLEPC1NR6XJZiDGZr16Hu6ASe3S2LLhF6eawqAjz", "created_at": "2026-10-07T10:05:44.000Z", "credited_at": "2026-10-07T10:06:10.000Z"}Its fields
idstringRequiredThe purchase's id: pur_ and 16 characters.
accountstringRequiredThe account it credits: acc_...
status"pending" | "credited"Requiredpending: waits for the transfer; credited: it arrived and was credited.
amount_usdstringRequiredAsked for, in dollars: as many USDC.
credited_usdstring | nullRequiredWhat arrived and was credited, once final.
payerstring | nullRequiredThe wallet the transaction was made for; null for a dashboard payment request.
referencestringRequiredThe one-time key the transfer names: how the payment is found.
recipientstring | nullRequiredrelayfor's AI treasury, the wallet paid.
token_accountstring | nullRequiredIts USDC account, which receives.
mintstringRequiredUSDC's mint.
solana_pay_urlstring | nullRequiredA Solana Pay transfer request for the same payment, for a wallet or a QR code.
transactionstring | nullRequiredIn the answer that made the purchase only: the transaction (v0, base64) for the payer's wallet to sign and send. It expires with its blockhash in about a minute; make another purchase if it does.
signaturestring | nullRequiredThe payment's transaction, once credited.
created_atstringRequiredWhen it was made, in UTC.
credited_atstring | nullRequiredWhen it was credited; null while it waits for payment.
Errors
A 429 or 503 answer carries Retry-After: wait that many seconds, then send the same request again.