Skip to main content
Two October releases change the API in ways that break existing clients:
  • The Agents release replaces workflows with agents and renames the run’s error_message to error.
  • API 0.126.0 renames parameters, fields, paths and webhook fields to follow one set of naming rules.

Agents release

The Agents release replaces workflows with agents. An agent’s revision is either code, like a workflow’s, or instructions: a task in plain English that a model works through on the phone. Runs can now start from an ad hoc task, pause for a person, take follow-ups on the same phone, and run on a schedule. Workflows are not carried over: recreate each one as a code agent. The old routes and names stop working in this release. There is no compatibility period, so update your code and clients before you upgrade.

Upgrade to CLI 0.14

CLI 0.14.0 follows this release. See Upgrade from an earlier CLI for its breaking changes.

Upgrade the SDKs

Python SDK 0.23.0 and Go SDK v0.16.0 follow this release, and earlier versions can’t call the removed paths. In Python, client.workflows is now client.agents, runs start with client.runs.start(), and client.session(workflow_id=...) is gone.

Actions on text that matches several elements

When a locator reads the screen (accessibility off, or strategy="vision"), an action on text that matches several elements now raises ActionTimeoutError and lists the matches, instead of acting on the first. Scripts that relied on the first match need first(), nth(), exact or more specific text. See Locators.

Removed paths

Renamed and removed fields

The CLI’s runs watch -o json ends with error in place of error_message:

Changed behavior

  • A run has a mode: agent when a model drives it, code when a script runs. Every former workflow run is a code run.
  • A run can be paused, which joins the run status enum and the status filter on GET /runs.
  • POST /runs returns 409 while your organization is at its concurrency limit.
  • After an agent-mode run’s turn ends, or after you cancel a running or paused agent-mode run, the run holds its phone for keep_alive_seconds: 120 seconds by default on POST /runs, 0 in a batch. A shared phone bills for that time. Release it with POST /phones/{phone_id}:deallocate and the run’s session_id, or set keep_alive_seconds: 0. See Pause and follow up.

New endpoints and fields

  • Agents: /agents, their revisions, :rollback, and /revisions/{revision_id}:promote for a fix a repair proposed. See Create an agent.
  • Runs: POST /runs takes an ad hoc task or an agent_id, targets, network, keep_alive_seconds and limits. :pause, :resume and :sendMessage pause, answer and follow up. See Run a task or an agent.
  • A run carries mode, task, output, result_text, usage, input_request, repair, turn, turns, keep_alive_expires_at and stream_url. GET /runs filters by schedule_id, mode and device_class.
  • GET /realtime/runs/{run_id}/events streams a run, and GET /runs/{run_id}/events, /steps and /script read its events, model steps and executed code. See Monitor runs.
  • Schedules: /agents/{agent_id}/schedules, with :pause, :resume and :run. See Schedule an agent.
  • Metrics: GET /runs/metrics and GET /sessions/metrics, on the metrics contract. GET /usage/metrics adds the agent, model, api_key, schedule and device_class groups, and the session_seconds, input_tokens and output_tokens measures.
  • GET /usage/inferences adds the agent_chat endpoint: one model step of an agent-mode run.
  • GET /models lists the models an agent can use.

Agent webhook payloads

New events: run.paused, run.resumed, schedule.paused, schedule.ended and schedule.occurrence_skipped. A run with follow-ups fires run.started and its end event once per turn. See Webhook events.

Naming rules

API 0.126.0 makes the REST API follow one set of naming rules everywhere. Some parameters, response fields, paths and webhook fields have new names. The old names stop working in this release, so update your code and upgrade your clients. The same release puts every metrics endpoint on one contract (see Metrics).

Upgrade your clients

The SDK and CLI releases that follow API 0.126.0 use the new names. Earlier releases call the old ones and fail.

The rules

Paths and methods

The Agents release later removed the workflow routes in this table. See Removed paths.

Query parameters

GET /api-keys also takes search, created_by_id, created_after, created_before and order_by. GET /workflows also takes order_by, whose field is a path into the listed item, for example order_by=workflow.name asc. Both are additions, so existing calls keep working.

Response fields

Metrics

GET /usage/metrics and GET /webhooks/metrics follow one contract, and every metrics endpoint added later will too. The response is {"points": [...]}: one point per bucket (and per group), oldest first, each with period_start_at and every measure. A measure is named for its unit (_microdollars, _ms, _rate from 0 to 1, or a plain count) and is zero for a bucket with no activity. A latency is null when no attempt in the bucket recorded one. A webhooks window that needs more buckets than the gateway returns in one read is a 400; shorten it.

Webhook payloads

A phone rental’s canceled_at and a subscription’s canceled status keep Stripe’s spelling.

SDK methods

The SDKs take the new parameter names as arguments (period_start_at= in Python, PeriodStartAt in Go). These methods also moved: