Agent

Start detached agent run

Changed on

Starts an agentic conversation loop in detached mode. The agent processes the user's message asynchronously, calling MCP tools as needed. Returns immediately with a runId and sessionId. Use /api/agent/runs/{runId}/events to stream the results via SSE.

RBAC

Tool execution within the agent loop respects user role permissions. Viewer role can only use read-only tools.

Iteration Limit

Max 50 iterations per run. Alert investigations (type=investigation) allow 60.

post/api/agent/run

Request

  • Base URL
    /api/plugins/consensys-asko11y-app/resources (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    • API key in cookie grafana_session
    • or HTTP bearer

Query parameters

model'base' | 'large'

Optional explicit LLM app model abstraction to use for this session. Omit to let Ask O11y choose base or large from the task type and message complexity. Once explicitly set on a session, later runs must use the same model.

Headers

X-Grafana-Org-Idstring

Grafana organization ID for multi-tenant isolation. Defaults to '1' if not provided.

Request body

messagestring required

User message to send to the agent

type'investigation' | 'performance' | 'chat'

Message type that determines which server-side prompt template to use

skillsstring[]

Skill names to explicitly activate for this run (optional). Unknown, disabled, or hidden names return 400.

sessionIdstring

Existing session ID to continue (optional, creates new if not provided)

orgNamestring

Organization name (optional)

scopeOrgIdstring

Scope organization ID (optional)

Response

Agent run started successfully

runIdstring required

Unique run ID (base64 URL-safe 32-byte token)

sessionIdstring required

Session ID (new or existing)

status'running' required

Initial run status

model'base' | 'large' required

Effective model selected for this run

modelSource'auto' | 'request' | 'session' required

How the effective model was chosen

Changes

    • info

      added the new optional request property

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status