Skip to content
OpenCode
Esc
navigateopen⌘Jpreview

Run command

Resolve a slash command into prompt input, admit it durably, and schedule execution unless resume is false.

POST/api/session/{sessionID}/command
Path parameters
sessionIDobjectrequired
Request body
requiredapplication/json
idobject | any
Show properties
Any of:
object
object
any
any
commandstringrequired
argumentsstring | any
Show properties
Any of:
string
string
any
any
agentstring | any
Show properties
Any of:
string
string
any
any
modelModel.Ref | any
Show properties
Any of:
Model.Ref
idstringrequired
providerIDstringrequired
variantstring
any
any
filesPromptInput.FileAttachment[]
Show properties
Array of PromptInput.FileAttachment
uristringrequired
namestring
descriptionstring
mentionPrompt.Mention
Show properties
startnumberrequired
endnumberrequired
textstringrequired
agentsPrompt.AgentAttachment[]
Show properties
Array of Prompt.AgentAttachment
namestringrequired
mentionPrompt.Mention
Show properties
startnumberrequired
endnumberrequired
textstringrequired
deliverystring | any
Show properties
Any of:
string
string
any
any
resumeboolean | any
Show properties
Any of:
boolean
boolean
any
any
Responses
200Success
dataSessionInput.Admittedrequired
Show properties
admittedSeqobjectrequired
Show properties
object
idobjectrequired
Show properties
object
sessionIDobjectrequired
Show properties
object
promptPromptrequired
Show properties
textstringrequired
filesPrompt.FileAttachment[]
Show properties
Array of Prompt.FileAttachment
dataPrompt.Base64required
Show properties
object
mimestringrequired
sourcePrompt.FileSourcerequired
Show properties
Any of:
object
typestringrequired
Allowed:inline
object
typestringrequired
Allowed:uri
uristringrequired
namestring
descriptionstring
mentionPrompt.Mention
Show properties
startnumberrequired
endnumberrequired
textstringrequired
agentsPrompt.AgentAttachment[]
Show properties
Array of Prompt.AgentAttachment
namestringrequired
mentionPrompt.Mention
Show properties
startnumberrequired
endnumberrequired
textstringrequired
deliverystringrequired
Allowed:steerqueue
timeCreatednumberrequired
promotedSeqobject
Show properties
object
400InvalidRequestError
Any of:
InvalidRequestError1
_tagstringrequired
Allowed:InvalidRequestError
messagestringrequired
kindstring | any
Show properties
Any of:
string
string
any
any
fieldstring | any
Show properties
Any of:
string
string
any
any
InvalidRequestError
_tagstringrequired
Allowed:InvalidRequestError
messagestringrequired
kindstring | any
Show properties
Any of:
string
string
any
any
fieldstring | any
Show properties
Any of:
string
string
any
any
401UnauthorizedError
_tagstringrequired
Allowed:UnauthorizedError
messagestringrequired
404SessionNotFoundError | CommandNotFoundError
Any of:
CommandNotFoundError
_tagstringrequired
Allowed:CommandNotFoundError
commandstringrequired
messagestringrequired
SessionNotFoundError
_tagstringrequired
Allowed:SessionNotFoundError
sessionIDstringrequired
messagestringrequired
SessionNotFoundError
_tagstringrequired
Allowed:SessionNotFoundError
sessionIDstringrequired
messagestringrequired
409ConflictError
_tagstringrequired
Allowed:ConflictError
messagestringrequired
resourcestring | any
Show properties
Any of:
string
string
any
any
500CommandEvaluationError
_tagstringrequired
Allowed:CommandEvaluationError
commandstringrequired
messagestringrequired
Request
curl -X POST "/api/session/%5Bobject%20Object%5D/command" \
  -H "Content-Type: application/json" \
  -d '{
  "id": {},
  "command": "string",
  "arguments": "string",
  "agent": "string",
  "model": {
    "id": "string",
    "providerID": "string",
    "variant": "string"
  },
  "files": [
    {
      "uri": "string",
      "name": "string",
      "description": "string",
      "mention": {
        "start": 0,
        "end": 0,
        "text": "string"
      }
    }
  ],
  "agents": [
    {
      "name": "string",
      "mention": {
        "start": 0,
        "end": 0,
        "text": "string"
      }
    }
  ],
  "delivery": "steer",
  "resume": true
}'
Response
{
  "data": {
    "admittedSeq": {},
    "id": {},
    "sessionID": {},
    "prompt": {
      "text": "string",
      "files": [
        {
          "data": {},
          "mime": "string",
          "source": {
            "type": "inline"
          },
          "name": "string",
          "description": "string",
          "mention": {
            "start": 0,
            "end": 0,
            "text": "string"
          }
        }
      ],
      "agents": [
        {
          "name": "string",
          "mention": {
            "start": 0,
            "end": 0,
            "text": "string"
          }
        }
      ]
    },
    "delivery": "steer",
    "timeCreated": 0,
    "promotedSeq": {}
  }
}