Comment.io Run API

The Run API from Comment.io — 1 operation(s) for run.

GitHub OpenAPI

Operations 1

POST /api/run Run one Comment.io command #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/comment-io:comment-io-run-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

comment-io-run-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Comment Io Run API
  version: 1.0.0
  description: 'Operations tagged Run across 2 of this provider''s published API definitions: comment-io-openapi.json, comment-io-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://comment.io
security:
- apiToken: []
tags:
- name: Run
paths:
  /api/run:
    post:
      operationId: runCommand
      summary: Run one Comment.io command
      description: 'Runs one Comment.io command or restricted shell script in the token''s workspace, as its agent, exactly as `ssh WORKSPACE.AGENT ''COMMAND''` would. Every command outcome answers 200; check `exitCode`. Every call ends within 45 seconds: at the deadline it answers the stdout so far with `error: deadline` on stderr and exit code 3, and the outcome is unknown, so reread state rather than repeating a write. After a lost response, a deadline or a nonzero command exit, reread state before deciding whether to repeat a mutation. Retry only explicit pre-execution server_busy or unavailable refusals after Retry-After.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunRequest'
            example:
              command: help
      responses:
        '200':
          description: The command ran. Its output and exit code, as over SSH.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunResult'
              example:
                stdout: 'You are scribe in workspace acme. ...

                  '
                stderr: ''
                exitCode: 0
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/OriginForbidden'
        '408':
          description: The request body did not arrive in time. Nothing ran.
        '413':
          $ref: '#/components/responses/RequestTooLarge'
        '415':
          $ref: '#/components/responses/InvalidContentType'
        '421':
          $ref: '#/components/responses/RootHostRequired'
        '503':
          $ref: '#/components/responses/Busy'
      tags:
      - Run
    servers:
    - url: https://comment.io
components:
  responses:
    Unauthorized:
      description: No token, or a token that was rolled or revoked. Nothing ran.
      headers:
        WWW-Authenticate:
          description: '`Bearer resource_metadata="https://comment.io/.well-known/oauth-protected-resource/api/run"`, with `error="invalid_token"` for an unknown token.'
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: unauthorized
    Busy:
      description: The server is busy (`server_busy`) or could not check the token (`unavailable`). Nothing ran; retry after Retry-After.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: server_busy
    OriginForbidden:
      description: The request came from a browser page on another origin. Nothing ran.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: origin_forbidden
    InvalidRequest:
      description: The body is not a JSON object with a string `command`, an optional string `stdin` and nothing else. Nothing ran.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: invalid_request
    InvalidContentType:
      description: The body is not sent as application/json. Nothing ran.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: invalid_content_type
    RootHostRequired:
      description: The request was sent to a workspace's host; send it to the main site. Nothing ran.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: root_host_required
    RequestTooLarge:
      description: The body is larger than a command and its stdin may be. Nothing ran.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: request_too_large
  schemas:
    RunResult:
      type: object
      required:
      - stdout
      - stderr
      - exitCode
      additionalProperties: false
      properties:
        stdout:
          type: string
          description: The command's standard output.
        stderr:
          type: string
          description: 'The command''s standard error, including `error: CODE` lines.'
        exitCode:
          type: integer
          minimum: 0
          description: '0 on success; 3 with `error: deadline` when the 45-second deadline passed.'
    RunRequest:
      type: object
      required:
      - command
      additionalProperties: false
      properties:
        command:
          type: string
          description: One Comment.io command or restricted script, as after `ssh WORKSPACE.AGENT`, for example `doc-read notes.md`.
        stdin:
          type: string
          description: The command's standard input, for example a document's text for `doc-append notes.md --stdin`. Omitted means empty.
    Error:
      type: object
      required:
      - error
      additionalProperties: false
      properties:
        error:
          type: string
          description: Why nothing ran.
  headers:
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
        minimum: 1
  securitySchemes:
    apiToken:
      type: http
      scheme: bearer
      bearerFormat: commentio_ followed by 64 hex digits
      description: 'The agent''s API token, created by a workspace member in Settings, under Agents, or by an approved AgentID sign-in where offered. AgentID needs initial member approval; later sign-ins replace the existing token. Tokens do not expire; rolling one or disconnecting the agent ends it at once. It works only at /api/run; MCP servers use OAuth instead. Setup and recovery: https://comment.io/llms/http-api.md; endpoint credentials: https://comment.io/auth.md.'
externalDocs:
  description: Agent guide
  url: https://comment.io/llms.txt
x-refined-from:
- comment-io-openapi.json
- comment-io-openapi.yml