Understudy Labs Runs API
The Runs API from Understudy Labs — 2 operation(s) for runs.
The Runs API from Understudy Labs — 2 operation(s) for runs.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/understudy-labs:understudy-labs-runs-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Understudy Desktop Agent Runs API
version: 2.2.0
description: Authenticated loopback API for agents operating a running Understudy Desktop app. The desktop capability file supplies the ephemeral base URL and bearer token. Prompts, images, traces, and model outputs remain local unless a caller explicitly selects a remote route.
servers:
- url: http://127.0.0.1:{port}
description: Discovered from the private desktop capability file
variables:
port:
default: '17790'
security:
- desktopBearer: []
tags:
- name: Runs
paths:
/v1/runs/{run_id}/cancel:
post:
operationId: cancelConversationRun
summary: Cancel one exact active run
parameters:
- $ref: '#/components/parameters/RunId'
responses:
'200':
description: Cancellation was requested for the exact run
content:
application/json:
schema:
$ref: '#/components/schemas/CancelResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Runs
/v1/runs/{run_id}/events:
get:
operationId: conversationRunEvents
summary: Replay the immutable canonical trace for one exact run
parameters:
- $ref: '#/components/parameters/RunId'
responses:
'200':
description: Persisted RuntimeEventEnvelope records in sequence order
content:
application/x-ndjson:
schema:
$ref: '#/components/schemas/RuntimeEventEnvelope'
x-understudy-stream-item: true
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Runs
components:
schemas:
ErrorResponse:
type: string
description: A bounded plain-text error. Clients must not treat it as model output.
CancelResponse:
type: object
required:
- ok
- status
- run_id
properties:
ok:
const: true
status:
const: cancelling
run_id:
$ref: '#/components/schemas/AgentId'
additionalProperties: false
RuntimeEventEnvelope:
type: object
required:
- schema_version
- event_id
- run_id
- session_id
- runtime_id
- sequence
- emitted_at
- event
- data
properties:
schema_version:
const: understudy-conversation-runtime-event-v1
event_id:
type: string
minLength: 1
run_id:
$ref: '#/components/schemas/AgentId'
session_id:
$ref: '#/components/schemas/AgentId'
runtime_id:
type: string
minLength: 1
sequence:
type: integer
minimum: 0
emitted_at:
type: string
format: date-time
event:
type: string
enum:
- message
- delta
- reasoning_delta
- tool_call
- tool_result
- usage
- supervisor_verdict
- student_interruption
- teacher_continuation
- cancellation
- error
- image_attachment
- compaction_boundary
data:
type: object
additionalProperties: true
additionalProperties: false
AgentId:
type: string
minLength: 1
maxLength: 200
pattern: ^[A-Za-z0-9._:-]+$
parameters:
RunId:
name: run_id
in: path
required: true
schema:
$ref: '#/components/schemas/AgentId'
responses:
Unauthorized:
description: Missing or invalid desktop bearer token
content:
text/plain:
schema:
$ref: '#/components/schemas/ErrorResponse'
NotFound:
description: The requested run or trace was not found
content:
text/plain:
schema:
$ref: '#/components/schemas/ErrorResponse'
securitySchemes:
desktopBearer:
type: http
scheme: bearer
description: Ephemeral token read from the owner-only desktop capability file. Agents should use the Understudy CLI or MCP adapter instead of printing this token.
x-understudy-discovery:
capability_file: ~/.understudy/desktop-api.json
capability_schema: understudy.desktop_api.v2
required_file_mode: '0600'
recommended_adapter: understudy desktop
x-understudy-extension-surfaces:
available_via_versioned_rest_mcp_and_cli:
- runtime status
- model inventory and certified catalog
- model download lifecycle
- residency slot lifecycle
- local correction-pair export and supervision metrics
not_yet_versioned_in_v2_rest:
- conversation inspect, branch, compact, and resume
- runtime and CLI diagnostics with repair actions
- general capture export outside desktop supervision
- resumable desktop-wide event subscription