---
title: "List agents"
method: GET
path: "/api/agent"
tags: ["agent"]
---

# List agents

`GET /api/agent`

## Request

- Base URL: `https://opencode.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://opencode.ai/api/agent`
- Auth: none required

Retrieve currently registered agents.

## Query parameters

- `location` object, nullable
  - `directory` string, nullable

## Response `200`

Success

- object
  - `location` LocationPublicRef, required
    - `directory` string, required
  - `data` AgentInfo[], required
    - `id` string, required
    - `name` string, required
    - `model` ModelRef
      - `id` string, required
      - `providerID` string, required
      - `variant` string
    - `request` ProviderRequest, required
      - `settings` ProviderSettings, required
        - `timeout` union
          - number
          - false
        - `headerTimeout` union
          - number
          - false
        - `chunkTimeout` union
          - number
          - false
        - `compaction` union
          - object
            - `type` 'summary', required
          - object
            - `type` 'native', required
        - `cache` ProviderCache
          - `ttl` string
        - `transport` 'http' | 'websocket'
        - `encoding` 'zstd' | 'gzip' | 'none'
      - `headers` object, required
      - `body` object, required
    - `system` string
    - `description` string
    - `mode` 'subagent' | 'primary' | 'all', required
    - `hidden` boolean, required
    - `color` string
    - `steps` integer
    - `permissions` PermissionRule[], required
      - `action` string, required
      - `resource` string, required
      - `effect` 'allow' | 'deny' | 'ask', required

## Other responses

- `400`: InvalidRequestError
- `401`: UnauthorizedError
- `404`: LocationNotFoundError
- `503`: ServiceUnavailableError

## Changes

> 50 revisions in range; 1 not diffed.

- **2026-10-26** `612fd3a75a0b`: 1 info
  - added the optional property `data/items/request/settings/cache` to the response with the `200` status
- **2026-10-26** `7c52b3e59fc5`: 1 info
  - added the non-success response with the status `503`

[Operation history](https://skmtc.dev/kaaass/apis/opencode/changes/api/agent/get.md)

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) - [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) - [OpenAPI document](https://skmtc.dev/kaaass/apis/opencode/revisions/4e083d954707?raw)
