---
title: "Get Agent Task"
method: GET
path: "/api/agent-tasks/{run_id}"
tags: ["agent-tasks"]
---

# Get Agent Task

`GET /api/agent-tasks/{run_id}`

## Request

- Base URL: `https://platform.verbiflow.com/api/bridge`
- URL: `https://platform.verbiflow.com/api/bridge/api/agent-tasks/{run_id}`
- Auth: one of:
  - HTTP bearer and API key in header `x-flage-org-id`
  - HTTP bearer and API key in header `x-flage-org-slug`

## Path parameters

- `run_id` string, required

## Response `200`

Successful Response

- AgentTaskResultResponse
  - `completed_at` string, date-time, nullable, required
  - `created_at` string, date-time, required
  - `error` string, nullable, required
  - `metrics` AgentTaskMetrics, required
    - `time_to_first_model_ms` integer, nullable
    - `usage` AgentTaskUsageMetrics, required
      - `cache_write_input_tokens` integer, required
      - `cached_input_tokens` integer, required
      - `input_tokens` integer, required
      - `model_turns` integer, required
      - `models` string[], required
      - `output_tokens` integer, required
      - `pricing_versions` string[], required
      - `provider_attempts` integer, required
      - `provider_cost_usd` string, required
      - `provider_retries` integer, required
      - `reasoning_tokens` integer, required
      - `tool_calls` integer, required
      - `total_tokens` integer, required
    - `wall_ms` integer, nullable
  - `request_digest` string, required
  - `result` AgentTaskResultEnvelope, required: Canonical result produced for every successfully completed AgentTask.
    - `output` union, required: Complete result, delivered inline or through an immutable artifact.
      - AgentTaskInlineProseResultOutput: One complete text, Markdown, or HTML AgentTask result carried inline.
        - `delivery` 'inline', required: Inline delivery means value contains the complete result.
        - `format` 'text' | 'markdown' | 'html', required: Caller-selected prose format of the complete string result.
        - `media_type` string, required: Media type of the exact serialized result bytes.
        - `sha256` string, required: SHA-256 digest of the exact serialized result bytes.
        - `size_bytes` integer, required: Byte length of the exact serialized result.
        - `value` string, required: Complete text, Markdown, or HTML result string.
      - AgentTaskInlineJsonResultOutput: One complete caller-schema-validated JSON object carried inline.
        - `delivery` 'inline', required: Inline delivery means value contains the complete result.
        - `format` 'json', required: JSON object result format.
        - `media_type` string, required: Media type of the exact serialized result bytes.
        - `sha256` string, required: SHA-256 digest of the exact serialized result bytes.
        - `size_bytes` integer, required: Byte length of the exact serialized result.
        - `value` object, required: Complete JSON result object; keys follow the caller-supplied closed output schema.
      - AgentTaskArtifactResultOutput: One complete result available through an immutable artifact.
        - `artifact_id` string, required: Canonical immutable artifact identity for the complete result.
        - `delivery` 'artifact', required: Artifact delivery means artifact_id identifies the complete immutable result.
        - `filename` string, required: Suggested filename derived from the requested result format.
        - `format` 'text' | 'markdown' | 'json' | 'html', required: Caller-selected semantic format of the complete result.
        - `media_type` string, required: Media type of the exact immutable artifact bytes.
        - `sha256` string, required: SHA-256 digest of the exact immutable artifact bytes.
        - `size_bytes` integer, required: Byte length of the exact immutable artifact.
    - `request_digest` string, required: SHA-256 of the exact canonical AgentTask request that produced this result.
    - `run_id` string, required: AgentTask run that produced this result.
    - `schema` 'verbiflow.agent_task_result.v1', required: Versioned AgentTask result-envelope contract identifier.
  - `run_id` string, required
  - `started_at` string, date-time, nullable, required
  - `status` 'pending' | 'running' | 'waiting_input' | 'suspended' | 'completed' | 'failed' | 'cancelled', required
  - `thread_id` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/verbiflow/apis/verbiflow-sdk-http-contract.md) - [All operations](https://skmtc.dev/verbiflow/apis/verbiflow-sdk-http-contract/llms.txt) - [OpenAPI document](https://skmtc.dev/verbiflow/apis/verbiflow-sdk-http-contract/revisions/c80e903ef8f3?raw)
