openapi: 3.1.0
info:
  title: Okami Agent HTTP API
  version: 0.0.1
  description: Minimal fail-closed HTTP API for Okami Agent.
servers:
  - url: http://127.0.0.1:8765
paths:
  /health:
    get:
      summary: Healthcheck
      responses:
        "200":
          description: API ready
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    example: true
  /chat:
    post:
      summary: Send a message to an Okami agent
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - message
              properties:
                agent:
                  type: string
                  default: okami
                  description: Agent id under agents/<id>. Falls back to okami.
                message:
                  type: string
                  description: User message or task instruction.
            examples:
              default:
                value:
                  agent: okami
                  message: summarize this repository
      responses:
        "200":
          description: Agent response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reply:
                    type: string
                  state:
                    type: string
                    examples: [complete, blocked, needs_input, failed]
                  usage:
                    type: object
                    additionalProperties: true
        "400":
          description: Invalid JSON body
        "401":
          description: Missing or invalid Bearer token
        "404":
          description: Unknown endpoint
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
