What is relayfor.si?

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

GET

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.

Request
curl https://relayfor.si/api/project/v1/accounts \  -H "Authorization: Bearer $RELAYFOR_SECRET_KEY"

Query

  • limitinteger

    1 to 100; default 20.

  • cursorstring

    next_cursor from the page before.

Answer

Answers 200 with AccountList.

Example answer
{  "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[]Required

    The items, newest first.

    • idstringRequired

      The account's id: acc_ and 16 characters.

    • tokenobject | nullRequired

      The token whose AI share lands here.

      • mintstringRequired

        The token's mint address.

      • namestringRequired

        The token's name.

      • symbolstringRequired

        The token's ticker.

    • spendable_usdstringRequired

      What new calls can reserve now: the balance less what is reserved.

    • balance_usdstringRequired

      Credit left, what running calls reserved included.

    • reserved_usdstringRequired

      Held by calls still running or waiting on their cost.

    • credited_usdstringRequired

      Every credit the account ever received.

    • spent_usdstringRequired

      Everything its calls were charged.

    • running_callsintegerRequired

      Calls running on it now: it allows 8 at once.

    • created_atstringRequired

      When it was made, in UTC.

  • next_cursorstring | nullRequired

    Pass 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

GET

Send the project's secret key as Authorization: Bearer rf_sk_..., from a server.

Request
curl https://relayfor.si/api/project/v1/accounts/acc_arqp1qhbpvjhzifE \  -H "Authorization: Bearer $RELAYFOR_SECRET_KEY"

Path

  • idstringRequired

    The account's id (acc_...) or its token's mint.

Answer

Answers 200 with Account.

Example answer
{  "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
  • idstringRequired

    The account's id: acc_ and 16 characters.

  • tokenobject | nullRequired

    The token whose AI share lands here.

    • mintstringRequired

      The token's mint address.

    • namestringRequired

      The token's name.

    • symbolstringRequired

      The token's ticker.

  • spendable_usdstringRequired

    What new calls can reserve now: the balance less what is reserved.

  • balance_usdstringRequired

    Credit left, what running calls reserved included.

  • reserved_usdstringRequired

    Held by calls still running or waiting on their cost.

  • credited_usdstringRequired

    Every credit the account ever received.

  • spent_usdstringRequired

    Everything its calls were charged.

  • running_callsintegerRequired

    Calls running on it now: it allows 8 at once.

  • created_atstringRequired

    When 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

GET

Send the project's secret key as Authorization: Bearer rf_sk_..., from a server.

Request
curl https://relayfor.si/api/project/v1/accounts/acc_arqp1qhbpvjhzifE/ledger \  -H "Authorization: Bearer $RELAYFOR_SECRET_KEY"

Path

  • idstringRequired

    The account's id (acc_...) or its token's mint.

Query

  • limitinteger

    1 to 100; default 20.

  • cursorstring

    next_cursor from the page before.

Answer

Answers 200 with LedgerList.

Example answer
{  "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[]Required

    The items, newest first.

    • kind"call_charge" | "fee_credit" | "purchase" | "adjustment"Required

      fee_credit: a payout's AI share; purchase: credit bought; call_charge: a settled call; adjustment: by hand.

    • amount_usdstringRequired

      Positive for a credit, negative for a charge.

    • refstringRequired

      What made it, once: call:<id>, payout:<signature>:<event>, purchase:<signature>.

    • notestring | nullRequired

      Why it was made, for an adjustment by hand.

    • created_atstringRequired

      When it was made, in UTC.

  • next_cursorstring | nullRequired

    Pass 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

POST

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.

Request
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

  • idstringRequired

    The account's id (acc_...) or its token's mint.

Body

  • amount_usdstring | numberRequired

    Dollars of credit, $20 to $1,000,000, like "20" or "49.50": as many USDC.

  • payerstringRequired

    The wallet that pays: it signs the transaction.

Answer

Answers 201 with Purchase.

Example answer
{  "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
  • idstringRequired

    The purchase's id: pur_ and 16 characters.

  • accountstringRequired

    The account it credits: acc_...

  • status"pending" | "credited"Required

    pending: waits for the transfer; credited: it arrived and was credited.

  • amount_usdstringRequired

    Asked for, in dollars: as many USDC.

  • credited_usdstring | nullRequired

    What arrived and was credited, once final.

  • payerstring | nullRequired

    The wallet the transaction was made for; null for a dashboard payment request.

  • referencestringRequired

    The one-time key the transfer names: how the payment is found.

  • recipientstring | nullRequired

    relayfor's AI treasury, the wallet paid.

  • token_accountstring | nullRequired

    Its USDC account, which receives.

  • mintstringRequired

    USDC's mint.

  • solana_pay_urlstring | nullRequired

    A Solana Pay transfer request for the same payment, for a wallet or a QR code.

  • transactionstring | nullRequired

    In 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 | nullRequired

    The payment's transaction, once credited.

  • created_atstringRequired

    When it was made, in UTC.

  • credited_atstring | nullRequired

    When it was credited; null while it waits for payment.

Errors

A 409, 429, or 503 answer carries Retry-After: wait that many seconds, then send the same request again.

List purchases

GET

Send the project's secret key as Authorization: Bearer rf_sk_..., from a server.

Request
curl https://relayfor.si/api/project/v1/accounts/acc_arqp1qhbpvjhzifE/purchases \  -H "Authorization: Bearer $RELAYFOR_SECRET_KEY"

Path

  • idstringRequired

    The account's id (acc_...) or its token's mint.

Query

  • limitinteger

    1 to 100; default 20.

  • cursorstring

    next_cursor from the page before.

Answer

Answers 200 with PurchaseList.

Example answer
{  "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[]Required

    The items, newest first.

    • idstringRequired

      The purchase's id: pur_ and 16 characters.

    • accountstringRequired

      The account it credits: acc_...

    • status"pending" | "credited"Required

      pending: waits for the transfer; credited: it arrived and was credited.

    • amount_usdstringRequired

      Asked for, in dollars: as many USDC.

    • credited_usdstring | nullRequired

      What arrived and was credited, once final.

    • payerstring | nullRequired

      The wallet the transaction was made for; null for a dashboard payment request.

    • referencestringRequired

      The one-time key the transfer names: how the payment is found.

    • recipientstring | nullRequired

      relayfor's AI treasury, the wallet paid.

    • token_accountstring | nullRequired

      Its USDC account, which receives.

    • mintstringRequired

      USDC's mint.

    • solana_pay_urlstring | nullRequired

      A Solana Pay transfer request for the same payment, for a wallet or a QR code.

    • transactionstring | nullRequired

      In 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 | nullRequired

      The payment's transaction, once credited.

    • created_atstringRequired

      When it was made, in UTC.

    • credited_atstring | nullRequired

      When it was credited; null while it waits for payment.

  • next_cursorstring | nullRequired

    Pass 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

GET

Send the project's secret key as Authorization: Bearer rf_sk_..., from a server.

Request
curl https://relayfor.si/api/project/v1/accounts/acc_arqp1qhbpvjhzifE/purchases/pur_YhFVG0Tp4lxWvY5g \  -H "Authorization: Bearer $RELAYFOR_SECRET_KEY"

Path

  • idstringRequired

    The account's id (acc_...) or its token's mint.

  • purchasestringRequired

    The purchase's id: pur_...

Answer

Answers 200 with Purchase.

Example answer
{  "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
  • idstringRequired

    The purchase's id: pur_ and 16 characters.

  • accountstringRequired

    The account it credits: acc_...

  • status"pending" | "credited"Required

    pending: waits for the transfer; credited: it arrived and was credited.

  • amount_usdstringRequired

    Asked for, in dollars: as many USDC.

  • credited_usdstring | nullRequired

    What arrived and was credited, once final.

  • payerstring | nullRequired

    The wallet the transaction was made for; null for a dashboard payment request.

  • referencestringRequired

    The one-time key the transfer names: how the payment is found.

  • recipientstring | nullRequired

    relayfor's AI treasury, the wallet paid.

  • token_accountstring | nullRequired

    Its USDC account, which receives.

  • mintstringRequired

    USDC's mint.

  • solana_pay_urlstring | nullRequired

    A Solana Pay transfer request for the same payment, for a wallet or a QR code.

  • transactionstring | nullRequired

    In 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 | nullRequired

    The payment's transaction, once credited.

  • created_atstringRequired

    When it was made, in UTC.

  • credited_atstring | nullRequired

    When 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.

On this page