---
title: "Run command"
method: POST
path: "/api/session/{sessionID}/command"
tags: ["session"]
---

# Run command

`POST /api/session/{sessionID}/command`

## Request

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

Execute a slash command callback immediately.

## Path parameters

- `sessionID` string, required

## Request body

- object
  - `name` string, required
  - `text` string, required
  - `files` PromptInputFileAttachment[]
    - `uri` string, required
    - `name` string
    - `description` string
    - `mention` PromptMention
      - `start` number, required
      - `end` number, required
      - `text` string, required
  - `agents` PromptAgentAttachment[]
    - `name` string, required
    - `mention` PromptMention
      - `start` number, required
      - `end` number, required
      - `text` string, required
  - `skills` PromptInputSkillAttachment[]
    - `id` string, required
    - `mention` PromptMention
      - `start` number, required
      - `end` number, required
      - `text` string, required
  - `delivery` 'steer' | 'queue'

## Response `204`

<No Content>

## Other responses

- `400`: InvalidRequestError
- `401`: UnauthorizedError
- `404`: SessionNotFoundError | CommandNotFoundError | LocationNotFoundError
- `500`: CommandExecutionError

---

[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)
