> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oneshotagent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Compute

> Create a compute goal that the orchestrator carries out in multiple steps.

![](https://mintcdn.com/freebutter/jPFJoUgC4P5j3KGx/images/objects/compute.webp?fit=max\&auto=format\&n=jPFJoUgC4P5j3KGx\&q=85\&s=6d7949b54adc1877bc3381ce49bbbfba)

One x402 deposit creates the goal; unspent budget returns as credits, with one receipt.

## Request body

**objective** `string` *required*

Natural language, 10 to 10,000 characters.

**params** `object`

Document sets: `document_extraction` ([Document Extraction](https://docs.oneshotagent.com/api-reference/compute/document-extraction)).

**budget\_usdc** `number`

Deposited as given; omitted, estimated. Outside the limits on [Pricing](https://docs.oneshotagent.com/pricing.md#compute): `400 budget_too_low` or `budget_too_high`; enterprise accounts can request a higher maximum. Ignored for recurring goals.

**purchase\_limit\_usdc** `number`

Most per purchase, [all in](https://docs.oneshotagent.com/tools-and-goals.md#goals-that-buy).

**deadline** `string`

ISO 8601. After it nothing new starts, the [done-check](#param-done-check) runs once more and, unmet, the goal fails with `end_reason: deadline_passed`. Running work is not cancelled.

**done\_check** `object`

Kinds:

```jsonc theme={null}
{"kind": "count", "of": "emails", "status": "delivered", "at_least": 250}      // status: sent (default), delivered, opened
{"kind": "count", "of": "events", "event_type": "email_reply", "at_least": 11} // email_reply, sms_reply, voice_completed, task_completed, task_failed
{"kind": "count", "of": "tasks", "tool": "voice", "at_least": 3}               // status: completed (default) or failed
{"kind": "tool_result", "tool": "verify_email", "path": "result.status", "equals": "valid"}  // or "at_least": <number>
{"kind": "cases", "finished_states": ["merged", "blocked"], "owner_required_for": ["blocked"], "min_cases": 200}
{"kind": "owner"}                                                                // you confirm
```

`tool_result` checks only the tool's latest completed result, at a dot path. `cases` ([Goal Cases](https://docs.oneshotagent.com/api-reference/compute/cases.md)) needs a one-off goal; others get `invalid_request`. Three unmet attempts fail the goal with `end_reason: check_failed`. Omitted, the quote's proposal applies; with none, the goal waits in `awaiting_confirmation` for [`POST /v1/compute/{goal_id}/respond`](https://docs.oneshotagent.com/api-reference/compute/respond). Unknown kind: `400`.

**scope** `object`

Your reading of the goal, priced in code.

```jsonc theme={null}
{                                                                       // omitted, the quote proposes one
  "unit": { "name": "a carrier invoice", "starts_on": "list" },        // starts_on: list, event, schedule, once
  "per_unit": {
    "uses": [{ "tool": "email", "qty": 1, "max_attempts": 3, "drivers": { "recipients": 2 } }],
    "step_allowance": 10,
    "done": ["paid"]                                                    // case states that finish a unit
  },
  "overhead": { "uses": [], "step_allowance": 2 },
  "volume": { "kind": "list", "count": 40 },                            // or {"kind": "open"}
  "unpriced": []
}
```

See [Drivers and requirements](https://docs.oneshotagent.com/sdk/scope-drivers.md).

**approvals** `object`

A call costing more than `spend_over_usdc`, or of a tool in `tools`, waits for your approval (a `human_approval` task) before anything is reserved or spent. An approval covers one call: same tool and params, at most the approved amount.

**egress\_allowlist** `string[]`

Hosts the goal's sandboxes may reach: [Sandbox egress](https://docs.oneshotagent.com/sdk/sandbox-egress.md).

**soul\_slug** `string`

Soul.Markets slug.

**soul\_service\_slug** `string`

A service of that soul.

**schedule** `object`

Recurring: `cron` (required, UTC; runs at least 15 minutes apart), `budget_per_run` (required, USDC), `max_runs`. Deposit: `budget_per_run` times the runs in the next 28 days (capped by `max_runs`, at least 1). The first run starts at the next cron tick; the goal completes at `max_runs` or when the budget drops below `budget_per_run`.

<Snippet file="audit-context-params.mdx" />

## Quote response (402)

`context.scope` and `context.done_check` bind the goal (`null`: you confirm). `context.price`: unit, overhead, total or units covered, unpriced, unmeasured, hires, purchases. `context.requirements`: [specialists and accounts](https://docs.oneshotagent.com/sdk/scope-drivers.md#account-requirements). `context.total_budget` subtracts `context.credits_applied` (present only above zero); the goal gets the full budget. Expiry: 60 minutes.

`422 scope_unreadable`: `missing_fields`, no quote.

## Execution response (202)

`goal_id`, `request_id`, `status` (`active`/[`awaiting_connection`](https://docs.oneshotagent.com/api-reference/compute/status#connection-holds)/[`awaiting_setup`](https://docs.oneshotagent.com/api-reference/compute/status#setup-holds)), `goal.objective`, `goal.budget_usdc`, `goal.deadline` and, for recurring goals, `goal.schedule_cron`, `budget_per_run`, `max_runs`, `next_run_at`. No receipt at creation.

```bash cURL (Get Quote) theme={null}
curl -X POST https://win.oneshotagent.com/v1/compute \
  -H "Content-Type: application/json" \
  -H "X-Agent-ID: 0xYourWalletAddress" \
  -d '{
    "objective": "Research the top 10 AI agent frameworks, build a comparison landing page with pros/cons for each, and email the report to team@acme.com",
    "params": {
      "focus_areas": ["pricing", "integrations", "developer experience"],
      "tone": "professional"
    }
  }'
```

```typescript SDK theme={null}
import { OneShot } from "@oneshot-agent/sdk";

const agent = new OneShot({ privateKey: process.env.AGENT_PRIVATE_KEY });

const goal = await agent.compute({
  objective: "Research the top 10 AI agent frameworks, build a comparison landing page with pros/cons for each, and email the report to team@acme.com",
  params: {
    focus_areas: ["pricing", "integrations", "developer experience"],
    tone: "professional"
  }
});

console.log("Goal ID:", goal.goal_id);
console.log("Budget:", goal.goal.budget_usdc, "USDC");
```

```json Quote Response (402) theme={null}
{
  "error": "payment_required",
  "message": "Payment required for compute goal.",
  "payment_request": {
    "chain_id": 8453,
    "token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "amount": "3.758000",
    "recipient": "0x..."
  },
  "context": {
    "tool": "compute",
    "quote_id": "quote_01HX...",
    "objective_summary": "Research AI agent frameworks, build comparison page, email results to team",
    "title": "AI agent framework comparison",
    "estimated_phases": 1,
    "estimated_tasks": 3,
    "estimated_duration_days": 1,
    "budget_breakdown": {
      "per_unit": "3.648000",
      "overhead": "0.060000",
      "quote_fee": "0.05"
    },
    "scope": {
      "unit": { "name": "comparison report", "starts_on": "once" },
      "per_unit": {
        "uses": [
          { "tool": "research", "qty": 1, "max_attempts": 3 },
          { "tool": "build", "qty": 1, "max_attempts": 2 },
          { "tool": "email", "qty": 1, "max_attempts": 2 }
        ],
        "step_allowance": 200,
        "done": ["completed", "unreached"]
      },
      "overhead": { "uses": [], "step_allowance": 10 },
      "volume": { "kind": "open" },
      "unpriced": []
    },
    "scope_price": {
      "per_unit": {
        "expected": 3.648, "ceiling": 3.648, "steps_expected": 200,
        "uses": [
          { "tool": "research", "expected": 0.03, "ceiling": 0.03 },
          { "tool": "build", "expected": 2, "ceiling": 2 },
          { "tool": "email", "expected": 0.01, "ceiling": 0.01 }
        ]
      },
      "overhead": { "expected": 0.06, "ceiling": 0.06, "steps_expected": 10, "uses": [] },
      "unmeasured": ["research", "build", "email"]
    },
    "price": {
      "per_unit": { "expected": 3.648, "ceiling": 3.648 },
      "overhead": { "expected": 0.06, "ceiling": 0.06 },
      "unpriced": [],
      "unmeasured": ["research", "build", "email"]
    },
    "done_check": { "kind": "count", "of": "emails", "at_least": 1 },
    "requires": [],
    "connection_requirements": [],
    "requirements": [{ "kind": "sending_domain", "state": "ready", "limit": { "daily": 100, "remaining": 100, "requested": 2, "warming": false } }],
    "feasibility": {
      "verdict": "accept",
      "reasons": [],
      "warnings": [],
      "finish_line": { "kind": "measurable", "done_check": { "kind": "count", "of": "emails", "at_least": 1 } }
    },
    "total_budget": "3.758000",
    "expires_at": "2026-01-15T12:30:00.000Z"
  }
}
```

```json Execution Response (202) theme={null}
{
  "goal_id": "3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42",
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "active",
  "message": "Compute goal created. Orchestrator will begin planning.",
  "goal": {
    "objective": "Research the top 10 AI agent frameworks...",
    "budget_usdc": "3.758000"
  }
}
```

## Human-in-the-loop

The goal creates a `human_approval` task and waits when it needs human input, or a call needs your approval under [`approvals`](#param-approvals). Answer with the [respond endpoint](https://docs.oneshotagent.com/api-reference/compute/respond.md). If your [action policy](https://docs.oneshotagent.com/api-reference/approvals/overview#compute-goals) names an approver, they also get a one-tap link.

## Available tools

`research`, `web_read`, `browser`, `email`, `people_search`, `find_email`, `enrich_profile`, `research_companies`, `enrich_company`, `business_find`, `business_resolve`, `record_solicitations_find`, `soul_find` (free). Sandbox agents add SMS, voice, build, update, email verification, commerce, web search, person intelligence and inbox reads. `soul_hire` reserves the soul's price from the budget.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.