Drex

Start a browser run

Admits a task for a cloud browser agent and answers at once with the queued run; poll GET /v1/browser/runs/{id} for its result. The run browses only allowed_origins, in a sandbox of its own, and is billed once when it ends: its Drex Max and LLM tokens and its browser seconds at the published prices, never more than limits.max_cost_usd. Runs that never start, time out, or fail on Drex's side are not charged; a run cancelled while it runs is charged its browser seconds so far.

POST
/v1/browser/runs
  • Banking, payment, identity, large social and government sites answer 422 with code origin_blocked, as do hosts that are not public.
  • An account's runs may cost at most $20 in any 24 hours unless support raised it; past that, 429 with code daily_spend_limit.
  • A run's task, URLs, answer and steps are erased 48 hours after it ends.
  • Accounts with zero retention cannot create runs (422, code zero_retention_unsupported).

Authorization

bearerAuth
AuthorizationBearer <token>

Your API key, sent as Authorization: Bearer nace_sk_...

  • Where: the dashboard's API Keys page. It is shown once, when you create it.
  • Format: nace_sk_ followed by 43 URL-safe characters (A-Z, a-z, 0-9, _ and -).
  • Limit: an account can hold at most 3 active keys.
  • Wrong or missing key: returns 401 authentication_error.

In: header

Header Parameters

Idempotency-Keystring

Same as idempotency_key in the body; both must match when both are sent. A retried key returns the same run.

Lengthlength <= 200

Request Body

application/json

taskstringrequired

What the agent should do, in plain language.

Length1 <= length <= 4000
start_urlstringrequired

An http or https page on a public host, on the default port, whose origin is in allowed_origins.

Formaturi
Lengthlength <= 2048
allowed_originsarray<string>required

The origins (https://shop.example.com, no path) the run may load. Everything else is blocked.

Items1 <= items <= 20
answer_schemaobject | null

A JSON Schema (at most 16 KB, without pattern or patternProperties) the answer must match. With one, answer holds the structured answer; a completed answer that does not match fails the run as answer_invalid, charged.

Show variants
risky_actions"deny"

The agent never submits payments, sends messages, or makes other irreversible changes.

Default"deny"
Value in"deny"
limitsBrowserRunLimits
Show child attributes
model"default"
Default"default"
Value in"default"
artifactsBrowserRunArtifactOptions
Show child attributes
idempotency_keystring

A retried key returns the same run; the same key with a different body answers 409.

Length1 <= length <= 200
metadataobject

Your own strings, returned with the run.

Propertiesproperties <= 20
Show child attributes

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/browser/runs" \  -H "Content-Type: application/json" \  -d '{    "task": "string",    "start_url": "http://example.com",    "allowed_origins": [      "string"    ]  }'
{  "id": "string",  "object": "browser_run",  "status": "queued",  "created_at": "2019-08-24T14:15:22Z"}