One API for every web agent.
Run tasks on authenticated web portals through Browser Use, Browserbase and TinyFish. Tolkn routes on verified history, retries only when it is safe, and checks the portal before it reports success.
- 0.000task.createdacme · update_contact · write_idempotent
One adapter per provider. Bring your own keys.
- Browser Usebrowser_use · bu-4.0
- Browserbasebrowserbase · stagehand-hybrid
- TinyFishtinyfish · tinyagent
Every task follows the same path. Every attempt is recorded, with its provider, cost and verdict.
- 01Rank
Filter unusable providers, score the rest on verified history.
- 02Attempt
Run on the top provider with a fresh browser session.
- 03Verify
Ask the portal what happened. Ignore the agent's own grade.
- 04Decide
Succeed, fall back, or stop for review, by safety class.
Ranked on verified results, per portal and task type.
The router skips providers that cannot run the task, then scores the rest on how often their work was confirmed on this portal, followed by cost and latency. GET /v1/route shows the ranking and the reason for every skip.
- disabled
- Turned off in the provider registry.
- no API key configured
- No platform or bring-your-own key for this client.
- marked incompatible
- Known not to work for this portal and task_type.
- cooling down
- Three consecutive provider errors. Skipped for five minutes.
Cost and latency are normalised across candidates. Success rates are smoothed, so a new provider starts at 50% instead of 0. Demo and injected failures never count as evidence.
1{2 "ranked": [3 {4 "provider": "browser_use",5 "score": 0.4357,6 "success_rate": 0.786,7 "avg_cost": 0.08,8 "avg_duration_s": 78.0,9 "samples": 12,10 "note": ""11 },12 {13 "provider": "browserbase",14 "score": 0.3571,15 "success_rate": 0.857,16 "avg_cost": 0.12,17 "avg_duration_s": 104.0,18 "samples": 12,19 "note": ""20 }21 ],22 "skipped": [23 {24 "provider": "tinyfish",25 "reason": "cooling down after repeated provider errors"26 }27 ]28}Retries that know what is safe to repeat.
A failed lookup can be retried anywhere. A failed purchase order cannot. Every task_type carries a safety class, and the router decides what happens after a failure from that class and from what the portal says.
Retried only once the portal confirms the change did not happen.
example task_type: update_contact
- 1attempt.1Fails after the provider may have touched the portal.
- 2verify.portalReads the portal state and returns done_count for the change.
- 3policywrite_idempotent × touched portal → depends on done_count.
- done_count = 1succeededThe change is on the portal. Nothing to retry.
- done_count = 0fallbackVerifier confirmed it was not applied, so retrying is safe.
- cannot confirmneeds_reviewUnknown state is never retried automatically.
If the provider never reached the portal, every class falls back. A duplicate write (done_count > 1) always goes to review.
- read
- Never touchedfallbackMay have touchedfallback
- write_idempotent
- Never touchedfallbackMay have touchedfallback only if the verifier proves not done, otherwise needs_review
- write_irreversible
- Never touchedfallbackMay have touchedneeds_review, never repeated automatically
| safety_class | Provider never touched the portal | Provider may have touched the portal |
|---|---|---|
| read | fallback | fallback |
| write_idempotent | fallback | fallback only if the verifier proves not done, otherwise needs_review |
| write_irreversible | fallback | needs_review, never repeated automatically |
Don't trust the agent.
Check the portal.
Agents grade their own work, and they are sometimes wrong. After every attempt, an independent verifier reads the portal's state and checks it against expected_outcome. Its verdict, not the agent's, decides the result. Verifiers are defined per portal and task type; without one, a result is reported as unverified.
{ "attempt_no": 1, "provider": "tinyfish", "status": "failed", "self_reported_success": 1, "answer": "INV-1007 is Pending.", "verified": 0, "verification_checks": [ { "check": "payment status", "expected": "Paid", "found": "INV-1007 is Pending.", "passed": false } ], "failure_class": "task_failure"}{ "attempt_no": 2, "provider": "browser_use", "status": "succeeded", "self_reported_success": 1, "answer": "INV-1007 is Paid.", "verified": 1, "verification_checks": [ { "check": "payment status", "expected": "Paid", "found": "INV-1007 is Paid.", "passed": true } ], "failure_class": null}- Claimed success, portal disagrees
- Recorded as task_failure. The agent's claim is kept for audit.
- Claimed failure, portal confirms
- Succeeded. The change is on the portal, so it is not repeated.
- Duplicate detected
- done_count above 1 always goes to needs_review.
One request. Any provider.
Submit a task in plain English with the facts to verify. Use ?wait=true to block until it finishes, or poll GET /v1/tasks/{id}.
1curl -X POST "$ROUTER_URL/v1/tasks?wait=true" \2 -H "Authorization: Bearer $ROUTER_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "portal": "acme",6 "task": "Find invoice INV-1007 and report its payment status.",7 "task_type": "invoice_lookup",8 "session_ref": "acme-buyer",9 "expected_outcome": {"invoice_id": "INV-1007"}10 }'1{2 "id": "tsk_51b0d2e8c7a94f30",3 "portal": "acme",4 "task_type": "invoice_lookup",5 "safety_class": "read",6 "status": "succeeded",7 "verified": 1,8 "final_provider": "browser_use",9 "attempt_count": 1,10 "fallback_used": 0,11 "total_cost_usd": 0.06,12 "cost_basis": "actual",13 "duration_ms": 41870,14 "attempts": [15 {16 "attempt_no": 1,17 "provider": "browser_use",18 "engine": "bu-4.0",19 "status": "succeeded",20 "self_reported_success": 1,21 "verified": 1,22 "answer": "INV-1007 is Paid.",23 "verification_checks": [24 { "check": "payment status", "expected": "Paid",25 "found": "INV-1007 is Paid.", "passed": true }26 ]27 }28 ]29}| Field | Type | Description |
|---|---|---|
| portalstring | string | Portal id from your portal registry. |
| taskstring | string | Plain-English instruction for the agent. |
| task_typestring | string | Registered type. Sets the safety class: read, write_idempotent or write_irreversible. |
| session_refstring | string | Name of stored, encrypted portal credentials. Never the password. |
| expected_outcomeobject | object | Facts the verifier checks on the portal. |
| provider_preferencestring | string | Optional. Tried first if available. |
| allow_fallbackboolean | boolean | Default true. false runs on one provider only. |
Built for portals behind a login.
- Credentials by reference
- Tasks name a session_ref. Passwords never appear in task requests.
- Encrypted, then scrubbed
- Portal credentials are encrypted at rest and removed from agent output before it is saved. Cookies are never stored.
- Your provider keys
- Use platform keys or bring your own, encrypted per client.
- Honest cost records
- Every attempt records its cost and whether it is actual, estimated or unknown.
Tolkn is a working proof of concept.
We are looking for a small number of design partners running agents on authenticated portals. Tell us what you would run.
Or email tim@trytolkn.com