{
  "openapi": "3.1.0",
  "info": {
    "title": "airgap website API",
    "version": "0.2.0",
    "summary": "Read-only API for facts about airgap: its MCP tools, docs search, install and setup.",
    "description": "Public, unauthenticated, read-only API served by useairgap.dev. It answers questions about airgap and never runs code. To run commands in disposable microVMs, install the airgap binary and use its MCP tools. Errors are JSON objects of the form {\"error\":{\"code\",\"message\",\"docs\"}}.",
    "contact": {
      "name": "Dhruvil Mistry",
      "url": "https://www.useairgap.dev/contact",
      "email": "dhruvil@bydhruvil.in"
    },
    "license": {
      "name": "MIT OR Apache-2.0",
      "identifier": "MIT OR Apache-2.0"
    }
  },
  "externalDocs": {
    "description": "llms.txt",
    "url": "https://www.useairgap.dev/llms.txt"
  },
  "servers": [
    {
      "url": "https://www.useairgap.dev"
    }
  ],
  "tags": [
    {
      "name": "tools",
      "description": "The 8 tools of the airgap MCP server"
    },
    {
      "name": "docs",
      "description": "Search and question answering over the docs"
    },
    {
      "name": "setup",
      "description": "Install and client setup"
    },
    {
      "name": "meta",
      "description": "Service status"
    }
  ],
  "paths": {
    "/api/v1": {
      "get": {
        "operationId": "getApiIndex",
        "tags": [
          "meta"
        ],
        "summary": "List API endpoints",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiIndex"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/health": {
      "get": {
        "operationId": "getHealth",
        "tags": [
          "meta"
        ],
        "summary": "Service health",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools": {
      "get": {
        "operationId": "listAirgapTools",
        "tags": [
          "tools"
        ],
        "summary": "List airgap MCP tools",
        "description": "Returns every tool with when to use it, where it runs, the credentials it needs and its JSON input schema, plus agent routing rules.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "tools"
                  ],
                  "properties": {
                    "tools": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Tool"
                      }
                    },
                    "routing": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Route"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/{name}": {
      "get": {
        "operationId": "getAirgapTool",
        "tags": [
          "tools"
        ],
        "summary": "Get one airgap MCP tool",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "airgap_verify_pr",
                "airgap_verify_patch",
                "airgap_sandbox_run",
                "airgap_scan_injection",
                "airgap_audit_supply",
                "airgap_redact_secrets",
                "airgap_audit_repo",
                "airgap_configure"
              ]
            },
            "description": "Tool name"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tool"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/search": {
      "get": {
        "operationId": "searchDocs",
        "tags": [
          "docs"
        ],
        "summary": "Search the airgap docs",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "description": "Search text"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/install": {
      "get": {
        "operationId": "getInstallCommands",
        "tags": [
          "setup"
        ],
        "summary": "Get install commands",
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "macos",
                "linux",
                "windows",
                "npm",
                "cargo"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "install": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InstallCommand"
                      }
                    },
                    "next": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/setup": {
      "get": {
        "operationId": "getClientSetup",
        "tags": [
          "setup"
        ],
        "summary": "Get MCP client setup",
        "parameters": [
          {
            "name": "client",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "claude-code",
                "cursor",
                "vscode",
                "factory-droid",
                "other"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "setup": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/ask": {
      "get": {
        "operationId": "askGet",
        "tags": [
          "docs"
        ],
        "summary": "Ask a question (NLWeb)",
        "description": "NLWeb-compatible ask endpoint. Returns JSON by default; send streaming=true or Accept: text/event-stream for Server-Sent Events.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "streaming",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "askPost",
        "tags": [
          "docs"
        ],
        "summary": "Ask a question (NLWeb, POST)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string"
                  },
                  "streaming": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "Error": {
        "description": "Error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "docs": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "ApiIndex": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "endpoints": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "Health": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "service": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "Tool": {
        "type": "object",
        "required": [
          "name",
          "summary",
          "inputSchema"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "useWhen": {
            "type": "string"
          },
          "runsOn": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "needsCredentials": {
            "type": "string"
          },
          "inputSchema": {
            "type": "object"
          },
          "example": {
            "type": "object"
          }
        }
      },
      "Route": {
        "type": "object",
        "properties": {
          "when": {
            "type": "string"
          },
          "tool": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "SearchResult": {
        "type": "object",
        "required": [
          "url",
          "title",
          "text"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "section": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        }
      },
      "SearchResponse": {
        "type": "object",
        "required": [
          "query",
          "results"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchResult"
            }
          }
        }
      },
      "InstallCommand": {
        "type": "object",
        "properties": {
          "platform": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "command": {
            "type": "string"
          }
        }
      },
      "AskResponse": {
        "type": "object",
        "required": [
          "query_id",
          "results"
        ],
        "properties": {
          "_meta": {
            "type": "object"
          },
          "query_id": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "site": {
                  "type": "string"
                },
                "score": {
                  "type": "number"
                },
                "description": {
                  "type": "string"
                },
                "schema_object": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}
