computeruse by Rerato

Connect · Quickstart

Run your first licensed session

Five minutes. Your agent changes a plan on Demo Fiber, our test ISP site, under a license that caps spending at $50 a month and blocks add-ons. It never sees the password, and you get a receipt checked against the site's own confirmation.

1 Get a sandbox key

While Connect is in early access we issue keys to agent builders by hand. Ask for one here; Anmol replies himself. A key looks like cu_live_ followed by 43 characters. Keep it on your server, never in a browser or an app bundle.

2 Run a session

# 1. A test license for Demo Fiber: change the plan, up to $50 a month, never "add a line"
curl -s https://computeruse.si/api/v1/sandbox/licenses \
  -H "authorization: Bearer $COMPUTERUSE_API_KEY" \
  -H "content-type: application/json" \
  -d '{"maxAmountMinor": 5000}' > license.json

# 2. Open a session (same idempotency key = same session, so retries are safe)
curl -s https://computeruse.si/api/v1/sessions \
  -H "authorization: Bearer $COMPUTERUSE_API_KEY" \
  -H "content-type: application/json" \
  -H "idempotency-key: my-first-run" \
  -d "{\"signedLicense\": $(jq .signedLicense license.json), \"task\": \"Lower my internet bill. Switch me to a plan under \$50 a month.\"}"

# 3. Poll every few seconds until the state is final (usually one to three minutes)
curl -s https://computeruse.si/api/v1/sessions/SESSION_ID \
  -H "authorization: Bearer $COMPUTERUSE_API_KEY"

Any HTTP client works. Keep the key on your server.

3 Or use the TypeScript SDK

The SDK, @computeruse/connect, has no dependencies and runs in Node 18+, Bun, Deno and edge runtimes. It goes to npm soon; early-access builders get it with their key.

import { Computeruse } from "@computeruse/connect";

const cu = new Computeruse({ apiKey: process.env.COMPUTERUSE_API_KEY! });

// A test license for Demo Fiber, our test ISP site:
// change the plan, up to $50 a month, never "add a line".
const license = await cu.sandbox.license({ maxAmountMinor: 5000 });

const session = await cu.sessions.run({
  signedLicense: license,
  task: "Lower my internet bill. Switch me to a plan under $50 a month.",
});

console.log(session.state);            // "completed"
console.log(session.receipt?.summary); // "Completed. Confirmation 52220."

run opens the session and waits for it, usually one to three minutes. It sends an idempotency key, so a dropped connection never starts a second session.

4 What just happened

  1. The license was checked. Its signature, its time window, that it was issued to your agent, and that it only covers Demo Fiber.
  2. We signed in for your agent. The login came out of the vault inside an isolated browser opened for this session alone. Your agent and your servers never saw it.
  3. Every step was checked in code. Before each click we read the real label and the real total from the page, not what the agent claims, and compare them with the license. Text on the page cannot change the rules.
  4. Blocked steps come back with a reason. For example, the $89 plan is refused before checkout is submitted, and the agent picks the $49 plan instead.
  5. The receipt is the site's word, not the agent's. We read the confirmation page, keep its reference number and a hash of what it said, and record every blocked step.

5 Read the receipt

{
  "id": "5c720a57-3b05-484e-be58-5e328246012e",
  "state": "completed",
  "receipt": {
    "state": "completed",
    "withinLimits": true,
    "summary": "Completed. Confirmation 52220.",
    "policyEvents": [
      { "outcome": "deny", "rule": "spend_cap",
        "reason": "USD 89.00 is over the USD 50.00 limit." }
    ],
    "evidence": {
      "source": "page",
      "reference": "52220",
      "facts": { "newPlan": "Fiber 300", "newMonthlyTotal": 49 },
      "contentHash": "9f1c4e…"
    }
  }
}

Abbreviated. evidence appears only when the site itself confirmed the change. A session that ends outcome_unknown submitted something but saw no confirmation: check the account before trying again, never retry it blindly.

Reference

CallDoes
POST /v1/sandbox/licensesA test license. Options: resource (res_demo_isp, the default, or res_demo_revenue), decisionPoints, maxAmountMinor (cents; up to 20000 on Demo Fiber, 500000 on Demo Revenue), blockedActions, minutes (5 to 60), agentId.
POST /v1/sessionsOpens a session for { signedLicense, task }. Returns 202 with the id. Send Idempotency-Key to make retries safe.
GET /v1/sessions/:idState, and the receipt once there is one. Only the builder that opened a session can read it.
Everything else, including logins, approvals, step mode and webhooks: API reference.
StateMeans
queued, runningIn progress.
completedThe site confirmed the change. The receipt has its reference.
no_changeNothing was submitted, usually because the license blocked what the task asked for.
outcome_unknownSomething was submitted but no confirmation appeared. Check the account; do not retry blindly.
failedThe session could not run. Nothing was submitted by it.

Going live

Sandbox licenses only work on our test sites. Real licenses come from the businesses you serve: you store the delegate login they give you, send them an approval link, and they approve the exact limits. The whole flow, including a pause for a yes before Submit, runs today on Demo Revenue, our test state tax portal. Read the state tax portal guide.

Docs: Quickstart · State tax portals · API reference · Security