Agent API · TESI Ask + Work · Prepaid credits
Put TESI to work from your agent.
Get answers with Ask or send Work a software brief with acceptance checks. Both run over HTTPS on your isolated TESI computer and return a reply and the remaining balance.
Start in three moves
- Discover GET /api/v1/agents for pack sizes, modes and endpoints. Run free checks.
- Fund Hand a Stripe Checkout link to a person, or redeem an issued code. Save the returned key privately.
- Run Call
/chatfor Ask or/workfor Work with your bearer key.
$10, $25, $50 or $100 USD in prepaid credits. Ask and Work draw from the same balance at published token rates.
A company-funded Business TESI run produced this newsletter service (ZIP) using simulated billing and email. Download and extract the project, then run python3 -I newsletter.py test with Python 3.11 or newer. Source ZIP SHA-256: 561d8335e9924808711f6af4d69616aaeef0ba3bb9898906eb4534c1a7307d21.
People can try TESI Free in the browser at / without sign-up or email, subject to free-tier availability and eligibility. Software agents use prepaid credit for Ask and Work on an isolated computer. Buy credit with Stripe Checkout or activate an issued promotional code without a card.
Fund your key and run a task
From discovery to a first call.
Send your agent the plain-text guide for the funding and request flow, read the full API examples, or import the OpenAPI specification.
Discovery includes shared rate limits. On HTTP 429, wait for the seconds in Retry-After.
Check availability without a key
This GET reads the current offer without spending credits. Check available and amountsCents. Read buyerGuide for Checkout, sample verification and tasks with acceptance checks.
curl -fsS https://toolsenabled.ai/api/v1/agentsVerify before funding.
Check the public offer, the OpenAPI document and the newsletter project's published checksum. These free reads use no API key or credits.
Buy prepaid agent credits.
Pick a one-time USD pack for a new Agent API key. Complete the purchase on Stripe, then return in this browser to claim and save the key for your agent. If the link is interrupted, resume the same Checkout here. This browser can recover the purchase for up to 48 hours, until you confirm that you saved the key. For an existing key, add credits to that key.
Review and share this purchase
Review your draft for private information before sharing.
Checking available credit packs…
Have a promotional code?
Preview its value without using it. Send {"giftCode":"YOUR_CODE","preview":true} in a JSON body to POST /api/v1/agents/keys. Check creditCents and redeemable. When ready, send {"giftCode":"YOUR_CODE"} to the same endpoint once. Save the reusable apiKey from the 201 response. Keep codes out of URLs and query strings. Use the funded key at step 3. A paid top-up requires Stripe Checkout.
Start a prepaid Stripe Checkout session.
Read GET /api/v1/agents for available credit pack sizes. For per-token dollar prices, see the Published TESI Rates section in the machine-readable specification. To buy a pack, send a value from amountsCents as amountCents in a JSON body to POST /api/v1/agents/keys. TESI answers HTTP 402 Payment Required with checkoutUrl and sessionId before issuing any key.
Complete payment and save your bearer key.
Complete card payment at checkoutUrl, then send POST /api/v1/agents/keys with {"sessionId":"cs_..."}. TESI verifies settled Stripe payment, provisions an isolated agent workspace, and returns {"apiKey":"tesi_ak_..."} once. Save it privately for later calls. TESI stores its hash. A repeated claim returns 409. Send session IDs in JSON bodies and bearer keys in the Authorization header. Keep both out of URLs and query strings.
Execute on your isolated TESI agent computer.
Send POST /api/v1/agents/chat ({"message":"...","mode":"ask"}) or POST /api/v1/agents/work ({"message":"...","mode":"work","effort":"medium"}) with Authorization: Bearer tesi_ak_.... TESI wakes the key’s isolated computer, meters real TESI usage atomically against prepaid credits, and returns reply plus balance. The agent computer has 1 vCPU, 2 GB RAM and 4 GB disk. Work is billed by token usage at the published rates. The cost depends on the task.
Run a small paid Ask first
Load your funded key as TESI_API_KEY through your secret store. Run the command in a POSIX shell. On HTTP 200, check that reply contains the expected answer (42) and read balance.availablePico for the remaining credit.
printf 'Authorization: Bearer %s\n' "${TESI_API_KEY:?Set TESI_API_KEY in your secret environment}" |
curl --fail-with-body -sS 'https://toolsenabled.ai/api/v1/agents/chat' \
--header @- --header 'Content-Type: application/json' \
--data '{"mode":"ask","message":"Return the sum of 17 and 25 as a single number."}'First project: an event-to-report webhook service. Ask for a deployable Python service with SQLite storage, a command-line client and deployment instructions. Test that replaying the same event counts it once, a conflicting ID is rejected, and the daily report survives a restart. Use the Work request builder to write your own brief, or see the complete webhook example.
Add credit to your existing key.
Inspect balance at GET /api/v1/agents/balance or create a top-up session with POST /api/v1/agents/topup. If a call returns HTTP 402 with insufficient_credits, give the purchaser the returned checkoutUrl when provided. If the top-up is paid or pending, reconcile the same session before starting another purchase.
After payment, send {"sessionId":"…"} to POST /api/v1/agents/topup with the same bearer key. A 200 response with status: "paid" includes the updated balance. If you get 402 payment_required, check the same session again once payment settles.
printf 'Authorization: Bearer %s\n' "${TESI_API_KEY:?Set TESI_API_KEY in your secret environment}" |
curl -fsS 'https://toolsenabled.ai/api/v1/agents/balance' --header @-If a turn times out or the connection drops, use the same key to read GET /api/v1/agents/turns/{requestId}. The receipt can recover a verified reply after a lost response. If it says processing or outcome_unknown, check the same receipt again. If it stays unknown or is missing, contact support with the request ID and approximate time. Keep the bearer key private.
Build a Work request.
Describe what you want back and how you’ll check it. The builder prepares JSON in this page. When ready, submit it to POST /api/v1/agents/work with your bearer key.
Run a saved request with your funded key
Download work.json above or use a request you already saved. Run this from its directory with TESI_API_KEY loaded from your secret store. A new request can spend credits. Keep this file so you can recover its reply.
printf 'Authorization: Bearer %s\n' "${TESI_API_KEY:?Set TESI_API_KEY in your secret environment}" |
curl --fail-with-body -sS 'https://toolsenabled.ai/api/v1/agents/work' \
--header @- --header 'Content-Type: application/json' \
--data-binary @work.json
Use reply to check the deliverable against your brief. To recover a reply, use the returned receiptUrl or open the original request file. If credits run low, top up the same key.
Before starting another task, use GET /api/v1/agents/usage with the same key to read settled debits and the ledger balance. Use nextCursor to fetch older charges.
Recover a saved reply.
Open the JSON you sent or paste its request ID. The page reads the file locally and prepares a command to recover the reply with your original key.
Questions
Good to know.
How do external software agents pay before using TESI?
Send POST /api/v1/agents/keys with an amountCents value from GET /api/v1/agents. TESI answers HTTP 402 Payment Required with a Stripe Checkout checkoutUrl and sessionId. Complete payment on Stripe, then POST the sessionId to /api/v1/agents/keys once to claim your bearer key. If you already have a promotional code, preview and redeem it at the same endpoint without a card.
Does the Agent API run real TESI Ask and Work?
Yes. Each funded bearer key owns an isolated TESI agent computer and workspace. POST /api/v1/agents/chat (mode ask) and POST /api/v1/agents/work (mode work, with effort control) execute real TESI turns on that computer, metered against your prepaid balance.
What happens when prepaid credits run out or a charge is refunded?
On HTTP 402, reuse the returned top-up for the same key. If its status is paid or pending, reconcile the existing session before offering another purchase. Refunds reduce credit. A fully refunded key is revoked.
How is prepaid usage metered?
See Published TESI Rates in /llms-full.txt for per-token prices. Use balance.usedPico for cumulative settled debits. The usage fields summarize reservations observed on the key, including overlapping requests. Individual request cost is currently unavailable.
More about TESI