> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b3os.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Get an agent run

Returns the run's status plus the append-only event log rows after the `since` sequence number. Poll this to stream a run's progress.

` GET /v1/agent-runs/{id} `

Get an agent run

Returns the run's status plus the append-only event log rows after
the `since` sequence number. Poll this to stream a run's progress.

## Authentication

The operation accepts these alternatives. Schemes within one alternative are required together.

### Alternative 1

- ` BearerAuth `: ` apiKey `

  - Credential: ` Authorization ` in ` header `

  - JWT or API key, sent as: Bearer <token>

## Parameters

### ` id ` (path, required)

Run ID

- ` value `: type ` string `

### ` since ` (query, optional)

Return events with seq greater than this (default 0)

- ` value `: type ` integer `

## Responses

### ` 200 ` — OK

Content type: ` application/json `

- ` value `: type ` object `

  - ` code `: type ` integer `

    - example: ` 200 `

  - ` data `: type ` object `

    - ` events `: type ` array `

      - ` array item `: type ` object `

        - ` createdAt `: type ` string `

        - ` level `: type ` string `

        - ` message `: type ` string `

        - ` metadata `: type ` object `

        - ` seq `: type ` integer `

        - ` type `: type ` string `

    - ` state `: type ` object `

      - ` assistantText `: type ` string `

      - ` detail `: type ` string `

      - ` finishedAt `: type ` string `

      - ` phase `: type ` string `

      - ` runId `: type ` string `

      - ` savedWorkflowIds `: type ` array ` — SavedWorkflowIDs are the workflow ids the run ACTUALLY saved/edited (workflow-builder's wf-save ledger, reported on agent_done; success only). Mirrored verbatim from the worker so Caddie can refresh the canvas.

        - ` array item `: type ` string `

      - ` servedPath `: type ` string ` — ServedPath is the worker-relative path a serve-capable agent's output is served at (e.g. "/artifacts/<runId>/"); ServedURL is the absolute, browser-openable URL the API composes from it (worker base + path) so a client can surface the built app's link. Both empty for non-serving runs.

      - ` servedUrl `: type ` string `

      - ` startedAt `: type ` string `

      - ` truncated `: type ` boolean ` — Truncated marks a run that hit its budget and stopped mid-task. The consumer relays the answer differently, so dropping these here would present half a report as the whole one.

      - ` truncationReason `: type ` string `

      - ` turns `: type ` integer `

      - ` usage `: type ` object `

        - ` callCount `: type ` integer `

        - ` completionTokens `: type ` integer `

        - ` costUsd `: type ` number `

        - ` model `: type ` string `

        - ` promptTokens `: type ` integer `

  - ` message `: type ` string `

    - example: ` "success" `

  - ` requestId `: type ` string `

    - example: ` "abc-123" `

## Request examples

### cURL

```curl
curl -X GET 'https://api.example.com/v1/agent-runs/string' \
  -H 'Authorization: Bearer YOUR_API_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.example.com/v1/agent-runs/string', {
  method: 'GET',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN"
  }
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.get('https://api.example.com/v1/agent-runs/string', headers=headers)
print(response.json())
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.example.com/v1/agent-runs/string", nil)
	req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")

	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
	result, _ := io.ReadAll(resp.Body)
	fmt.Println(string(result))
}
```