---
title: "Get agent"
method: GET
path: "/api/agent/{agentID}"
tags: ["agent"]
---

# Get agent

`GET /api/agent/{agentID}`

## 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/{agentID}`
- Auth: none required

Retrieve a single currently registered agent.

## Path parameters

- `agentID` string, required

## 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`: AgentNotFoundError | LocationNotFoundError

## Changes

> 50 revisions in range; 1 not diffed.

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

[Operation history](https://skmtc.dev/kaaass/apis/opencode/changes/api/agent/:agentID/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)
