Ir al contenido

Start an agent session

POST/api/v1/sessions

The prompt is its first turn. When every slot is taken it waits in line, and queuedAt is its place. Needs agents.manage.

Necesita una clave de API en la cabecera Authorization.

En esta página

Cuerpo

CampoTipoDescripción
promptobligatoriostring
  • long. mín.: 1
  • long. máx.: 20000
repostring
  • defecto:
  • long. máx.: 140
titlestring
  • defecto:
  • long. máx.: 80
agentstring
  • defecto: claude
  • long. mín.: 1
  • long. máx.: 40
baseRefstring
  • defecto:
  • long. máx.: 200
modelstring
  • defecto:
  • long. máx.: 265
Esquema JSON
{
  "type": "object",
  "properties": {
    "prompt": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20000
    },
    "repo": {
      "type": "string",
      "maxLength": 140,
      "default": ""
    },
    "title": {
      "type": "string",
      "maxLength": 80,
      "default": ""
    },
    "agent": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40,
      "default": "claude"
    },
    "baseRef": {
      "type": "string",
      "maxLength": 200,
      "default": ""
    },
    "model": {
      "type": "string",
      "maxLength": 265,
      "default": ""
    }
  },
  "required": [
    "prompt"
  ],
  "additionalProperties": false
}

Petición de ejemplo

curl -X POST "https://polaris.example.com/api/v1/sessions" \
  -H "Authorization: Bearer $POLARIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "string",
  "repo": "",
  "title": "",
  "agent": "claude",
  "baseRef": "",
  "model": ""
}'

Respuestas

EstadoQué es
201Created

También puede dar los errores comunes 400, 401, 403, 404, 429. Ver errores comunes