curl -X POST https://win.oneshotagent.com/v1/tools/browser \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-d '{
"task": "Go to producthunt.com, find the top 5 AI products launched today, and extract their names, descriptions, and upvote counts",
"output_schema": {
"products": [{
"name": "string",
"description": "string",
"upvotes": "number"
}]
}
}'
import { OneShot } from "@oneshot-agent/sdk";
const agent = new OneShot({ privateKey: process.env.AGENT_PRIVATE_KEY });
const result = await agent.browser({
task: "Go to producthunt.com, find the top 5 AI products launched today, and extract their names, descriptions, and upvote counts",
output_schema: {
products: [{
name: "string",
description: "string",
upvotes: "number"
}]
}
});
console.log("Products:", result.output.products);
console.log("Steps taken:", result.steps.length);
import { OneShot } from "@oneshot-agent/sdk";
const agent = new OneShot({ privateKey: process.env.AGENT_PRIVATE_KEY });
// Import cookies/localStorage exported from your own signed-in browser.
const profile = await agent.createBrowserProfile("my-github-bot", { storage_state: state });
// Reuse the imported profile
const result = await agent.browser({
task: "Go to github.com/notifications and list my unread notifications",
profile_id: profile.id,
allowed_domains: ["github.com"],
});
from oneshot import OneShotClient
client = OneShotClient(private_key="0x...")
# Create a persistent profile
profile = client.create_browser_profile("my-github-bot", storage_state=state)
# Use the profile with credentials
result = client.browser(
task="Go to github.com/notifications and list my unread notifications",
profile_id=profile["id"],
allowed_domains=["github.com"],
)
{
"error": "payment_required",
"message": "Payment required for browser automation.",
"payment_request": {
"chain_id": 8453,
"token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "0.150000",
"recipient": "0x..."
},
"context": {
"tool": "browser",
"quote_id": "quote_abc123",
"task_summary": "Navigate to ProductHunt, find top AI products, extract structured data",
"estimated_steps": 8,
"max_steps": 25,
"estimated_cost": "0.150000",
"complexity_score": 0.6,
"expires_at": "2026-01-15T12:30:00Z"
}
}
{
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"tool": "browser",
"message": "Browser task initiated. Results available at /v1/requests/{id}.",
"browser": {
"estimated_steps": 8,
"max_steps": 25,
"estimated_cost": "0.150000"
}
}
{
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"result": {
"output": {
"products": [
{ "name": "AgentKit", "description": "Build autonomous AI agents in minutes", "upvotes": 342 },
{ "name": "VoiceFlow", "description": "AI voice agents for customer support", "upvotes": 289 }
]
},
"steps": [
{ "number": 1, "goal": "Navigate to producthunt.com", "url": "https://www.producthunt.com" },
{ "number": 2, "goal": "Find AI products section", "url": "https://www.producthunt.com/topics/artificial-intelligence" }
],
"cost": 0.12
}
}
Browser
Browser
Execute browser automation tasks: navigate pages, extract data, fill forms, interact with websites
POST
/
v1
/
tools
/
browser
curl -X POST https://win.oneshotagent.com/v1/tools/browser \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-d '{
"task": "Go to producthunt.com, find the top 5 AI products launched today, and extract their names, descriptions, and upvote counts",
"output_schema": {
"products": [{
"name": "string",
"description": "string",
"upvotes": "number"
}]
}
}'
import { OneShot } from "@oneshot-agent/sdk";
const agent = new OneShot({ privateKey: process.env.AGENT_PRIVATE_KEY });
const result = await agent.browser({
task: "Go to producthunt.com, find the top 5 AI products launched today, and extract their names, descriptions, and upvote counts",
output_schema: {
products: [{
name: "string",
description: "string",
upvotes: "number"
}]
}
});
console.log("Products:", result.output.products);
console.log("Steps taken:", result.steps.length);
import { OneShot } from "@oneshot-agent/sdk";
const agent = new OneShot({ privateKey: process.env.AGENT_PRIVATE_KEY });
// Import cookies/localStorage exported from your own signed-in browser.
const profile = await agent.createBrowserProfile("my-github-bot", { storage_state: state });
// Reuse the imported profile
const result = await agent.browser({
task: "Go to github.com/notifications and list my unread notifications",
profile_id: profile.id,
allowed_domains: ["github.com"],
});
from oneshot import OneShotClient
client = OneShotClient(private_key="0x...")
# Create a persistent profile
profile = client.create_browser_profile("my-github-bot", storage_state=state)
# Use the profile with credentials
result = client.browser(
task="Go to github.com/notifications and list my unread notifications",
profile_id=profile["id"],
allowed_domains=["github.com"],
)
{
"error": "payment_required",
"message": "Payment required for browser automation.",
"payment_request": {
"chain_id": 8453,
"token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "0.150000",
"recipient": "0x..."
},
"context": {
"tool": "browser",
"quote_id": "quote_abc123",
"task_summary": "Navigate to ProductHunt, find top AI products, extract structured data",
"estimated_steps": 8,
"max_steps": 25,
"estimated_cost": "0.150000",
"complexity_score": 0.6,
"expires_at": "2026-01-15T12:30:00Z"
}
}
{
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"tool": "browser",
"message": "Browser task initiated. Results available at /v1/requests/{id}.",
"browser": {
"estimated_steps": 8,
"max_steps": 25,
"estimated_cost": "0.150000"
}
}
{
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"result": {
"output": {
"products": [
{ "name": "AgentKit", "description": "Build autonomous AI agents in minutes", "upvotes": 342 },
{ "name": "VoiceFlow", "description": "AI voice agents for customer support", "upvotes": 289 }
]
},
"steps": [
{ "number": 1, "goal": "Navigate to producthunt.com", "url": "https://www.producthunt.com" },
{ "number": 2, "goal": "Find AI products section", "url": "https://www.producthunt.com/topics/artificial-intelligence" }
],
"cost": 0.12
}
}
Overview
Your agent tells the Browser API what to do in plain English. It navigates pages, pulls structured data, fills out forms, clicks buttons, and runs multi-step workflows on your behalf. You get a cost estimate before paying.Authentication
Requires x402 payment. First call analyzes the task and returns a quote (402), second call with payment executes asynchronously.Request Body
string
required
Natural language description of the browser task (minimum 10 characters, max 50,000).Examples:
- “Go to example.com/pricing and extract all plan names, prices, and features into a table”
- “Navigate to the contact page and fill out the form with our company info”
- “Search for ‘AI startups’ on ProductHunt and extract the top 10 results”
object
JSON schema for the expected output. If you pass this, the browser extracts data matching your schema.
{
"products": [{
"name": "string",
"price": "number",
"features": ["string"]
}]
}
string
Starting URL for the browser task. If omitted, the agent decides where to begin based on the task description.
string[]
Instruct the browser agent to stay within these domains. In the v3 integration this is a task instruction, not a network-level restriction.
string
Persistent browser profile ID. Reuses cookies, local storage, and session state across tasks. Create profiles via
POST /v1/tools/browser/profiles.object
Unsupported and rejected before payment. Import
cookies or storage_state when creating a profile; use its profile_id for tasks.string
UUID to resume a previous browser session (preserves cookies, login state).
integer
Legacy step-derived budget allowance (25–100, default 50). OneShot maps this to a provider dollar allowance; it is not an exact action limit. The conservative minimum of 25 is a OneShot support policy, not a vendor minimum. Smaller values are rejected before payment. SDK
maxCost limits quote/payment approval independently.Quote Response (402)
The first request analyzes the task and returns a cost estimate:string
Quote ID to include in payment request
string
Summary of what the browser will do
integer
Estimated number of browser steps needed
integer
Maximum steps allowed for this task
string
Total estimated cost in USDC
number
Task complexity score (0-1)
string
Quote expiration timestamp (30 minutes)
Execution Response (202)
After payment, the browser task runs asynchronously:string
Job ID for polling status at
/v1/requests/{id}string
processing while the browser task runsinteger
Estimated steps from the quote
string
Estimated cost from the quote
Completed Job Result
Poll/v1/requests/{request_id} for the result:
string | object
Extracted data or task result. Structured JSON if you passed
output_schema.array
Ordered browser activity:
[{ number, goal, url }]. Goals are safe action categories. URLs omit credentials, query strings, and fragments; an empty string means unavailable. step_count is the provider action count and can differ from activity length. steps_incomplete flags unavailable activity.number
Provider cost for this task, excluding OneShot fees; also returned as
total_cost_usd. Zero is valid; null means unavailable. Reused sessions return the incremental task cost.number | null
Final customer charge including applied credits and net of reconciliation credits. Null means accounting is pending; poll the request again. Use this field for customer spend accounting.
result. TypeScript throws JobError with code and partialResult; Python exposes code and partial_result. Browser reason codes distinguish timeout, stall, cost limit, navigation block, detached frame, and unknown provider failure. Keep error_ref for support. A failed browser task is not automatically replayed.
string[]
URLs of any files downloaded or screenshots captured
curl -X POST https://win.oneshotagent.com/v1/tools/browser \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-d '{
"task": "Go to producthunt.com, find the top 5 AI products launched today, and extract their names, descriptions, and upvote counts",
"output_schema": {
"products": [{
"name": "string",
"description": "string",
"upvotes": "number"
}]
}
}'
import { OneShot } from "@oneshot-agent/sdk";
const agent = new OneShot({ privateKey: process.env.AGENT_PRIVATE_KEY });
const result = await agent.browser({
task: "Go to producthunt.com, find the top 5 AI products launched today, and extract their names, descriptions, and upvote counts",
output_schema: {
products: [{
name: "string",
description: "string",
upvotes: "number"
}]
}
});
console.log("Products:", result.output.products);
console.log("Steps taken:", result.steps.length);
import { OneShot } from "@oneshot-agent/sdk";
const agent = new OneShot({ privateKey: process.env.AGENT_PRIVATE_KEY });
// Import cookies/localStorage exported from your own signed-in browser.
const profile = await agent.createBrowserProfile("my-github-bot", { storage_state: state });
// Reuse the imported profile
const result = await agent.browser({
task: "Go to github.com/notifications and list my unread notifications",
profile_id: profile.id,
allowed_domains: ["github.com"],
});
from oneshot import OneShotClient
client = OneShotClient(private_key="0x...")
# Create a persistent profile
profile = client.create_browser_profile("my-github-bot", storage_state=state)
# Use the profile with credentials
result = client.browser(
task="Go to github.com/notifications and list my unread notifications",
profile_id=profile["id"],
allowed_domains=["github.com"],
)
{
"error": "payment_required",
"message": "Payment required for browser automation.",
"payment_request": {
"chain_id": 8453,
"token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "0.150000",
"recipient": "0x..."
},
"context": {
"tool": "browser",
"quote_id": "quote_abc123",
"task_summary": "Navigate to ProductHunt, find top AI products, extract structured data",
"estimated_steps": 8,
"max_steps": 25,
"estimated_cost": "0.150000",
"complexity_score": 0.6,
"expires_at": "2026-01-15T12:30:00Z"
}
}
{
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"tool": "browser",
"message": "Browser task initiated. Results available at /v1/requests/{id}.",
"browser": {
"estimated_steps": 8,
"max_steps": 25,
"estimated_cost": "0.150000"
}
}
{
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"result": {
"output": {
"products": [
{ "name": "AgentKit", "description": "Build autonomous AI agents in minutes", "upvotes": 342 },
{ "name": "VoiceFlow", "description": "AI voice agents for customer support", "upvotes": 289 }
]
},
"steps": [
{ "number": 1, "goal": "Navigate to producthunt.com", "url": "https://www.producthunt.com" },
{ "number": 2, "goal": "Find AI products section", "url": "https://www.producthunt.com/topics/artificial-intelligence" }
],
"cost": 0.12
}
}
Charged per step with a base initialization fee and margin. See Pricing for details.
Pass
output_schema to get structured JSON back instead of raw text.allowed_domains keeps the browser on-target and cuts both cost and runtime.