{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codai-ro/json-schema/codai-ro-agent-run-request-schema.json",
  "title": "Agent run request",
  "description": "Body of `POST /v1/agents/run`.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codai-ro-agents-api-openapi.yml#/components/schemas/AgentRunRequest",
  "type": "object",
  "required": [
    "task"
  ],
  "properties": {
    "task": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64000,
      "description": "The goal, in natural language. Becomes the user turn."
    },
    "context": {
      "type": "string",
      "maxLength": 256000,
      "description": "Optional supporting material, appended to the task under a `## Context` heading."
    },
    "system": {
      "type": "string",
      "maxLength": 32000,
      "description": "Optional system-prompt override, sent as the first message before the agent scaffold."
    },
    "model": {
      "type": "string",
      "maxLength": 128,
      "default": "codai",
      "description": "Model alias to route through."
    },
    "max_steps": {
      "type": "integer",
      "minimum": 1,
      "maximum": 16,
      "description": "Requested agent-loop depth cap. Validated but not enforced — the tier's agent-mode depth applies."
    }
  }
}