API integration

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.

API3 MCP tools: run · compile_skill · run_skillBearer key auth

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.

app.example.com
  1. Receive goal from REST APIdone
  2. Compile DOM → token-efficient indexed statedone
  3. Match the semantic dispatch cacherunning
  4. Replay compiled skill — 0 LLM callsqueued
Wire it up

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.

curl — run a goalbash
# 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.

Get started

Connect REST API in 4 steps

Install → configure your key → make the first call. The cache takes over from there.

  1. 1
    Create a key

    Generate a Bearer key in the dashboard under Keys.

  2. 2
    Call /api/v1/run

    POST a goal (and optional url) to execute a task.

  3. 3
    Dispatch repeats

    Use /api/v1/dispatch so re-phrased requests hit the cache.

  4. 4
    Compile 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.

FAQ

REST API on Twin — common questions

Do I need an SDK to use Twin?
No. The REST API is plain HTTPS with Bearer auth, so any HTTP client works. The LangChain, AutoGen, and MCP integrations are thin wrappers over these same endpoints.
How do I authenticate?
Send Authorization: Bearer <your key> on every request. Keys are per-tenant, scoped, and revocable from the dashboard, and every call is audit-logged.

Wire up REST API in minutes

Free to start. Usage-based credits from $29/mo, with LLM cost metered and passed through at 1×.