> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nasiko.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Server-side A2A dispatch endpoint. Accepts JSONRPC `message/send` or `message/stream`.

> No gateway required: the server validates the JWT and enforces authorization itself
(see `require_auth`/`Claims`). This handler is the production A2A path.



## OpenAPI

````yaml /api-reference/openapi.json post /api/orchestrator/a2a
openapi: 3.1.0
info:
  title: Nasiko API
  description: >-
    HTTP API for the Nasiko OpenRuntime: agents, coding harnesses, TokenOps,
    routing, MCP, and secrets. Spec is generated from annotated routes; some
    surfaces are documented on the hand-written pages alongside this file.
  license:
    name: ''
  version: 0.1.0
servers: []
security: []
tags:
  - name: secrets
    description: Encrypted per-user agent secrets
  - name: catalog
    description: >-
      Agent catalog: registration, discovery, versions, per-agent secrets, and
      source import
  - name: agents
    description: >-
      Agent lifecycle: deployments, LLM routing config, update/rollback,
      upload-and-deploy
  - name: orchestrator
    description: >-
      A2A dispatch: routing-engine/ReAct orchestrator and direct agent chat,
      plus routing stats
  - name: users
    description: >-
      User management: CRUD, roles, credentials, accessible agents
      (superuser-only)
  - name: usage
    description: Per-user token usage and cost reporting
  - name: observability
    description: Sessions, traces, spans, agent logs, and FinOps reporting
  - name: llm-router
    description: LLM routing presets, provider/model catalog, and tier→model registry
  - name: mcp
    description: >-
      MCP gateway: agent-facing JSON-RPC tool calls, connector
      registration/upload/sharing, credentials & OAuth, and per-agent tool
      permissions
paths:
  /api/orchestrator/a2a:
    post:
      tags:
        - orchestrator
      summary: >-
        Server-side A2A dispatch endpoint. Accepts JSONRPC `message/send` or
        `message/stream`.
      description: >-
        No gateway required: the server validates the JWT and enforces
        authorization itself

        (see `require_auth`/`Claims`). This handler is the production A2A path.
      operationId: a2a_dispatch_handler
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/A2aJsonRpcRequest'
        required: true
      responses:
        '200':
          description: A2A event stream (status/artifact updates, completion)
          content:
            text/event-stream: {}
        '400':
          description: Missing/invalid params, or an empty message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcErrorResponse'
        '403':
          description: Caller cannot access the targeted agent
        '404':
          description: Target agent not found or not running
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcErrorResponse'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcErrorResponse'
        '503':
          description: No agents available for routing-engine dispatch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcErrorResponse'
components:
  schemas:
    A2aJsonRpcRequest:
      type: object
      description: >-
        Doc-only stand-in for the real request type
        (`nasiko_types::a2a::JsonRpcRequest`,

        re-exported from the external `a2a-lf` crate, which has no `ToSchema`
        impl and

        can't be given one here). Mirrors its actual JSON-RPC 2.0 shape:
        `method` is

        `"message/send"` or `"message/stream"`; `params` is a
        `SendMessageRequest` —

        see `oss/docs/A2A_PROTOCOL.md` for the full parts/metadata schema.

        `metadata.agent_id` selects the dispatch target: absent or
        `"orchestrator"`

        routes through the routing engine/ReAct orchestrator, anything else
        proxies

        directly to that agent (UUID or name).
      required:
        - jsonrpc
        - method
        - params
      properties:
        id: {}
        jsonrpc:
          type: string
        method:
          type: string
        params: {}
    JsonRpcErrorResponse:
      type: object
      required:
        - jsonrpc
        - error
      properties:
        error:
          $ref: '#/components/schemas/JsonRpcErrorBody'
        id: {}
        jsonrpc:
          type: string
    JsonRpcErrorBody:
      type: object
      description: >-
        Doc-only stand-in for the JSON-RPC error envelope `A2aDispatchError`
        renders.
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string

````