Agent runs
Python SDK reference for agent runs — launch, inspect, stream, pause/approve/resume, replay and fork agentic runs, with every AlgentaClient method and its endpoint.
Every method here lives on the AlgentaClient (and its async twin AsyncAlgentaClient) and is a thin, faithful client over the /v1/agent/runs HTTP surface. Construct the client once, then call any method below. The async client exposes the identical names — call them with await.
import os
from decision_engine import AlgentaClient
client = AlgentaClient(
api_key=os.environ["ALGENTA_API_KEY"],
base_url="https://api.algenta.ai", # or http://localhost:8000 self-hosted
)For a task-first walkthrough see Run an agent; for the raw contract see the API overview.
Launch and lifecycle
create_agent_run(*, task, context=None, tools=None, max_steps=10, output_format="text", approval_mode="auto", start_paused=False)
POST /v1/agent/runs
AgentRunResult
get_agent_run(run_id)
GET /v1/agent/runs/{run_id}
AgentRunResult
list_agent_runs(*, page=1, limit=25, status=None, request_hash=None, policy_snapshot_id=None, schema_snapshot_id=None)
GET /v1/agent/runs
AgentRunListResult
resume_agent_run(run_id)
POST /v1/agent/runs/{run_id}/resume
AgentRunResult
cancel_agent_run(run_id)
POST /v1/agent/runs/{run_id}/cancel
AgentRunResult
approve_agent_run(run_id)
POST /v1/agent/runs/{run_id}/approve
AgentRunResult
create_agent_run— start a new agentic run.taskis the natural-language objective;toolsscopes which capability tools the run may call;max_stepscaps the loop;output_formatis the shape you want back (for exampletext);approval_modeandstart_pausedcontrol human-in-the-loop gating.approve_agent_run/resume_agent_run— advance a run that paused for approval or was started withstart_paused=True.cancel_agent_run— stop a run that is still in flight.
Events and telemetry
get_agent_run_events(run_id, *, limit=1000)
GET /v1/agent/runs/{run_id}/events
AgentRunEventsResult
stream_agent_run_events(run_id, *, limit=1000)
GET /v1/agent/runs/{run_id}/events?stream=true
Iterator[AgentRunStreamEventResult]
list_agent_run_mission_events(run_id, *, limit=1000)
GET /v1/agent/runs/{run_id}/mission-events
AgentRunMissionEventsResult
query_agent_run_mission_events(*, page=1, limit=25, status=None, request_hash=None, policy_snapshot_id=None, schema_snapshot_id=None, run_id=None, event_type=None)
GET /v1/agent/runs/mission-events
AgentRunMissionEventListResponseResult
list_agent_run_telemetry(run_id, *, limit=1000)
GET /v1/agent/runs/{run_id}/telemetry
AgentRunTelemetryResult
query_agent_run_telemetry(*, page=1, limit=25, status=None, request_hash=None, policy_snapshot_id=None, schema_snapshot_id=None, run_id=None, telemetry_kind=None, module_name=None)
GET /v1/agent/runs/telemetry
AgentRunTelemetryListResult
get_agent_run_eventsreturns the recorded event log for one run;stream_agent_run_eventsyields the same events live as the run executes, each chunk carrying atypeofagent.run.eventoragent.run.completed.The
list_*variants scope to onerun_id; thequery_*variants page across runs and filter by provenance (request_hash,policy_snapshot_id,schema_snapshot_id) and kind.
Checkpoints, replay and fork
list_agent_run_checkpoints(run_id)
GET /v1/agent/runs/{run_id}/checkpoints
AgentRunCheckpointsResult
query_agent_run_checkpoints(*, page=1, limit=25, status=None, request_hash=None, policy_snapshot_id=None, schema_snapshot_id=None, run_id=None, checkpoint_id=None)
GET /v1/agent/runs/checkpoints
AgentRunCheckpointListResponseResult
replay_agent_run(run_id, *, checkpoint_id=None)
POST /v1/agent/runs/{run_id}/replay
AgentRunReplayResult
fork_agent_run(run_id, *, checkpoint_id=None)
POST /v1/agent/runs/{run_id}/fork
AgentRunResult
replay_agent_rundeterministically re-runs an existing run (optionally from a specificcheckpoint_id) and reports whether the replay matched.fork_agent_runbranches a new run from an existing run or checkpoint, so you can explore an alternative continuation without losing the original.
Example: launch a run and stream its events
Expected output resembles:
Example: pause for approval, then replay from a checkpoint
Related references
Jobs, triggers & capabilitiesRun an agentAPI endpoint referenceLast updated
Was this helpful?