User Guide

Use the console, set budgets, read receipts, and connect collection tools and agents.

Sandbox v0.1 · 2026-11-29

On this page
  1. Choose the right key
  2. Sign in to the console
  3. Understand the overview
  4. Match usage
  5. Match statuses
  6. Use automatic plans
  7. Create a plan
  8. Pause, resume and cancel
  9. If a plan is not matching
  10. Manage budget grants
  11. Create a grant
  12. Revoke a grant
  13. Use sponsorships
  14. Offer a sponsorship
  15. Use a sponsorship you received
  16. View and verify receipts
  17. The six checks
  18. Share a receipt
  19. View reports and monthly certificates
  20. Issue a monthly certificate
  21. Share publicly
  22. View settlement and billing
  23. Manage projects and data
  24. Check usage collection
  25. Legacy Photosynth records
  26. Collect Claude Code and Codex usage
  27. Let an agent make matches
  28. Manage members and keys
  29. Get notifications
  30. Embed in your app
  31. Get support
  32. Platform operations
  33. Frequently asked questions
  34. Why is there only one usage item after two sources reported it?
  35. Why do real models show “Cannot be estimated”?
  36. If usage is updated, will existing receipts change?
  37. Can a receipt be updated?
  38. Can I use a receipt to claim “100% renewable electricity”?

This guide explains how to use the console, set budgets, read receipts and connect tools and agents. If this is your first time, start the sandbox with Quick Start. The console is currently in Chinese, so this guide also gives its Chinese labels.

Choose the right key

The sample data has four keys, all in .local/. Give each person or tool only the permissions it needs.

KeyFileWho it is forWhat it can do
Adminadmin-keyAccount ownerUse all sandbox features, including signing in to the console and managing budgets
Agentagent-keyMCP and app demosReport usage, get quotes, look up data and match within a grant. In the console, it can see only billing
Collectorcollector-keyPhotosynth pluginReport usage only
Operatoroperator-keyPlatform operatorsView and handle operations data for all accounts. It cannot be used as a regular account

Older sample data may not have the collector key, the operator key or newer permissions. Run pnpm seed again to add them. Existing data will not change.

For real use, create a separate key for each person and app under Members and keys. Do not share the admin key.

Sign in to the console

  1. Open http://127.0.0.1:4310/console/.
  2. Paste the admin key and sign in.

The key is used only to sign in and is not saved in your browser. You stay signed in for 8 hours. On a shared computer, click Sign out (退出) when you finish. If a key is revoked, any session that signed in with it also ends immediately.

The console uses UTC, which may differ from your local time. Daily and monthly limits also use UTC.

This is a simplified layout with shortened English labels. The console itself is in Chinese and shows only the pages your key can view.

Understand the overview

MetricMeaning
Recorded electricity (estimated) (已记录用电(估算))The total for recorded usage that can be estimated. Usage that cannot be estimated is not included
Confirmed matches (已确认匹配)Electricity with confirmed settlement. It does not include amounts that are reserved or awaiting confirmation
Available balance (账户可用余额)The account balance minus any funds on hold
Match rate (匹配率)Confirmed electricity as a share of recorded electricity. Each usage item counts for no more than 100%

If the match rate shows “Unknown” (未知), at least one usage item cannot be estimated, so the overall rate cannot be calculated. “No usage” (无用量) means there is no electricity to count in the selected period. The rate is always rounded down, so it will not show 100% until the full amount is matched.

The match rate covers recorded usage only, not all AI use. The number of connected tools does not show whether all usage has been collected either.

If you have provided provider totals, the result of the comparison also appears here. Matching totals do not prove that collection is complete.

Issues that need attention appear at the top of the page, including connections that have not sent data for a long time. Match alerts cover all time, so older issues still appear when you change the period.

Match usage

  1. Open Usage (用量), choose a beneficiary scope and check how much electricity is waiting to be matched.
  2. If needed, change the target share, purchase buffer and settlement mode. Then click Get quote (获取报价). A quote is valid for 10 minutes. It does not spend money or reserve supply.
  3. Check the electricity, buffer, three fees, payer and source pool. Then choose a budget grant.
  4. Click Confirm match (确认匹配), then check its progress under Matches and receipts (匹配与收据).

You can match up to 500 items at a time. Match any remaining items separately. Usage that cannot be estimated cannot be matched.

  • Target share: For example, you can match 50% now and bring it up to 100% later. The receipt will show that the target is less than the estimated electricity.
  • Purchase buffer: This adds extra spending and retirement. It does not count towards the match rate or make up for missed usage. By default, grants do not allow a buffer.
  • Separate settlement: This match gets its own batch and is not combined with other matches.

If you see that no grant is available, create a budget grant first. It must belong to the key you are signed in with, and its project, beneficiary scope and source pool must all match.

Match statuses

reservedReservedsubmittedAwaiting confirmationconfirmedCompleteAdd to batchRemainder, gap or revertEnough confirmationsreconciliation_requiredNeeds reconciliationUnclear or source mismatchContinue once checked (not mismatches)ReorganizationfailedNot completed; releasedReverted 3 times in a rowIf partly confirmed: partially_confirmed
This shows the main paths. A match can have several allocations. Its status combines all of them and their batches.
StatusMeaningWhat you need to do
Reserved (已预留)Funds and supply are reserved and waiting for a batchWait. If the amount is too small, it will wait to be settled with more usage
Awaiting confirmation (等待确认)In a settlement batchWait
Awaiting external registration (等待外部登记)Confirmed on-chain, but external registration is not completeWait. It does not count towards the match rate until registration is complete
Complete (已完成)All target electricity is confirmed, and any required external registration is completeView the receipt. The status may change if the chain reorganizes
Partly complete (部分完成)Some electricity is confirmed, and the rest of the reservation has been releasedCheck the confirmed amount and get another quote if needed
Not completed (未完成)The match did not go through, and its reservation has been releasedCheck the reason under Settlement (结算) before deciding whether to get another quote
Needs reconciliation (需要核对)The settlement result is unclear, the chain has reorganized or the source does not matchCheck the reason under Settlement (结算). Operators handle source mismatches; the system keeps checking the other cases

Use automatic plans

An automatic plan regularly matches new usage within the budget you set. Once created, it spends automatically without asking you to confirm each match. Each beneficiary scope can have only one plan that has not been cancelled.

Time rangeTime used and first receivedStable estimateAt least 5 minutesPrice and budgetPrice, limits, balance, supplyReserveCreate a matchWait for the next runidleNot eligible yetStop and give a reasonblockedOver a limit
Checking the budget, choosing usage, making the reservation and updating the plan all happen in one database transaction. If any part fails, everything is rolled back.

Create a plan

  1. Open Automatic plans (自动计划) and click New plan (新建计划).
  2. Choose a beneficiary scope and source pool.
  3. Set limits per match, per day and per month. The limit per match cannot be higher than the daily limit, and the daily limit cannot be higher than the monthly limit.
  4. Set the maximum unit price, how often the plan runs and when it expires. The maximum unit price starts at the current price. If the source pool’s price rises above it, the plan stops matching.
  5. Set the target share, purchase buffer, settlement mode and payer.
  6. Choose what happens when usage cannot be matched. By default, AI tasks continue. If you choose to suggest that the integration pause tasks (建议接入方暂停任务), the integration must still ask for the recommendation. The system does not block tasks itself.
  7. To include earlier usage, first check how much is waiting to be matched. Then select the option to also match earlier usage (同时匹配之前的用量).
  8. Check the details and create the plan.

Usage is matched only after its estimate has been stable for 5 minutes. If the first run shows that there is no usage to match (没有需要匹配的用量), the usage may not have reached 5 minutes yet. Usage that cannot be estimated is not matched.

Limits for automatic plans and manual grants are separate. Your total spending can be as high as all of them combined.

Pause, resume and cancel

ActionWhat happens
PauseStops automatically matching new usage. If the plan is already running, that run finishes first
ResumeRuns as soon as possible and also matches usage from while it was paused
EditDoes not reset the amounts already used today or this month
Run nowAsks the background worker to run as soon as possible. The 5-minute wait and all limits still apply
CancelCannot be undone. A new plan has new limits that do not include the old plan’s spending

After a plan is paused or cancelled, matches that were already reserved or submitted still continue.

If a plan is not matching

Automatic plans (自动计划) shows the reason, and the overview also shows an alert. If you set up a webhook, you will be notified when a problem starts, its reason changes or it is resolved. Email is not supported yet.

ReasonWhat to do
The limit per match is too lowRaise the limit per match, or match the larger usage item manually
The daily or monthly limit has been reachedWait until the next UTC day or month, or raise the limit
The account balance is too lowAsk an operator to add test currency, or top up with the x402 sandbox
The sponsorship does not have enough left, or it has been revoked or has expiredContact the sponsor. To change the payer, cancel the plan and create a new one
The usage year does not match the sourceUse a source pool whose rules match, or continue matching other usage
The source pool does not have enough supplyWait for more supply, or cancel the plan and choose another source pool
The source pool’s price is above the maximum unit priceWait for the price to fall, or raise the maximum if you accept the new price
The plan has expiredEdit the plan and extend its expiry date
An error occurred while runningThe system retries automatically. If the error continues, check the server logs

If more than one limit applies, only the one with the least remaining is shown. After you resolve it, another limit may still apply.

Matches made by an automatic plan are marked Automatic plan (自动计划) under Matches and receipts (匹配与收据).

Manage budget grants

A grant lets a key spend within a specific project, beneficiary scope and source pool. It sets limits per match, per day and per month.

Create a grant

  1. Open Budget grants (预算授权) and click New grant (新建授权).
  2. Choose a key, beneficiary scope and source pool. The project is the one selected at the top right of the page.
  3. Set limits per match, per day and per month, and an expiry date.
  4. Choose the payer and the allowed purchase buffer. By default, your own account pays and no buffer is allowed.
  5. Check the details and create the grant.

Start with low limits and an early expiry date. Once the grant is active, any program or agent using the key can spend within its limits without asking you to confirm each match.

If you see that no result was received (没有收到结果), the grant may already have been created. Check the list first. Retrying right away could create a second grant.

Revoke a grant

Under the grant, click Revoke (撤销) and confirm. This blocks new matches immediately and cannot be undone. Matches that were already reserved or submitted still continue.

Use sponsorships

Offer a sponsorship

  1. Open Billing and sponsorship (账单与赞助) and click Create sponsorship (创建赞助).
  2. Set the spending limit and expiry date. The amount is only a limit; funds are not held in advance.
  3. Save the claim code, which is shown only once, and send it to the recipient through a secure channel. Anyone with the code can claim the sponsorship.

You can see the total spent and the total electricity supported. You cannot see the recipient’s account, usage or receipts. Revoking a sponsorship prevents new spending, but matches that have already been accepted will still be settled.

Use a sponsorship you received

  1. Under Billing and sponsorship (账单与赞助), click Claim sponsorship (领取赞助) and choose a beneficiary scope. You cannot change it after claiming the sponsorship.
  2. When you create a grant or automatic plan, choose this sponsorship under Payer (付款方).

If the sponsorship does not have enough left, expires or is revoked, matching stops. It will not use your own balance instead. Receipts show that a sponsor paid, but do not make the sponsor’s name public.

View and verify receipts

Under Matches and receipts (匹配与收据), click Open (打开). The system verifies the receipt again each time you open it.

  1. StatusAll target electricity is confirmed only when you see “Sandbox process complete”. If any check fails, you will see “Verification failed”. The receipt page shows these messages in Chinese.
  2. ElectricityThe estimate, this match’s target and the confirmed amount are shown separately.
  3. Usage coveredThe date of use, data basis and estimation method. The reporter declares the data basis, and the system has not verified it.
  4. Retirement and sourcesThe net retirement, simulated transaction and certificate sources.
  5. Verification resultsEach of the six checks shows whether it passed, failed or does not apply.

The six checks

CheckWhat it checks
Receipt signature (收据签名)Whether the receipt’s contents match its signature
Batch manifest and amounts (批次清单与数量)Whether the allocation is in the batch manifest and whether the total exceeds the net retirement
Latest version (是否为最新版本)Whether the receipt has a newer version
Retired amount and source (注销数量与来源)Whether they match the on-chain record. The sandbox checks a simulated chain
No duplicate allocation (分配没有重复)Whether the allocation belongs only to this receipt and whether the batch has been over-allocated. This is based on the platform ledger
Whether matching rules apply (匹配规则是否适用)Same-year (同年) source pools check the years of use and generation. The sample data uses renewable energy support, which has no matching rule, so this check shows “Not applicable” (不适用)

Before settlement is confirmed, some checks also show “Not applicable” (不适用). These checks only compare records with what was executed. They cannot prove that the electricity estimate is accurate.

Share a receipt

Anyone with the link can open a receipt. Public information includes the match status, electricity, date of use, data basis, estimation method, source and settlement ID. It does not include the tenant, project, beneficiary scope, amounts of money or exact time of use.

Receipt links cannot be hidden or revoked, so check before you share one. Shared monthly certificates and total support can be revoked. The sandbox address 127.0.0.1 works only on the computer running the server. You can also verify a receipt offline.

View reports and monthly certificates

Open Reports and certificates (报告与凭证), then choose a month and how to group the data. You can group it by model, task, beneficiary scope, source or tag, and export it as CSV. Spending is counted when it is posted to the ledger. It is split between your own payments and those made by sponsors, with energy attribute purchases, execution costs and software service fees shown separately.

Issue a monthly certificate

After the month ends in UTC, click Issue or update (签发或更新) and choose the whole project or one beneficiary scope. Certificates are private by default. You will see an alert if the data changes after a certificate is issued. Issuing it again creates a new version; earlier versions stay the same.

Share publicly

You can share a monthly certificate, or only the total electricity supported. Once it is shared, anyone with the link can view it, and its title is public, so do not include personal information. You can set an expiry date or revoke it at any time, but you cannot take back anything others have already saved.

View settlement and billing

Settlement (结算) shows the details of each batch:

  • Gross amount used (消耗毛额): The total taken from the source pool, including the fee.
  • Net retirement (净注销): The electricity actually retired on-chain after the fee. Receipts count only this amount.
  • Unallocated (未分配): Electricity that has been retired but not allocated to a receipt. It is recorded separately and will not be sold or allocated again.
  • External registration (外部登记): Some source pools require registration. They are complete only after it is confirmed.

All amounts under Billing and sponsorship (账单与赞助) are in the test currency USD_TEST, which has no real value:

TypeMeaning
Top-up (充值)Test currency added by the sample data or an operator
x402 top-up / Refunded top-up (x402 充值 / 退回充值)A top-up through the x402 sandbox, or an unused top-up refunded by an operator
Hold (冻结)Funds are held when a match is accepted. The balance does not change
Confirmed charge (确认扣款)Funds are charged after settlement is confirmed, and the held amount is reduced
Release hold (解除冻结)The available balance is restored after a reservation is released
Charge fees / Release fees (扣除费用 / 释放费用)Fees are charged once any electricity is confirmed, or released if everything fails
Fee charge reversed after a chain reorganization (链重组,撤销费用扣款)The fees are put back on hold
Charge reversed after a chain reorganization (链重组,撤销扣款)If settlement loses its confirmation, the funds are put back on hold until it is confirmed again

Manage projects and data

Open Projects and data (项目与数据) to create projects and beneficiary scopes. A beneficiary scope can stand for a person, team, customer or organization. When your app creates one for a user, we recommend adding an external ID. Using the same ID again will not create a duplicate. Once usage belongs to a project and beneficiary scope, this cannot be changed.

You can also set:

  • Fallback estimates (回退估算): If allowed, usage without its own method can use a clearly labelled fallback method.
  • Re-estimate (重新估算): This applies only to usage that could not be estimated before. It does not change existing estimates. Automatic plans may then match this usage and spend money.
  • Settlement timing (结算节奏): By default, matches are settled as soon as possible. You can also settle them based on an amount and a maximum wait.

Check usage collection

  • Data connections (数据连接): Enter the source ID and how often it normally reports. If no data arrives in time, the overview shows an alert.
  • Provider totals (供应商总量): Submit a provider’s token totals for a month to compare them with your records, category by category.
  • Reporter public keys (上报方公钥): These are used to check signatures from sources such as meters and gateways. Submit only the public key, never the private key.

None of these checks can prove that collection is complete or that the values are accurate.

Legacy Photosynth records

You can import old records through the API. They only show the original support amount and are not included in metering, matching or the match rate. If a record has a wallet address, get the text to sign under Wallet links (钱包关联), then sign it in your own wallet. This does not send a transaction or approve the use of any assets. Never enter a private key or recovery phrase on the page.

Collect Claude Code and Codex usage

The Photosynth sandbox plugin can collect token usage from Claude Code and Codex CLI. By default, it collects new usage from the clients you choose, across all projects on this computer. Use the projects command to collect from only certain folders, or to exclude them. If you include a folder again, usage from while it was excluded is not added later. See the plugin documentation for exceptions.

From the root of the repository, make sure the collector key exists, then build the plugin:

pnpm seed
pnpm build

Make sure the sandbox server is running, then set up the plugin:

node plugins/arec-photosynth/scripts/photosynth.mjs setup --api-url http://127.0.0.1:4310 --key-file .local/collector-key --project prj_demo --scope scope_demo

This only completes the setup. It does not install the hook for automatic collection. To install the hook, see plugins/arec-photosynth/README.md in the repository. Without the hook, you can collect and send usage manually:

node plugins/arec-photosynth/scripts/photosynth.mjs sync

Replace sync with one of these commands to check or control collection:

CommandWhat it does
statusShows what each tool has collected, what has been received and what is waiting to be sent, as well as any unconnected tools and problems
projectsShows or changes which projects are collected
pausePauses collecting and sending
resumeResumes collection without adding usage from while it was paused
  • Reported: Token counts, the model and provider, response ID, response time, a random device ID and an anonymous session identifier.
  • Not reported: Prompts, answers, code, file paths, usernames and hostnames.

There are no reliable estimation coefficients for real models yet. Collected usage will therefore show “Cannot be estimated” (无法估算), and the project’s match rate will become “Unknown” (未知). The plugin does not support Kimi yet. Records from kimi-cli cannot be reliably deduplicated or converted into separate token categories.

Let an agent make matches

  1. In the console, create a small grant for the agent key.
  2. Set up MCP by following Quick Start.
  3. Have the agent check the status first, then get a quote, make the match and verify it.
  1. arec_get_statusCheck grants and unmatched usage
  2. arec_quoteGet a quote without spending
  3. arec_matchMake a match within the grant; this spends money
  4. arec_get_receiptWait until complete, then verify
The agent returnsWhat to do
settlement_complete: trueThe completion claim is valid and no checks have failed. You can treat it as complete
outcome_unknown: trueThe request may have been accepted. Retry only with exactly the same arguments. Do not get a new quote
next_action: check_receiptCheck the receipt again later. Do not make another match
next_action: retry_same_argumentsRetry with exactly the same arguments
next_action: ask_ownerThe agent should stop and ask you. Do not let it switch grants, split usage or raise the amount to get around limits

ok: true means only that the tool call succeeded, not that settlement is complete.

Manage members and keys

Only the owner can use Members and keys (成员与密钥).

  1. Click Add member (添加成员) and choose a role. Each member has their own key for signing in.
  2. For each app, agent and collection tool, click Create key (创建密钥). Choose only the permissions it needs and set an expiry date.
  3. Save the key immediately; it is shown only once. If it is lost, you cannot view it again. You can only rotate it or create a new one.

Changing a role, disabling a member or revoking a key takes effect immediately. The system always keeps at least one key that can manage members and does not expire, so the account can always be managed. The activity log (操作记录) lists important changes but never shows the keys themselves. You cannot add members to a personal account, but you can create app keys.

Get notifications

Open Developers (开发者), add a webhook URL and choose which notifications to receive. Save the signing secret, which is shown only once. The URL must use HTTPS on the public internet.

You can send a test notification, and view or replay deliveries. The receiver must check the signature and use the notification ID to remove duplicates. For 24 hours after you rotate the secret, notifications are signed with both the old and new secrets. See Tech Docs for the signature format.

Embed in your app

Copy the sample code from Developers (开发者) to show a receipt badge, receipt card or monthly card on your web page. You only need a receipt ID or share ID. Do not put an API key on the page. Anyone with a receipt ID can view its public receipt, and this access cannot be revoked.

The API test console (API 测试台) uses the permissions of your current session. Requests that change data are sent only after you confirm them again.

Get support

Under Support (支持), you can open a ticket and view replies. You can include a match or receipt ID. Do not include keys, passwords, prompts or personal information. Replying to a closed ticket opens it again.

Platform operations

Sign in with operator-key to use the operations pages. This key can view every account, so store it separately.

PageWhat it is for
Operations overview (运营总览)View source pools, supply and issues, change prices, and check the ledgers and on-chain records
Batch handling (批次处理)Handle batches with source problems and enter external registration results
Account management (账户管理)Create personal or organization accounts, add or refund test currency, set fees and view the activity log
Estimation methods (估算方法)Publish new versions. Published versions cannot be changed. Do not publish one without evidence
Customer tickets (客户工单)View, reply to and close tickets

Frequently asked questions

Why is there only one usage item after two sources reported it?

They belong to the same tenant and have the same provider and request ID, so the system combines them. If their electricity estimates differ, the usage is marked “Sources disagree” (来源不一致). Without a shared request ID, the system cannot detect duplicate reports.

Why do real models show “Cannot be estimated”?

There are no reliable energy coefficients for them yet. The system records the usage, but does not count it as zero or use another model’s coefficients.

If usage is updated, will existing receipts change?

The estimate used in the original receipt will not change. If electricity increases, you can get a new quote for the difference. If it decreases, existing allocations stay in place, and the match rate will not go above 100%.

Can a receipt be updated?

When its status changes, a new version is added and earlier versions are kept. The receipt page always shows the latest version. If you verify an earlier version, you will see that a newer one is available.

Can I use a receipt to claim “100% renewable electricity”?

No. The sandbox does not retire real assets, and its matching rules are fictional.

Read nextTech Docs →