Aider Session API

Aider Session Lifecycle Commands.

Documentation

Specifications

Other Resources

OpenAPI Specification

aider-session-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Aider CLI Chat Session API
  version: 0.86.1
  description: Documentation surface for the Aider command-line interface. Aider has no hosted REST API and does not bind to a network port — it runs entirely in a developer's terminal against the local Git working tree. This OpenAPI document models the Aider command surface as if it were a REST API so it can be consumed by API-centric tooling (catalogs, registries, governance rule engines, capability runtimes). Each slash command (`/add`, `/diff`, `/commit`, etc.) is modeled as a path; each launch-flag family is modeled as a configuration path. Servers and security blocks are placeholders — aider's actual security model is "use the user's local shell credentials and the LLM provider API key in the environment."
  contact:
    name: Aider Maintainers
    url: https://github.com/Aider-AI/aider/issues
  license:
    name: Apache 2.0
    url: https://github.com/Aider-AI/aider/blob/main/LICENSE.txt
  x-generated-from: documentation
  x-last-validated: '2026-05-30'
  x-source-urls:
  - https://aider.chat/docs/usage/commands.html
  - https://aider.chat/docs/usage/modes.html
  - https://aider.chat/docs/config/options.html
  - https://aider.chat/docs/llms.html
servers:
- url: cli://aider
  description: Local CLI invocation (not a network endpoint). Modeled as URI scheme `cli://aider` for catalog tooling.
- url: file:///usr/local/bin/aider
  description: Typical install path for the `aider` entrypoint.
security:
- LLMProviderKey: []
tags:
- name: Session
  description: Aider Session Lifecycle Commands.
paths:
  /commands/clear:
    post:
      operationId: clearChatHistory
      summary: Aider Clear Chat History
      description: Clear the chat history. Maps to `/clear`.
      tags:
      - Session
      responses:
        '200':
          description: Chat history cleared.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandResult'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /commands/reset:
    post:
      operationId: resetSession
      summary: Aider Reset Session
      description: Drop all files and clear the chat history. Maps to `/reset`.
      tags:
      - Session
      responses:
        '200':
          description: Session reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandResult'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /commands/load:
    post:
      operationId: loadCommandScript
      summary: Aider Load Command Script
      description: Load and execute commands from a file. Maps to `/load`.
      tags:
      - Session
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FilePathRequest'
      responses:
        '200':
          description: Commands executed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandResult'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /commands/save:
    post:
      operationId: saveCommandScript
      summary: Aider Save Command Script
      description: Save commands to a file that can reconstruct the chat session. Maps to `/save`.
      tags:
      - Session
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FilePathRequest'
      responses:
        '200':
          description: Command script saved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandResult'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /commands/report:
    post:
      operationId: openGitHubIssue
      summary: Aider Report a Problem
      description: Report a problem by opening a GitHub Issue. Maps to `/report`.
      tags:
      - Session
      responses:
        '200':
          description: Browser opened to the issue tracker.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandResult'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /commands/exit:
    post:
      operationId: exitSession
      summary: Aider Exit Session
      description: Exit the application. Maps to `/exit` and `/quit`.
      tags:
      - Session
      responses:
        '200':
          description: Session exited.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandResult'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    FilePathRequest:
      type: object
      required:
      - path
      properties:
        path:
          type: string
          description: Filesystem path.
          example: .aider/session-2026-05-30.txt
    CommandResult:
      type: object
      properties:
        ok:
          type: boolean
          example: true
        message:
          type: string
          example: Files added to chat.
  securitySchemes:
    LLMProviderKey:
      type: apiKey
      in: header
      name: X-Provider-API-Key
      description: Placeholder for documentation purposes. Aider does not authenticate with an "aider API"; it reads the relevant upstream provider key (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) from the local environment and passes it to the chosen LLM provider directly.