Agent credit top-ups
An agent that runs out of credits can fund its organization itself. It asks Sikaru for a top-up offer of an amount it chooses, and its agent wallet pays the offer’s URL. The credits land in the organization’s wallet once the payment succeeds, and a run that paused for funding can resume in the same turn. No one needs to open Billing, not even for a brand-new organization: its first paid top-up opens its credit account.
Anyone who can read runs in a project can check its organization’s balance, and anyone who can start runs can create an offer for that organization: a project API key with runs:read or runs:create, or a CLI sign-in. Paying an offer can only add credits to that organization.
Organization admins control agent top-ups in Billing: they can turn them off for the whole organization, or cap each top-up below Sikaru’s maximum. Offers, payments and the topUp hint follow both settings.
Check the balance
An agent can check its organization’s credits before work pauses, and top up while it still has room to finish.
CLI
Python
TypeScript
Add -o json for {"state": "ready", "availableUsd": "2.500000", "topUpMaxUsd": "50.00"}.
state is ready when credits fund work, no_card while the organization has no credit account yet (an agent top-up opens one, as does saving a card in Billing), and complimentary when usage is covered. availableUsd is what new work can use now, after amounts held for work in progress. topUpMaxUsd is the largest offer the agent can create, or null while agent top-ups are off.
Create an offer
CLI
Python
TypeScript
The command prints the offer’s pay URL, amount and expiry. Add -o json for the full offer:
Amounts are US dollars in whole cents, such as 20 or 20.50. An amount outside the limits is refused before any payment is requested.
Pay the offer with an agent wallet
The pay URL takes payment through the standard HTTP 402 machine-payment exchange: a request without payment returns 402 with a payment challenge, and the agent’s wallet answers it with a one-time payment token. The URL needs no Sikaru credential.
Link is the supported agent wallet. With its CLI, the agent pays the URL in one command, and the person behind the wallet approves the spend:
The amount comes from the challenge. The wallet shows --context, which must be at least 100 characters, to the person approving the payment. A successful payment returns the offer with status credited and fundsAvailable: true. If fundsAvailable is false, the credits are in place but spending has not caught up yet; wait for Retry-After seconds before resuming.
Each offer is charged at most once. Paying it again returns the original receipt; paying an expired offer is refused. Check an offer at any time:
Resume a paused run
When a run stops because the organization has no credits, it pauses with reason credits_exhausted and keeps its work. While the organization has agent top-ups turned on, the pause, the run.paused event and 402 refusals carry a topUp hint. Its maxUsd is the organization’s per-top-up cap:
sikaru agent run exits with code 5, and its next field lists the top-up command before the resume command. Once the credits land, the paused turn resumes on its own. To continue the same turn at once, resume it:
Other funding stops, such as the organization’s monthly spend limit or an agent’s spending cap, carry no hint: a person resolves them in Billing.
Funding from Billing
Agent top-ups sit alongside the ways people fund an organization in Billing:
- Card. An admin saves one card for the organization. The first card earns a one-time $5 starting credit.
- Add Credits. Buy any whole-dollar amount from 500 on the saved card.
- Auto Reload. When the balance falls below Y. Both are whole dollars: the threshold is 500 and the amount is 500, more than the threshold. After two declined reload charges in a row, auto-reload turns itself off until an admin turns it back on.
- Monthly spend limit and usage alerts. An admin can cap the organization’s spend for the calendar month, and set up to 10 alerts that email the organization’s admins when the month’s spend passes an amount.
Transactions in Billing list every credit purchase, auto-reload, agent top-up and the starting credit.
Limits
If a payment is disputed, new top-ups for the organization pause until support clears them; credits already added stay in place. Top-ups appear in Billing transactions as Agent Top-Up, with the agent that paid.
