Quick Wins
1. Terminate Sessions Explicitly
SetterminateOnCompletion: true on your final task, or call terminate explicitly. This alone reduces costs by 50% if you’re currently letting sessions timeout.
2. Write Concise Task Descriptions
Shorter descriptions = fewer input tokens. Be specific, not verbose. ❌ Verbose (150 tokens):3. Set startingPoint When Known
Skip navigation by providing the starting URL directly.
Additional Optimizations
Set Appropriate maxDuration
Limit task duration to prevent runaway costs:
- Simple searches: 30,000ms (30s)
- Form filling: 60,000ms (1 min)
- Multi-step workflows: 120,000ms (2 min)
Batch Related Tasks in Single Sessions
Reuse sessions for related tasks instead of creating new ones. ❌ Expensive:Limit Token Usage
For simple tasks, reduce token limits:Use Policies to Prevent Detours
Use automation policies with domain rules to block unnecessary domains and prevent wasted navigation.Use Custom Proxies for High-Bandwidth Tasks
WebRun-managed proxies cost $2 per GB of data transfer. For tasks that download large files or scrape image-heavy pages, use your own proxy to avoid per-GB charges. Only enable proxies when you actually need geographic targeting or IP management — each proxied session adds 2-3 seconds of cold-start latency.Monitoring Costs
Real-time: Checkusage.cost in every API response.
usage object updates in real-time as tasks execute.
Cost Optimization Checklist
- Use
/start/run-taskfor single tasks (auto-terminates) - Set
terminateOnCompletion: trueon final tasks in multi-task workflows - Write concise, specific task descriptions
- Provide
startingPointwhen the starting point is known - Set appropriate
maxDurationbased on task complexity - Batch related tasks into single sessions
- Limit
maxInputTokensandmaxOutputTokensfor simple tasks - Use policies to prevent accidental navigation
- Use custom proxies instead of WebRun-managed for high-bandwidth tasks
- Monitor
usage.costin responses to track spending
Example: Before & After
Before: ExpensivePricing
Understand WebRun’s pricing model
Session Control
Manage session lifecycle
Multi-Task Workflows
Chain tasks efficiently
Structured Output
Request minimal, structured responses