{
  "openapi": "3.1.0",
  "info": {
    "title": "LangBot Agent Integration Overview",
    "version": "2026-05-09",
    "description": "Agent-oriented overview for LangBot and LangBot Space integration surfaces. See https://langbot.app/developers and https://docs.langbot.app for detailed product documentation.",
    "contact": {
      "name": "LangBot Team",
      "email": "hello@langbot.app",
      "url": "https://langbot.app"
    },
    "license": {
      "name": "Apache-2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    }
  },
  "servers": [
    {
      "url": "https://space.langbot.app",
      "description": "LangBot Space and Cloud hosted API"
    },
    {
      "url": "https://{selfHostedDomain}",
      "description": "Self-hosted LangBot instance",
      "variables": {
        "selfHostedDomain": {
          "default": "your-langbot.example.com"
        }
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "apiKeyAuth": []
    }
  ],
  "x-rateLimitPolicy": {
    "selfHosted": "No universal public LangBot rate limit is imposed by default. Operators, model providers, messaging adapters, and plugins may define their own limits.",
    "cloud": "LangBot Cloud applies fair-use and plan-based resource limits. Clients should back off on HTTP 429 and respect Retry-After when present."
  },
  "x-streamingSupport": {
    "summary": "LangBot can forward streaming model/provider output when the runner, provider, and messaging adapter support it. Clients should also support non-streaming final responses."
  },
  "paths": {
    "/api/v1/accounts/token/auth": {
      "post": {
        "summary": "Authorize a device or LangBot instance with a user code",
        "description": "Used by LangBot Space authorization flows. Exact request fields may evolve; prefer official docs and product UI for current flows.",
        "tags": ["Auth"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user_code": {"type": "string"}
                },
                "required": ["user_code"]
              }
            }
          }
        },
        "responses": {
          "200": {"$ref": "#/components/responses/Success"},
          "400": {"$ref": "#/components/responses/Error"},
          "401": {"$ref": "#/components/responses/Error"},
          "429": {"$ref": "#/components/responses/Error"}
        }
      }
    },
    "/api/v1/accounts/oauth/authorize": {
      "post": {
        "summary": "Generate an OAuth authorization code for an instance callback",
        "tags": ["Auth"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "redirect_uri": {"type": "string", "format": "uri"}
                },
                "required": ["redirect_uri"]
              }
            }
          }
        },
        "responses": {
          "200": {"$ref": "#/components/responses/Success"},
          "400": {"$ref": "#/components/responses/Error"},
          "401": {"$ref": "#/components/responses/Error"}
        }
      }
    },
    "/api/v1/cloud/plans": {
      "get": {
        "summary": "List public LangBot Cloud plans",
        "tags": ["Cloud"],
        "security": [],
        "responses": {
          "200": {"$ref": "#/components/responses/Success"},
          "429": {"$ref": "#/components/responses/Error"}
        }
      }
    },
    "/api/v1/cloud/pods": {
      "get": {
        "summary": "List the current account's LangBot Cloud instances",
        "tags": ["Cloud"],
        "responses": {
          "200": {"$ref": "#/components/responses/Success"},
          "401": {"$ref": "#/components/responses/Error"},
          "429": {"$ref": "#/components/responses/Error"}
        }
      },
      "post": {
        "summary": "Create a managed LangBot Cloud instance",
        "tags": ["Cloud"],
        "responses": {
          "200": {"$ref": "#/components/responses/Success"},
          "400": {"$ref": "#/components/responses/Error"},
          "401": {"$ref": "#/components/responses/Error"},
          "429": {"$ref": "#/components/responses/Error"}
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      },
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Use `Bearer <token>` when API-key access is enabled."
      }
    },
    "responses": {
      "Success": {
        "description": "Successful JSON response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "code": {"type": "integer", "examples": [0]},
                "message": {"type": "string", "examples": ["ok"]},
                "data": {"type": ["object", "array", "null"]}
              }
            }
          }
        }
      },
      "Error": {
        "description": "JSON error response. Retry with backoff for 429 responses and respect Retry-After when present.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before retrying, when available.",
            "schema": {"type": "integer"}
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "code": {"type": "integer"},
                "message": {"type": "string"},
                "data": {"type": "null"}
              },
              "required": ["code", "message"]
            }
          }
        }
      }
    }
  }
}
