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 [email protected]",
"params": {
"focus_areas": ["pricing", "integrations", "developer experience"],
"tone": "professional"
}
}'
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 [email protected]",
params: {
focus_areas: ["pricing", "integrations", "developer experience"],
tone: "professional"
}
});
console.log("Goal ID:", goal.goal_id);
console.log("Budget:", goal.goal.budget_usdc, "USDC");
{
"error": "payment_required",
"message": "Payment required for compute goal.",
"payment_request": {
"chain_id": 8453,
"token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "5.330000",
"recipient": "0x..."
},
"context": {
"tool": "compute",
"quote_id": "quote_01HX...",
"objective_summary": "Research AI agent frameworks, build comparison page, email results to team",
"estimated_phases": 4,
"estimated_tasks": 8,
"estimated_duration_days": 1,
"budget_breakdown": {
"research": "1.00",
"browser": "0.50",
"build": "1.00",
"email": "0.05",
"sandbox": "1.80",
"orchestrator": "0.06",
"platform_fee": "0.87",
"quote_fee": "0.05"
},
"requires": [],
"feasibility": {
"verdict": "accept",
"reasons": [],
"warnings": [],
"finish_line": { "kind": "measurable", "done_check": { "kind": "count", "of": "emails", "at_least": 1 } }
},
"total_budget": "5.330000",
"expires_at": "2026-01-15T12:30:00.000Z"
}
}
{
"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": "5.330000"
}
}
Goals
Compute
Create a compute goal that the orchestrator carries out in multiple steps.
POST
/
v1
/
compute
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 [email protected]",
"params": {
"focus_areas": ["pricing", "integrations", "developer experience"],
"tone": "professional"
}
}'
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 [email protected]",
params: {
focus_areas: ["pricing", "integrations", "developer experience"],
tone: "professional"
}
});
console.log("Goal ID:", goal.goal_id);
console.log("Budget:", goal.goal.budget_usdc, "USDC");
{
"error": "payment_required",
"message": "Payment required for compute goal.",
"payment_request": {
"chain_id": 8453,
"token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "5.330000",
"recipient": "0x..."
},
"context": {
"tool": "compute",
"quote_id": "quote_01HX...",
"objective_summary": "Research AI agent frameworks, build comparison page, email results to team",
"estimated_phases": 4,
"estimated_tasks": 8,
"estimated_duration_days": 1,
"budget_breakdown": {
"research": "1.00",
"browser": "0.50",
"build": "1.00",
"email": "0.05",
"sandbox": "1.80",
"orchestrator": "0.06",
"platform_fee": "0.87",
"quote_fee": "0.05"
},
"requires": [],
"feasibility": {
"verdict": "accept",
"reasons": [],
"warnings": [],
"finish_line": { "kind": "measurable", "done_check": { "kind": "count", "of": "emails", "at_least": 1 } }
},
"total_budget": "5.330000",
"expires_at": "2026-01-15T12:30:00.000Z"
}
}
{
"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": "5.330000"
}
}
Creates a goal from an objective and one upfront x402 deposit. Unspent budget comes back as credits, with one receipt.
Request body
string
required
Natural language, 10 to 10,000 characters.
object
Document sets:
document_extraction (Document Extraction).number
Deposited as given; omitted, the API estimates it. Outside the limits on Pricing the call returns
400 budget_too_low or budget_too_high; enterprise accounts can request a higher maximum. Ignored for recurring goals.string
ISO 8601. After it, nothing new starts and the done-check runs once more; unmet, the goal fails with
end_reason: deadline_passed. Running work is not cancelled.object
Kinds:
{"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) needs a one-off goal on an account enabled for cases; others get invalid_request. After three unmet attempts the goal fails with end_reason: check_failed. Omitted, the goal waits in awaiting_confirmation until you confirm with POST /v1/compute/{goal_id}/respond. An unknown kind is a 400.object
A tool call costing more than
spend_over_usdc, or whose tool is 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.string[]
Hosts the goal’s sandboxes may reach: Sandbox egress.
string
Soul.Markets slug.
string
A service of that soul.
object
Recurring:
cron (required, UTC; runs at least 15 minutes apart), budget_per_run (required, USDC), max_runs. The deposit is 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.Quote response (402)
context.quote_id, context.objective_summary, context.estimated_phases, context.estimated_tasks, context.estimated_duration_days, context.budget_breakdown (the whole deposit becomes the goal’s budget), context.total_budget (pay now: the budget minus context.credits_applied, present only above zero; the goal still gets the full budget), context.expires_at (60 minutes).
Execution response (202)
goal_id, request_id, status (active/awaiting_connection), 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.
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 [email protected]",
"params": {
"focus_areas": ["pricing", "integrations", "developer experience"],
"tone": "professional"
}
}'
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 [email protected]",
params: {
focus_areas: ["pricing", "integrations", "developer experience"],
tone: "professional"
}
});
console.log("Goal ID:", goal.goal_id);
console.log("Budget:", goal.goal.budget_usdc, "USDC");
{
"error": "payment_required",
"message": "Payment required for compute goal.",
"payment_request": {
"chain_id": 8453,
"token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "5.330000",
"recipient": "0x..."
},
"context": {
"tool": "compute",
"quote_id": "quote_01HX...",
"objective_summary": "Research AI agent frameworks, build comparison page, email results to team",
"estimated_phases": 4,
"estimated_tasks": 8,
"estimated_duration_days": 1,
"budget_breakdown": {
"research": "1.00",
"browser": "0.50",
"build": "1.00",
"email": "0.05",
"sandbox": "1.80",
"orchestrator": "0.06",
"platform_fee": "0.87",
"quote_fee": "0.05"
},
"requires": [],
"feasibility": {
"verdict": "accept",
"reasons": [],
"warnings": [],
"finish_line": { "kind": "measurable", "done_check": { "kind": "count", "of": "emails", "at_least": 1 } }
},
"total_budget": "5.330000",
"expires_at": "2026-01-15T12:30:00.000Z"
}
}
{
"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": "5.330000"
}
}
Human-in-the-loop
The goal creates ahuman_approval task and waits when it needs human input, or a tool call needs your approval under approvals. Answer with the respond endpoint. If your action policy 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_browse (free). Sandbox agents also have SMS, voice, website build and update, email verification, commerce, web search, person intelligence and inbox reads. soul_hire reserves the soul’s service price from the budget.