---
title: "POST /agent"
method: POST
path: "/agent"
---

# POST /agent

`POST /agent`

Register or update a dynamic agent (stored in memory only)

## Query parameters

- `directory` string
- `workspace` string

## Request body

- Agent
  - `name` string, required
  - `description` string
  - `mode` 'subagent' | 'primary' | 'all', required
  - `native` boolean
  - `hidden` boolean
  - `topP` number
  - `temperature` number
  - `color` string
  - `permission` PermissionRule[], required
    - `permission` string, required
    - `pattern` string, required
    - `action` 'allow' | 'deny' | 'ask', required
  - `model` object
    - `modelID` string, required
    - `providerID` string, required
  - `variant` string
  - `prompt` string
  - `options` object, required
  - `steps` number
  - `subAgents` string[], nullable
  - `skills` string[], nullable

## Response `200`

Successfully registered agent

- boolean

## Other responses

- `400` — Bad request

---

[API](https://skmtc.net/kaaass/apis/opencode.md) · [All operations](https://skmtc.net/kaaass/apis/opencode/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kaaass/opencode/revisions/8bb9a15bd144/schema)
