Twin Browser + REST API
Twin’s REST API is the universal integration path: a small set of HTTPS endpoints under `/api/v1/*` authenticated with a Bearer key. Any language that can make an HTTP request can drive the browser execution layer — no SDK required.
How Twin plugs into REST API
The REST API is the layer everything else wraps. `POST /api/v1/run` turns a goal into deterministic action, `POST /api/v1/dispatch` routes a re-phrased request through the semantic dispatch cache to a compiled skill, and the skill endpoints compile and replay. Auth, usage-based billing, and audit logging run on every call, and the run’s target URL is the authorization signal.
Twin is the browser execution layer your stack calls. The first run cold-compiles a skill; every similar request after that is matched from the cache and replayed deterministically, so your marginal cost per run trends toward zero.
- Receive goal from REST APIdone
- Compile DOM → token-efficient indexed statedone
- Match the semantic dispatch cacherunning
- Replay compiled skill — 0 LLM callsqueued
What you get through REST API
Every integration is a thin wrapper over the same execution layer, so the cache, replay, and corpus benefits apply no matter how you call in.
Semantic dispatch cache
A re-phrased goal fuzzy-matches an already-compiled skill, so most calls never touch the LLM.
Deterministic replay
A compiled skill replays the exact action path with zero LLM calls — fast, repeatable, cheap.
Cross-tenant skill corpus
A skill compiled once can be safely reused across tenants, so the hit rate climbs as the network runs.
One Bearer key
Auth, usage-based billing, and an audit log run on every call — the same key works from every integration.
Drop Twin into REST API
Copy, paste, and swap in your Bearer key. The first run compiles a skill; repeats hit the semantic dispatch cache and replay deterministically.
# Run a goal
curl -X POST https://twin-browser.com/api/v1/run \
-H "Authorization: Bearer tw_live_xxx" \
-H "Content-Type: application/json" \
-d '{"goal": "Log in and export the latest report", "url": "https://app.example.com"}'
# Dispatch a re-phrased request through the semantic cache
curl -X POST https://twin-browser.com/api/v1/dispatch \
-H "Authorization: Bearer tw_live_xxx" \
-H "Content-Type: application/json" \
-d '{"goal": "Download this month'\''s report after signing in"}'Base URL https://twin-browser.com/api/v1 · auth Authorization: Bearer tw_live_… · MCP tools run, compile_skill, run_skill.
Connect REST API in 4 steps
Install → configure your key → make the first call. The cache takes over from there.
- 1Create a key
Generate a Bearer key in the dashboard under Keys.
- 2Call /api/v1/run
POST a goal (and optional url) to execute a task.
- 3Dispatch repeats
Use /api/v1/dispatch so re-phrased requests hit the cache.
- 4Compile and replay
Compile a successful run into a skill and replay it deterministically.
Why this stays cheap at scale
Most browser infrastructure re-runs the LLM on every execution, so cost climbs with usage. Twin compiles a task once via skill compilation, matches re-phrased requests to it, and replays without the model — so repeated workflows stop scaling with your token bill.
REST API on Twin — common questions
Do I need an SDK to use Twin?
How do I authenticate?
More ways to connect Twin
MCP (Model Context Protocol)
MCP is an open protocol that lets an LLM application discover and call external tools over a standard interface. An MCP client (Cursor, Claude Desktop, Claude Code, Cline) connects to an MCP server, lists its tools, and invokes them on the model’s behalf — no bespoke glue per app.
OpenAI
OpenAI’s API supports function (tool) calling: you describe a function as a JSON schema, the model decides when to call it, and your code executes it and returns the result. This is the standard way to give a GPT-class model access to an external capability.
LangChain
LangChain is a Python and JavaScript framework for building LLM applications — chains, agents, and tools. Its agent loop lets a model pick a tool, observe the result, and decide the next action, which makes browser access a natural tool to add.
Wire up REST API in minutes
Free to start. Usage-based credits from $29/mo, with LLM cost metered and passed through at 1×.