TESI Agent API — Complete CLI & Protocol Reference For the compact low-token quickstart, read: https://toolsenabled.ai/agents/quickstart.txt For the drop-in Agent Skill, read: https://toolsenabled.ai/agents/SKILL.md For the zero-dependency stdio MCP server, download: https://toolsenabled.ai/agents/tesi-agent-mcp.py.txt For the MCP Registry JSON manifest, read: https://toolsenabled.ai/agents/mcp-server.json (or https://toolsenabled.ai/.well-known/mcp/server.json) python3 -I tesi-agent-mcp.py --self-check python3 -I tesi-agent-mcp.py --print-config claude mcp add --transport stdio tesi -- python3 -I ./tesi-agent-mcp.py codex mcp add tesi -- python3 -I ./tesi-agent-mcp.py TESI Agent API quickstart Use Ask for a direct answer. Use Work when you can name a deliverable and how to check it, such as a cleaned CSV and a duplicate count. You can prepare either draft and quote its starting credit for free. Submitting uses credits. Discover for free GET https://toolsenabled.ai/api/v1/agents/quickstart Use this short JSON for current packs, supported modes and efforts, configured computer size, request limits and the exact Ask, Work, balance and receipt endpoints. Use actions.startingCredit with promptBytes and optional includePacks=1 to quote starting credit without a key. actions.costExample prices one reference-model call from inputTokens and outputTokens. Each workStarters entry describes the requested deliverable in expectedOutput and includes a browserPreviewUrl. Open it to review the editable brief and acceptance checks for free. To get the CSV inputs, expected output and offline checker with their SHA-256 hashes, read the compact entry: curl -fsS https://toolsenabled.ai/api/v1/agents/quickstart | jq -e '.workStarters[] | select(.id == "csv") | {referenceFiles, referenceCheck}' Save the verified checker as check-sku.py and the delivered CSV as result.csv. Run referenceCheck.resultOnlyArgv to check the sample header and both rows: python3 -I check-sku.py result.csv To check the delivered counts too, save them as report.json and run referenceCheck.reportArgv. The sample expects referenceCheck.reportExample: {"inputRows":3,"outputRows":2,"duplicatesRemoved":1} python3 -I check-sku.py result.csv --report report.json Use referenceCheck.inputArgv to verify your own cleanup from the original sku,title CSV. The checker keeps the first occurrence of each exact, case-sensitive SKU in order and trims titles: python3 -I check-sku.py --input input.csv result.csv --report report.json Before commissioning Work, referenceCheck.previewCountsArgv prints the expected counts from your local input for use as acceptance criteria: python3 -I check-sku.py --input input.csv --preview-counts Use referenceCheck.previewChecksArgv for a paste-ready version of the same counts and cleanup rules. Paste its output into the Work builder's acceptance checks. Include the CSV you intend to share separately in the brief: python3 -I check-sku.py --input input.csv --preview-checks referenceCheck.draftWorkArgv prints a complete local Work draft with the CSV you intend to share and the acceptance checks: python3 -I check-sku.py --input input.csv --draft-work Save the output as a new work.json and open it in the Work builder to review. The draft contains your source CSV. Submission is a separate step. For the full request templates, follow offerUrl: GET https://toolsenabled.ai/api/v1/agents Check available, amountsCents (USD cents), modes, efforts, endpoints and rateLimits. For a purchaser review link, put an offered amountCents into buyerGuide.funding.packReviewUrlTemplate. Visiting the link preselects the pack. The purchaser still prepares Checkout explicitly. The pack funds a reusable balance and actual task costs depend on token usage. Read buyerGuide for the minimum Checkout pack, the purchaser step, free evidence links with the sample digest, request limits and acceptance checks. Choose an Ask or Work starter, adapt its deliverable and keep the checks with the request. For a Work starter, open browserPreviewUrl to load its editable brief and checks in the browser. It carries the public starter ID. The CSV starter's referenceOutput contains the expected CSV and validation counts for the published input. Read referenceFiles.input and referenceFiles.expected for the download URLs and SHA-256 hashes. Compare the files locally for free: https://toolsenabled.ai/agents/examples/sku-input.csv https://toolsenabled.ai/agents/examples/sku-expected.csv Save your output as result.csv beside the downloaded sku-expected.csv. This offline check compares the header and each row in order. It accepts equivalent CSV quoting and line endings. python3 -I - sku-expected.csv result.csv <<'PY' import csv import sys from itertools import zip_longest sample = [("sku", "title"), ("A-11", "Cable"), ("B-03", "Adapter")] def rows(stream): return map(tuple, csv.reader(stream, strict=True)) with open(sys.argv[1], encoding="utf-8-sig", newline="") as expected, open( sys.argv[2], encoding="utf-8-sig", newline="" ) as result: for number, (known, wanted, found) in enumerate(zip_longest(sample, rows(expected), rows(result)), 1): if wanted != known: sys.exit(f"Reference differs from the published sample at CSV record {number}") if wanted != found: sys.exit(f"Mismatch at CSV record {number} (header is record 1)") print("CSV matches the reference") PY Prepare your first Work draft in a terminal (free, no API key required) On Linux with GNU coreutils, curl and Python 3, run the block below. It checks the client download and prepares the draft in a temporary directory. After a failed download, run the same block again. An existing tesi-starter directory is preserved. Choose the result you want by editing the starter line in the block: csv cleaned product rows and a duplicate count docs Markdown review with source links and suggested changes merge-scope supplier merge specification with decisions to confirm webhook Python service patch with tests and startup commands delivery-check clean-room HTTP, Content-Type, byte-count, SHA-256 and JSON schema check reconcile order-vs-settlement CSV reconciliation report with offline checker ui-prototype responsive 390px/1280px HTML/CSS/JS invitation quote calculator prototype python3 -I tesi-buy.py preview-code python3 -I tesi-buy.py redeem-code ./tesi-purchase python3 -I tesi-receipt.py --file work.json --pack-project ./src --prompt "Add daily CSV export and unit tests" python3 -I tesi-receipt.py --extract-files ./delivered --reply-file reply.md ( set -e starter=csv if [ -e tesi-starter ] || [ -L tesi-starter ]; then echo 'tesi-starter already exists. Open your saved draft there.' >&2 exit 1 fi stage=$(mktemp -d ./.tesi-starter.XXXXXXXX) trap 'rm -f -- "$stage/tesi-receipt.py" "$stage/work.json"; rmdir -- "$stage" 2>/dev/null || :' EXIT ( cd "$stage" curl -fsS https://toolsenabled.ai/agents/tesi-receipt.py.txt -o tesi-receipt.py curl -fsS https://toolsenabled.ai/api/v1/agents/quickstart | python3 -I -c ' import hashlib, json, pathlib, sys expected = json.load(sys.stdin)["askDraft"]["sha256"] actual = hashlib.sha256(pathlib.Path("tesi-receipt.py").read_bytes()).hexdigest() sys.exit(0 if expected == actual else "Receipt client checksum mismatch") ' python3 -I tesi-receipt.py --file work.json --prepare-work "$starter" ) mv -nT -- "$stage" tesi-starter test ! -d "$stage" trap - EXIT ) Edit tesi-starter/work.json to describe your input, desired output and checks. From the directory where you started, validate the edited draft offline: python3 -I tesi-starter/tesi-receipt.py --file tesi-starter/work.json --validate Look for request_valid and keep the requestBodySha256 with your approved draft. For the shorter commands below, first run cd tesi-starter. When a command needs --key-file, use the path to your existing purchase key from that directory, or its absolute path. The browser starter preview downloads work.json with a new request ID and preserves the current editor draft. Keep the same saved file for retry or receipt recovery. If your browser renamed the download, use that exact filename. The Work section updates the main submit and recovery commands for a saved filename. The same filename carries into the top-up plan linked from the Work command. To check a saved JSON file before a paid call, open the browserFieldCheckUrl from buyerGuide.request. It checks the request fields and prompt size locally using the API validator. You can also use the original file for receipt recovery. Open buyerGuide.request.browserRunUrl for the funded Work commands. In code, verify receiptClientSha256, save the client as pythonClient.downloadAs, and append the selected action's args to pythonClient.baseArgv. Check its effects before running it, then compare the returned status to successStatus and read resultField. Keep the saved brief and private key at the listed paths. To check a canonical saved brief before funding, run the complete argv from pythonClient.validateRequest without adding a key: python3 -I tesi-receipt.py --file work.json --validate Exit 0 returns request_valid, exact body and prompt bytes, the normalized requestBodySha256, and requestFingerprint in ID.SHA256 form. Keep requestFingerprint if you will check a reply ZIP later. Exit 2 returns invalid_request when the file fails its checks. A valid file can still require credits and a reachable service. The browser Work builder can copy and compare requestId.requestBodySha256 locally, including after reopening a saved brief. To make a reference from this command's JSON or a receipt, join those two fields with a period. Obtain the original reference through the same trusted channel as the brief. To exercise the API parser without a key, GET https://toolsenabled.ai/api/v1/agents/request-check?as=work The server validates a fixed sample. It does not start Work. For your own non-sensitive saved draft, the next command transmits the full request body to the validation endpoint without a key. python3 -I tesi-receipt.py --file work.json --server-check A successful result confirms the local fingerprint and gives starting credit. Direct callers can POST JSON to the same URL. Use as=ask to mirror the Ask endpoint's default mode. The explicit body mode takes precedence. To carry a successful check into paid Work, save its JSON and require it when submitting the same draft. python3 -I tesi-receipt.py --file work.json --server-check > request-check.json python3 -I tesi-receipt.py --key-file ./tesi-purchase/key.json --file work.json --submit --require-check request-check.json --no-checkout --wait 120 The client stops before connecting if the ID or normalized content changed. Direct API clients can check checkedRequestHeader in discovery and send TESI-Checked-Request with requestId, a period, and requestBodySha256. The server returns HTTP 412 before admitting a mismatched request. For the current starting credit, send only the promptBytes count to buyerGuide.request.startingCreditUrl as a GET query. The Work builder can do this directly. Compare minimumAvailablePico with balance.availablePico using integer arithmetic. Work can use more credit as it runs. The Python client can read the current starting credit directly. python3 -I tesi-receipt.py --file work.json --check-credit Supply --key-file ./tesi-purchase/key.json to compare spendable credit. The public lookup sends only promptBytes. With a key file, a separate ledger read supplies availablePico and meetsStartingCredit. Check that boolean even when the command exits 0. Work can use more credit as it runs. Use the Work or purchase flow when you are ready to proceed. Check up to 20 saved drafts in one read. python3 -I tesi-receipt.py --batch-credit work.json work-next.json The client sends ordered UTF-8 byte counts to endpoints.batchStartingCredit. It keeps request IDs, fingerprints and messages local. With an explicit --key-file ./tesi-purchase/key.json, the same read returns spendable credit and the client reports meetsStartingCredit per draft. Each comparison uses the same balance and applies to starting that draft on its own. Work can use more credit as it runs. To review a pack for that brief, run the exact argv from buyerGuide.request.pythonClient.reviewRequestPack: python3 -I tesi-receipt.py --file work.json --review-pack 2500 Specify an advertised amount in USD cents. The report compares its full prepaid credit with the current starting threshold and identifies the brief by request ID and fingerprint. It sends only the prompt byte count, uses no key and opens no Checkout. Share reviewUrl and the original brief privately. The link includes the pack amount only, and the purchaser approves payment in the browser. If that pack is unavailable, the purchaser must choose a current pack before preparing a new Checkout. A pack can cover starting credit even if the task uses more credit later. To find the smallest offered pack that covers starting credit in one free lookup: python3 -I tesi-receipt.py --file work.json --review-pack smallest The report includes the quote, the offered amounts and a purchaser review URL when a pack fits. Direct callers can add includePacks=1 to the public starting-credit GET. A null smallestEligibleAmountCents means none fits. On success, both review commands return approvalSummary as ready-to-share plain text. It contains the pack price, starting requirement and review link. In the Work builder, Check starting credit shows the qualifying pack review link. It opens in a new tab and keeps the original draft in place. Open Share a purchase approval summary to copy the amount and current starting requirement. The summary leaves out the brief and request ID. The funding section can add the full brief if you check Include current Work draft before copying its summary. For a cost example, send a GET to buyerGuide.funding.costExampleUrl with inputTokens and outputTokens. Use whole counts from 0 to 1,000,000 and at least one token. costPico is the cost of one uncached GPT-6.2 Sol call at these counts, including the current TESI usage rate. One TESI credit is 1,000,000,000,000 pico. Actual tasks can use different models and more calls. Add includePacks=1 to that same GET for packCoverage sorted by price. Each entry has amountCents, wholeReferenceCalls as an exact decimal string, and reviewUrl. Share that price-only link to open the current pack review. The browser calculator uses the same expanded quote. Checkout status is shown separately. Copy the calculator link to share the token counts. Opening it uses current rates and pack prices. Choose a pack price to open its review in a new tab. The review uses the currently offered packs. The count assumes identical uncached calls and is rounded down. Zero means the pack cannot cover a single call at those token counts. Rates: https://toolsenabled.ai/pricing/ Free verification before funding Open https://toolsenabled.ai/agents/#agent-public-check to run three public checks and download a JSON report. For a terminal, verify the downloaded client's receiptClientSha256 from discovery and run the complete buyerGuide.request.pythonClient.verifyPublic.argv: python3 -I tesi-receipt.py --verify-public The client checks the offer, the OpenAPI operation declarations and the sample ZIP checksum. It needs no key. Exit 0 returns public_checks_passed and checks. The failure report identifies the first failed check. The sample is checked as bytes and is never extracted or run by this command. These checks cover the public offer, API document and sample. Fund a key In a browser, select a pack at https://toolsenabled.ai/agents/#agent-funding. After Stripe payment settles, return in that same browser to claim and save the key. If setup is interrupted, use Resume Checkout in that browser. The browser can recover the purchase for up to 48 hours, until the purchaser confirms the key is saved. The downloadable Python 3 client handles one API purchase at a time on Linux or macOS. Save /agents/tesi-buy.py.txt as tesi-buy.py and verify buyerGuide.funding.apiPurchaseId.buyerClientSha256 before running it. To check an exact pack and get a purchaser review link without creating Checkout, run: python3 -I tesi-buy.py quote --amount-cents 1000 Use an amount advertised in GET /api/v1/agents. On pack_review_ready, share reviewUrl with the purchaser. The command uses no key or local purchase directory. If the pack is unavailable, it returns the valid current amounts for you to review. Choose an offered amount and use a new private directory for each purchase. python3 -I tesi-buy.py draft ./tesi-purchase --amount-cents 1000 python3 -I tesi-buy.py checkout ./tesi-purchase python3 -I tesi-buy.py claim ./tesi-purchase python3 -I tesi-buy.py confirm ./tesi-purchase Draft works offline. Run checkout after the purchaser approves the pack. Give the returned Checkout URL to the purchaser. Run claim after payment. It saves key.json privately. Confirm after you have verified the saved key. If a response is interrupted, repeat that step with the same directory. For API clients, with the purchaser's approval, choose amountCents from the current offer. Generate 32 random bytes with Python's secrets.token_hex(32). Save the lowercase hex as purchaseId in your private purchase JSON. POST {"amountCents":1000,"purchaseId":"<64 lowercase hex characters>"} as JSON to https://toolsenabled.ai/api/v1/agents/keys. Reuse the same body if the response is lost. The expected 402 payment_required gives checkoutUrl and sessionId. A 200 status of paid provides claimBody. A status of claimed means the key was already issued. To recover a lost key response, repeat the original claim within the recovery window. The same request can still recover a confirmed outcome after the Checkout window. A 503 checkout_reconciling means the outcome is unconfirmed. Keep the same purchase and retry it or contact support before buying again. Give checkoutUrl to the purchaser. Keep purchaseId and sessionId private. After Stripe payment settles, POST {"sessionId":"...","purchaseId":"..."} to the same endpoint. Save apiKey privately from the 201 response. If the key response is lost, repeat that claim to recover the same key with 200. Recovery lasts 48 hours from issuance or until you confirm the key is saved. Then send both IDs and "saved":true with Authorization: Bearer . HTTP 200 with status "saved" confirms recovery is closed. If you did not use purchaseId when preparing Checkout, claim with sessionId only. That legacy flow returns the key once. If you already have an issued code, POST {"giftCode":"...","preview":true} to check redeemable and creditCents, then POST {"giftCode":"..."} to redeem. Run and verify Start in a clean directory On Linux with GNU coreutils, curl and Python 3, copy this block into a shell. It verifies the downloaded client and saves a draft in tesi-ask/. To use your own question, save it as UTF-8 and run export TESI_ASK_QUESTION_FILE=question.txt before this block. The question stays local until submission. For a separate draft, run export TESI_ASK_DIR=tesi-ask-followup before this block. The default is tesi-ask. Enter the chosen directory afterward. To reuse a saved client, first run export TESI_ASK_CLIENT_FILE=tesi-ask/tesi-receipt.py. Setup checks its copy against the current published checksum. Setup saves the verified digest in tesi-receipt.sha256. Keep that file with the client. For offline setup, point to the original verified directory: export TESI_ASK_OFFLINE_FROM=tesi-ask ( set -e destination=${TESI_ASK_DIR-tesi-ask} case "$destination" in ''|.|..|*/*) echo 'TESI_ASK_DIR must be a new directory name in the current folder.' >&2 exit 1 ;; esac if [ -e "$destination" ] || [ -L "$destination" ]; then echo 'The draft directory already exists. Open it or choose a new TESI_ASK_DIR.' >&2 exit 1 fi question=${TESI_ASK_QUESTION_FILE-} if [ -n "$question" ]; then case "$question" in /*) ;; *) question="$PWD/$question" ;; esac if [ ! -f "$question" ] || [ ! -r "$question" ]; then echo 'TESI_ASK_QUESTION_FILE must name a readable text file.' >&2 exit 1 fi fi client=${TESI_ASK_CLIENT_FILE-} expected=${TESI_ASK_CLIENT_SHA256-} if [ "${TESI_ASK_OFFLINE_FROM+x}" = x ]; then if [ -z "$TESI_ASK_OFFLINE_FROM" ] || [ -n "$client" ] || [ -n "$expected" ]; then echo 'Set TESI_ASK_OFFLINE_FROM to a verified folder by itself.' >&2 exit 1 fi client="$TESI_ASK_OFFLINE_FROM/tesi-receipt.py" digest_file="$TESI_ASK_OFFLINE_FROM/tesi-receipt.sha256" if [ ! -f "$digest_file" ] || ! IFS= read -r expected < "$digest_file" || [ -z "$expected" ]; then echo 'The verified folder must contain its saved tesi-receipt.sha256.' >&2 exit 1 fi fi if [ -n "$client" ]; then case "$client" in /*) ;; *) client="$PWD/$client" ;; esac if [ ! -f "$client" ] || [ ! -r "$client" ]; then echo 'TESI_ASK_CLIENT_FILE must name a readable client file.' >&2 exit 1 fi fi if [ -n "$expected" ]; then case "$expected" in *[!0-9a-f]*) echo 'Use a trusted lowercase SHA-256 digest.' >&2; exit 1 ;; esac if [ "${#expected}" -ne 64 ] || [ -z "$client" ]; then echo 'TESI_ASK_CLIENT_SHA256 requires a trusted SHA-256 digest and TESI_ASK_CLIENT_FILE.' >&2 exit 1 fi fi stage=$(mktemp -d ./.tesi-ask.XXXXXXXX) trap 'rm -f -- "$stage/tesi-receipt.py" "$stage/ask.json" "$stage/tesi-receipt.sha256"; rmdir -- "$stage" 2>/dev/null || :' EXIT ( cd "$stage" if [ -n "$client" ]; then cp -- "$client" tesi-receipt.py else curl -fsS https://toolsenabled.ai/agents/tesi-receipt.py.txt -o tesi-receipt.py fi if [ -z "$expected" ]; then expected=$(curl -fsS https://toolsenabled.ai/api/v1/agents/quickstart | python3 -I -c 'import json, sys; print(json.load(sys.stdin)["askDraft"]["sha256"])') fi if ! python3 -I -c ' import hashlib, pathlib, sys actual = hashlib.sha256(pathlib.Path("tesi-receipt.py").read_bytes()).hexdigest() sys.exit(0 if sys.argv[1] == actual else 1) ' "$expected"; then echo 'Receipt client checksum mismatch. Use the trusted matching copy or clear the saved-client and checksum settings to download again.' >&2 exit 1 fi printf '%s\n' "$expected" > tesi-receipt.sha256 if [ -n "$question" ]; then python3 -I tesi-receipt.py --file ask.json --prepare-ask --message-stdin < "$question" else python3 -I tesi-receipt.py --file ask.json --prepare-ask fi ) mv -nT -- "$stage" "$destination" if [ -d "$stage" ]; then echo 'The draft directory already exists. Open it or choose a new TESI_ASK_DIR.' >&2 exit 1 fi trap - EXIT ) If you already have the client, skip the setup block. For a first Ask, save a recoverable sample locally without a key or network: python3 -I tesi-receipt.py --file ask.json --prepare-ask Example question for an unsent draft: Write a two-line handoff for the next shift. We imported 48 of 51 records. Three lacked supplier IDs. The report needs all 51. What can we publish now, and what should we check next? Illustrative reply: Hold the report until all 51 records are present. Fill in the three missing supplier IDs, retry those records, and confirm the import count reaches 51. Quickstart JSON exposes the verified client download and local argv in askDraft. To prepare your own question directly, save it as UTF-8 in question.txt (up to 500,000 bytes). Use this in place of the sample preparation command: python3 -I tesi-receipt.py --file ask.json --prepare-ask --message-stdin < question.txt If ask.json already exists, the command preserves it. Choose a new filename and use that filename for later checks and receipt recovery. Keep ask.json. If you want a different question, edit its message before the first submission. To check the minimum balance for your question: python3 -I tesi-receipt.py --file ask.json --check-credit This free lookup sends only the question’s byte count. minimumAvailableCredits gives the minimum in TESI credits as an exact decimal string. Final usage can be higher. If you are buying a key for this Ask, find the smallest advertised pack that covers its starting balance: python3 -I tesi-receipt.py --file ask.json --review-pack smallest Quickstart JSON lists the command and result fields in askPackReview. Open reviewUrl after request_pack_review_ready. The approvalSummary includes the saved request ID. This command needs no key and does not prepare Checkout. If it reports no_pack_covers_starting_credit, the current packs cannot cover the starting balance for this draft. Already have the buyer client’s key file? Compare its spendable balance with the starting requirement for free. From tesi-ask/, use the following assignment if the buyer saved its key in the parent directory: TESI_KEY_FILE=../tesi-purchase/key.json Use the actual key path if it lives elsewhere. If TESI_KEY_FILE is unset, these commands use ./tesi-purchase/key.json. Keep the same key for recovery. Then check the funded balance: python3 -I tesi-receipt.py --key-file "${TESI_KEY_FILE:-./tesi-purchase/key.json}" --file ask.json --check-credit Read the JSON boolean meetsStartingCredit. true means the balance covers the minimum at check time. If the lookup fails, try the check again. If the balance falls short, plan a top-up with the same key and saved Ask: python3 -I tesi-receipt.py --key-file "${TESI_KEY_FILE:-./tesi-purchase/key.json}" --file ask.json --plan-topup This read-only command checks the original receipt first. A pending payment returns topup_reconcile_first. A suggested pack appears in recommendedAmountCents when an offered pack covers the gap and no payment is pending. When ready, use the funded key to send the saved question once: python3 -I tesi-receipt.py --key-file "${TESI_KEY_FILE:-./tesi-purchase/key.json}" --file ask.json --submit --no-checkout --wait 120 Expect 42 for the default arithmetic question. To recover a missing reply, use the same file: python3 -I tesi-receipt.py --key-file "${TESI_KEY_FILE:-./tesi-purchase/key.json}" --file ask.json --wait 120 If you saved a browser-issued key in a secret store, load it as TESI_API_KEY and use these commands in the same shell. A plain --check-credit remains anonymous. --compare-key-balance explicitly reads the spendable balance for the saved key and the starting credit in one read. The request carries the prompt byte count. Quickstart JSON lists these commands and their effects in askBrowserKey. If the client returns nextAction: restore_original_key, reload the original key from keySource (TESI_API_KEY or the explicit --key-file). Keep the original draft and request ID. Once access is restored, recover the reply or check the balance again. If the original key still fails, contact support@toolsenabled.ai with the request ID and HTTP status. Keep the bearer key private. Check the spendable balance for this draft. python3 -I tesi-receipt.py --file ask.json --check-credit --compare-key-balance If the balance falls short, review a same-key top-up. python3 -I tesi-receipt.py --file ask.json --plan-topup After payment, refresh the original key and check the saved Ask: python3 -I tesi-receipt.py --file ask.json --check-credit --compare-key-balance --refresh A true meetsStartingCredit means the current spendable balance covers the starting minimum. If false, check settlement before starting another Checkout. When ready, submit once using prepaid credit. python3 -I tesi-receipt.py --file ask.json --submit --no-checkout --wait 120 Recover with the same key and unchanged brief. python3 -I tesi-receipt.py --file ask.json --wait 120 Keep the Ask reply for another tool Save the original Ask, verified reply and receipt in a new ZIP: python3 -I tesi-receipt.py --key-file "${TESI_KEY_FILE:-./tesi-purchase/key.json}" --file ask.json --wait 120 --reply-bundle ask-reply.zip Share the ZIP through a trusted channel. It contains the full saved Ask and reply. The receiving agent can check the ZIP offline without opening it: python3 -I tesi-receipt.py --verify-reply-bundle ask-reply.zip Expect reply_bundle_verified. The included receipt records checksums. Quickstart JSON lists both ZIP commands in askReplyBundle. For individual files, Quickstart JSON lists the exact arguments and expected statuses in askReply. For scripts, save export stdout as askReply.export.metadataFile only after the client exits successfully and returns its reply_saved status. From the same directory, use your original draft and key to read the reply. The block saves ask-reply.md and ask-receipt.json in two available filenames. ( set -C if [ -e ask-receipt.json ] || [ -L ask-receipt.json ]; then printf '%s\n' 'ask-receipt.json already exists.' >&2 exit 1 fi receipt=$(python3 -I tesi-receipt.py --key-file "${TESI_KEY_FILE:-./tesi-purchase/key.json}" \ --file ask.json --reply-file ask-reply.md --wait 120) || { printf '%s\n' "$receipt" >&2 exit 1 } printf '%s\n' "$receipt" > ask-receipt.json ) Keep ask.json, ask-reply.md and ask-receipt.json together. Verify offline with no key and expect saved_reply_verified: python3 -I tesi-receipt.py --file ask.json --reply-file ask-reply.md --verify-reply ask-receipt.json Choose a Work starter by its deliverable. Each row shows the ID, suggested effort, task, expected output and TESI credits needed to start the unedited brief. Final usage varies. Check the starting balance again after editing the brief. curl -fsS https://toolsenabled.ai/api/v1/agents/quickstart | jq -r '.workStarters[] | [.id, .suggestedEffort, .title, .expectedOutput, (.minimumAvailablePico | tonumber / 1e12)] | @tsv' Quickstart JSON lists this command, its effects and result fields in workShortlist. To shortlist examples for an existing key, use the receipt client: python3 -I tesi-receipt.py --key-file ./tesi-purchase/key.json --shortlist-work Read matches. Each item fits the same current spendable starting balance. Review its suggestedEffort and acceptanceChecks before saving the draft. Rows also include available sampleDeliverable, referenceFiles, referenceCheck and acceptanceFixture entries. Use their URLs and SHA-256 values to inspect the sample or verify downloaded reference files. Usage can rise after work starts. nearestUnaffordableStarter, when present, shows the smallest starting shortfall in TESI credits and links to the brief for free editing. When no item fits, sampleProject links to a free example. Use the path to your existing key file. To save any listed starter, append its prepareArgs to python3 -I tesi-receipt.py without key arguments. For a CSV match, the command is: python3 -I tesi-receipt.py --file csv.json --prepare-work csv The saved brief is free to edit. Preparing it preserves existing files. To preview before funding, enter a planned starting balance in TESI credits: python3 -I tesi-receipt.py --shortlist-work --budget-credits 0.001 This reads the public catalog. balanceSource is planned_budget for this command and key_balance for the saved-key command. If you already have a balance snapshot, replace 790000000 below with balance.availablePico from that key's balance response. The comparison stays on your machine. Each example is considered separately at its starting balance. Open browserPreviewUrl to edit a matching brief for free. If none fit, stdout contains []. On stderr, the first line links to the free sample preview. The second line is JSON with URLs and SHA-256 hashes for the ZIP, replay script and expected report. curl -fsS https://toolsenabled.ai/api/v1/agents/quickstart | python3 -I -c ' import json, sys available = int(sys.argv[1]) offer = json.load(sys.stdin) starters = offer["workStarters"] matches = [ {"id": row["id"], "deliverable": row["expectedOutput"], "minimumAvailablePico": row["minimumAvailablePico"], "browserPreviewUrl": row["browserPreviewUrl"]} for row in starters if int(row["minimumAvailablePico"]) <= available ] print(json.dumps(matches, indent=2)) if not matches: print("Try the newsletter sample for free (no key needed): " "https://toolsenabled.ai/agents/#newsletter-sample-preview", file=sys.stderr) print(json.dumps(offer["sampleProject"]), file=sys.stderr) ' 790000000 For a Markdown sample of the supplier specification, select merge-scope in the command below. To inspect the docs review, select docs. Each provides a Markdown download URL and SHA-256 from the compact offer: curl -fsS https://toolsenabled.ai/api/v1/agents/quickstart | jq -e '.workStarters[] | select(.id == "docs") | .sampleDeliverable' Use a listed ID to prepare a local draft. For example: python3 -I tesi-receipt.py --file work.json --prepare-work csv This reads the public offer without a key and saves the same brief and acceptance checks as the browser. Edit or review the file before the first funded submission. Already have work.json? Keep it for receipt recovery. To switch to a different task, prepare the docs review beside it using the same client: python3 -I tesi-receipt.py --file docs-review.json --prepare-work docs python3 -I tesi-receipt.py --file docs-review.json --validate Preparation reads the public offer. Validation runs offline. Both are free. Use docs-review.json for the new task when you choose to submit it. For a new run based on a brief you already refined, copy it locally: python3 -I tesi-receipt.py --file work-next.json --copy-brief work.json This works for Ask and Work. It preserves the message, mode and effort and gives the new file its own request ID. The JSON reports requestId and sourceRequestId. Use a fresh destination. The copy uses no key or network. Review it and use the new filename when you explicitly submit. Recover an earlier run with its original file. If you saved the key with the Python buyer client, you can submit the saved work.json directly with the Python receipt client: python3 -I tesi-receipt.py --key-file ./tesi-purchase/key.json --file work.json --submit --no-checkout --wait 120 This checks the original receipt before sending one paid request. If a receipt exists, it verifies the saved brief and recovers its reply. After a lost response it only reads the original receipt. Keep the same file when recovering. Without --submit, the client only reads the receipt. This command uses --no-checkout to keep funding separate. On insufficient credit, payment.status is manual_topup_required and payment.availablePico is the balance. payment.minimumAvailablePico gives the starting requirement when the original receipt is missing. This mode creates no Checkout. The client checks discovery for support before sending a paid request. In submit output, nextAction=plan_same_key_topup means the confirmed shortfall can be checked with --plan-topup using the same file and key. When nextAction=recover_original_receipt, keep the same file and key and repeat the receipt lookup without --submit. A missing receipt leaves the charge unknown. If retryAfterSeconds is present, wait that long before checking. Both actions read state without submitting another request or opening a Checkout. For direct HTTP, send TESI-Topup-Mode: manual on /chat or /work after discovery advertises buyerGuide.request.manualTopupHeader. If you decide to fund the key, use the separate /topup endpoint described below. If you explicitly choose pythonClient.actions.submitWork from the full offer, it can instead prepare a top-up. If status is payment_required and receiptStatus is receipt_missing, share payment.checkoutUrl privately with the purchaser when present. After Checkout, refresh the balance. Also refresh a pending or paid top-up before buying again. python3 -I tesi-receipt.py --key-file ./tesi-purchase/key.json --credits --refresh This checks up to five existing top-ups on the key and opens no Checkout. Once credit is available, use the same saved brief and the explicit --submit command for a request with receipt_missing. The client checks its receipt first. If that receipt is processing or outcome_unknown, keep looking up that original ID. If status is submission_unknown, keep the ID and use the receipt and support guidance below. Direct HTTP with a saved brief Prepare ask.json or work.json as shown above. Keep the file, including its requestId, across restarts. Use the matching endpoint for its mode: ask POST https://toolsenabled.ai/api/v1/agents/chat work POST https://toolsenabled.ai/api/v1/agents/work Both spend prepaid credits. Send the saved file bytes as the JSON body with Content-Type: application/json and your funded key as a Bearer credential. To submit the prepared Ask once, use curl and jq with the saved buyer key. The block confirms manual top-up support before posting. An insufficient balance returns HTTP 402 without creating Checkout. Set TESI_KEY_FILE if your key is elsewhere. ( set -e offer=$(curl --disable -fsS 'https://toolsenabled.ai/api/v1/agents') printf '%s\n' "$offer" | jq -e ' .available == true and .buyerGuide.request.manualTopupHeader == {name:"TESI-Topup-Mode",value:"manual"} ' >/dev/null key=$(jq -er '.apiKey | select(type == "string" and length > 0)' \ "${TESI_KEY_FILE:-./tesi-purchase/key.json}") printf 'Authorization: Bearer %s\n' "$key" | curl --disable --fail-with-body -sS 'https://toolsenabled.ai/api/v1/agents/chat' \ --header @- --header 'Content-Type: application/json' \ --header 'TESI-Topup-Mode: manual' --data-binary @ask.json ) For the sample question, expect 42 in the reply. Check balance.availablePico. If the connection drops, use the original Ask file for a single curl GET. Use the same key path as the submission. A missing receipt leaves the outcome unknown. If it is processing, repeat the same lookup. ( set -e id=$(jq -ers 'select(length == 1) | .[0] | .requestId | strings | select(test("\\Amw_[a-f0-9]{32}\\z"))' ask.json) key=$(jq -ers 'select(length == 1) | .[0] | .apiKey' \ "${TESI_KEY_FILE:-./tesi-purchase/key.json}") printf '%s\n' "$key" | jq -eRs 'test("\\Atesi_ak_[A-Za-z0-9_-]{20,80}\\n\\z")' >/dev/null printf 'Authorization: Bearer %s\n' "$key" | curl --disable --fail-with-body -sS --header @- \ "https://toolsenabled.ai/api/v1/agents/turns/$id" ) For a bounded wait and a check against the original request body, use: python3 -I tesi-receipt.py --key-file "${TESI_KEY_FILE:-./tesi-purchase/key.json}" --file ask.json --wait 120 For a Work request, use work.json with the Work endpoint and check its reply against the acceptance checks in that file. Use --file work.json for recovery. For the webhook starter, fetch the ordered synthetic acceptance cases before purchase: curl -fsS https://toolsenabled.ai/agents/examples/webhook-cases.json In either API catalog, the webhook starter’s acceptanceFixture gives the download URL and SHA-256. Hash the downloaded bytes before parsing the JSON. Run them against the delivered localhost service using an empty test database. The Work builder includes a webhook starter with testable outputs. Download work.json before sending so you can open it again at the receipt helper: https://toolsenabled.ai/agents/#agent-saved-receipt It reads the original request ID locally and prepares a GET command. Rate limits Discovery reports each limit, windowSec and scope (ip or key). Ask and Work share both turn limits. Explicit Checkout creation shares one limit across browser funding, new keys and top-ups. On HTTP 429, wait the whole seconds from Retry-After. A timeout has an uncertain outcome. Check the original Checkout or Work receipt before starting another purchase or task. Balance and recovery GET https://toolsenabled.ai/api/v1/agents/balance with the same bearer key. Use balance.usedPico for cumulative settled debits and balance.availablePico for spendable credit. The usage object summarizes settled reservations on the same key within a time window. Concurrent requests can contribute to the same observation. Read usage.requestCost before attributing a charge. For an individual request, the current value is unavailable. GET https://toolsenabled.ai/api/v1/agents/usage with the same bearer key to list exact settled debits and the ledger balance without calling Stripe or starting work. With a saved buyer key, the receipt client reads it directly: python3 -I tesi-receipt.py --key-file ./tesi-purchase/key.json --credits Use balance.availablePico to check what you can spend. This command reads one page without initiating a top-up. For older charges, append --cursor . Store chargeId to deduplicate charges. For older entries, send ?cursor= until nextCursor is null. Read the first page again for newly settled charges. Each debitPico is an exact decimal string. For an exact total of settled debits on this key, run: python3 -I tesi-receipt.py --key-file ./tesi-purchase/key.json --credits --window-hours 24 The same API accepts ?windowHours=24 without cursor or limit. Use 1–744 hours. debitPico is the key-wide settled total from sinceAt through observedAt with both bounds inclusive in Unix milliseconds. chargeCount counts settled debits in that window. If the window is too large, use a shorter one or list the individual entries. Before adding credits, check the original saved request and its key: python3 -I tesi-receipt.py --key-file ./tesi-purchase/key.json --file work.json --plan-topup Recorded requests return their receipt state. Keep the same file and recover the original reply. Otherwise the plan checks the current spendable balance. starting_credit_ready means spendable credit covers the starting requirement. heldPico is credit reserved for work and already excluded from availablePico. topup_reconcile_first means an earlier top-up needs attention. unsettledTopups counts locally recorded orders by state: creating is an order whose Checkout is unconfirmed, open is awaiting payment in Checkout, and pending is awaiting confirmation. creditIfSettledPico is the total those orders could add after recorded refunds. Only availablePico can fund new work. Use --credits --refresh after a lost top-up response, then check the plan again. Refresh can link an existing Checkout to the original order, apply a confirmed payment or confirm that Checkout expired. If an order stays creating, keep the original details and contact support@toolsenabled.ai before buying again. topup_plan_ready gives recommendedAmountCents for the exact current shortfall. Share approvalSummary with the purchaser to request approval for that pack. After approval, prepare Checkout on the original key using that amount. Set APPROVED_TOPUP_CENTS to the exact recommendedAmountCents the purchaser approved. Load the original TESI_API_KEY from your secret store. With curl and jq, open Checkout and share the returned Stripe link privately: ( set +x set -e amount="${APPROVED_TOPUP_CENTS:?Set the purchaser-approved amount in cents}" key="${TESI_API_KEY:?Load the original key from your secret store}" printf '%s\n' "$key" | jq -eRs 'test("\\Atesi_ak_[A-Za-z0-9_-]{20,80}\\n\\z")' >/dev/null body=$(jq -ecn --arg amount "$amount" ' $amount | select(test("\\A[1-9][0-9]{2,6}\\z")) | tonumber | select(. <= 1000000) | {amountCents: .} ') response=$(printf 'Authorization: Bearer %s\n' "$key" | curl --disable --fail-with-body --silent --show-error --max-time 20 \ --header @- --header 'Content-Type: application/json' --data-binary "$body" \ 'https://toolsenabled.ai/api/v1/agents/topup') printf '%s\n' "$response" | jq -er --argjson approved "$amount" ' select(.status == "open" and .amountCents == $approved and .currency == "usd") | .checkoutUrl | strings | select(test("\\Ahttps://checkout\\.stripe\\.com/[^[:space:]]+\\z")) ' ) If the link is missing, look up the same amount with the original key: python3 -I tesi-receipt.py --recover-topup "$APPROVED_TOPUP_CENTS" no_pack_covers_shortfall means no listed pack covers it in one purchase. The plan uses GETs and opens no Checkout. A direct caller can GET https://toolsenabled.ai/api/v1/agents/topup?promptBytes=300 with the same bearer key after checking its original receipt. If you only lost the URL, replace 1000 with the amount in cents you originally requested. python3 -I tesi-receipt.py --key-file ./tesi-purchase/key.json --recover-topup 1000 Or GET /api/v1/agents/topup/checkout?amountCents=1000 with the same bearer key. The lookup creates no Checkout and applies no credit. Share the link privately with the purchaser when status is checkout_open. For a pending or paid response, use --credits --refresh to see any available credit. If there is no match, refresh credits before deciding on another purchase. On 402 with manual_topup_required, choose an advertised pack and POST {"amountCents":1000} (or another advertised amount) with the same bearer key to https://toolsenabled.ai/api/v1/agents/topup when you want to fund it. Present the Checkout URL to the purchaser and keep the sessionId private. In automatic mode, the 402 may already supply a Checkout URL or session. The same key and pack reuse a pending or open Checkout. If the response reports paid or pending without checkoutUrl, use that sessionId to reconcile before offering another purchase. After payment, POST {"sessionId":"..."} with the same bearer key to https://toolsenabled.ai/api/v1/agents/topup. Check 200, status paid and balance. A 402 payment_required means the payment is not yet settled. Check the same session again after payment. After a timeout or HTTP 409 agent_request_recorded, use the original key and GET https://toolsenabled.ai/api/v1/agents/turns/{requestId}. It starts no work. HTTP 409 agent_request_conflict means the ID already belongs to a different request body. Recover using the untouched original JSON and the same key. Resolve the original receipt before starting revised work with a new ID. A result_ready receipt has the saved reply, including verified replies recovered after an interrupted response. Check the same receipt again if it says processing or outcome_unknown. If it stays unknown or returns HTTP 404, contact support@toolsenabled.ai with the request ID and time before submitting a new request. A missing receipt can also refer to work sent before receipts were available. Balance is account-wide and does not establish delivery of a particular result. Save the Python 3 receipt reader as tesi-receipt.py from the discovery field buyerGuide.request.receiptClientUrl. Verify receiptClientSha256 against the download. Use --key-file with the buyer client's private key.json, or load the original key from your secret store into TESI_API_KEY. Run either command from your private workspace. python3 tesi-receipt.py --file work.json python3 tesi-receipt.py --id ORIGINAL_REQUEST_ID --wait 120 With the full saved brief, --file verifies the request fingerprint before returning the reply. receipt_request_mismatch means the receipt's fingerprint is missing or differs. The nextAction recover_with_original_brief means to rerun the read with the untouched original saved brief. If only the ID survives, --id reads the receipt without comparing a request fingerprint. After a POST returns 409, the client only reads the original receipt. If it still cannot confirm the receipt, submission_unknown includes the next read-only action recover_original_receipt. If you lost the original ID, run python3 tesi-receipt.py --receipts with the same key. The results contain recent recorded Ask and Work IDs, status, timestamps and request fingerprints. The list reads no prompts or replies. Use --receipts --mode work --limit 5 to find the latest Work. Add --delivery unresolved for processing and outcome_unknown, or --delivery ready for saved replies. If nextCursor is non-null, add --cursor NEXT_CURSOR to the same list command for older requests. Open a matching ID with --id. Direct callers can use GET https://toolsenabled.ai/api/v1/agents/turns with the same bearer key. The query parameters are mode, delivery, limit and cursor. The list starts no Work and opens no Checkout. To capture status and timestamps without printing the reply: python3 -I tesi-receipt.py --key-file ./tesi-purchase/key.json --file work.json --metadata-only Use the original saved file for the request fingerprint check. This performs the same authenticated read, including reply verification when a checksum is present. It sends no new Work and omits the reply from terminal output. receivedAtUtc is when TESI recorded the request. resultSavedAtUtc appears when TESI saved the reply, which can happen during recovery. Raw timestamps are Unix milliseconds. Use the saved time as receipt evidence. To hand off the original brief, exact reply and receipt together: python3 -I tesi-receipt.py --key-file ./tesi-purchase/key.json --file work.json --wait 120 --reply-bundle work-reply.zip On reply_bundle_saved the ZIP contains request.json, reply.md and reply-receipt.json. Both the brief and the reply are private contents. Share the ZIP through a trusted channel. The receipt is a checksum record. Verify the ZIP directly without a key or extraction: python3 -I tesi-receipt.py --verify-reply-bundle work-reply.zip A reply_bundle_verified result confirms the included request fingerprint and reply checksum match the included receipt. To check that it is for the request you expected, append --expect-request-fingerprint ID.SHA256 using requestFingerprint from your original draft's --validate output or the Work builder fingerprint. Keep that fingerprint independently of the ZIP. This check also works with ask-reply.zip. A successful match sets expectedRequestMatched to true. A mismatch returns bundle_request_mismatch. To hand off the exact reply to another tool, save it to a new file: python3 tesi-receipt.py --file work.json --wait 120 --reply-file reply.md This reads the original receipt, checks the saved brief fingerprint and verifies replySha256 against the UTF-8 reply bytes. It preserves whitespace and line endings. On success, the JSON reports reply_saved, replyFile and replySha256. The reply text goes only to the file. If the file exists or the receipt has no matching checksum, the client stops without writing it. Keep the export's JSON as well if another agent will verify this handoff. With fresh output filenames in a POSIX shell: (set -C; python3 -I tesi-receipt.py --file work.json --wait 120 --reply-file reply.md > reply-receipt.json) Share the original brief, the reply and the JSON from a successful export through a trusted channel. The export JSON records checksums and has no signature. The recipient can check the files without credentials or a network request: python3 -I tesi-receipt.py --file work.json --reply-file reply.md --verify-reply reply-receipt.json The JSON reports saved_reply_verified with the request and reply fingerprints. It returns status reply_digest_mismatch if the reply bytes changed and receipt_request_mismatch if the brief belongs to a different request or was edited. The reader defaults to one GET on the original request. --wait polls the same receipt through temporary connection and service failures within the polling window. It honors a numerical Retry-After. If the window ends while the service is unavailable, read_unavailable includes retryAfterSeconds for a temporary error. Run the same read-only command again after that delay. Exit 0 means the reply is returned or saved as requested. Exit 1 means the receipt is pending, unknown, missing or rate limited, or the request needs payment. Exit 2 indicates invalid input, a rejected key or an unreadable response. For a missing or unknown receipt, keep the original ID and use the support guidance above. Inspect a sample before funding https://toolsenabled.ai/agents/examples/newsletter.zip SHA-256: 561d8335e9924808711f6af4d69616aaeef0ba3bb9898906eb4534c1a7307d21 The sample uses simulated billing and a local mailbox. Get the ZIP, expected report and replay script URLs with their checksums in one anonymous read: curl -fsS https://toolsenabled.ai/api/v1/agents/quickstart | jq -e '.sampleProject' The proof.url field links to the expected report. proof.replayUrl links to the script. Verify both downloads against the advertised SHA-256 values. Save the script as newsletter-replay.py alongside newsletter.zip and run python3 -I -B newsletter-replay.py newsletter.zip to reproduce the report. Run this in a Linux shell with curl, sha256sum, Python 3 and jq. It prints a new working directory, checks all three downloads and prints true when the replay matches the expected report. ( set -e cd "$(mktemp -d)" pwd base=https://toolsenabled.ai/agents/examples curl -fsS "$base/newsletter.zip" -o newsletter.zip curl -fsS "$base/newsletter-replay.py.txt" -o newsletter-replay.py curl -fsS "$base/newsletter-proof.json" -o expected.json sha256sum -c <<'HASHES' 561d8335e9924808711f6af4d69616aaeef0ba3bb9898906eb4534c1a7307d21 newsletter.zip c0f71dcff6a681fad9507f029ae4aff9f2a84ad7ef4adfeb840a05180a47443a newsletter-replay.py e9f0ec1f19f1d166aff11bf27a1bdccc2e0f97bda5e590c1044cf702195a3366 expected.json HASHES python3 -I -B newsletter-replay.py newsletter.zip > actual.json jq -e -s 'length == 2 and .[0] == .[1]' expected.json actual.json ) OpenAPI: https://toolsenabled.ai/agents/openapi.yaml Full API examples: https://toolsenabled.ai/llms-full.txt Terms: https://toolsenabled.ai/free-and-agent-terms/