{
  "openapi": "3.1.0",
  "info": {
    "title": "Output MCP API",
    "version": "1.1.0",
    "summary": "Create AI photos and videos from a selfie with Output templates, from AI assistants.",
    "description": "Output (https://theoutput.app) exposes one public API: a remote Model Context Protocol server (Streamable HTTP, stateless JSON-RPC 2.0 over POST). Assistants call MCP methods (initialize, tools/list, tools/call) on behalf of a signed-in Output user. Tools: search_templates, get_template, get_photo_upload_link, create_from_template, create_from_prompt, get_task, list_my_works, get_account. Generations spend the user's tokens or subscription. Docs: https://theoutput.app/mcp. Auth guide: https://theoutput.app/auth.md.",
    "contact": {
      "name": "Output support",
      "email": "support@theoutput.app",
      "url": "https://theoutput.app/o-servise"
    },
    "termsOfService": "https://theoutput.app/terms"
  },
  "externalDocs": {
    "description": "Output MCP documentation",
    "url": "https://theoutput.app/mcp"
  },
  "servers": [
    {
      "url": "https://mcp.theoutput.app",
      "description": "Output MCP server"
    }
  ],
  "security": [
    {
      "oauth2": [
        "templates:read",
        "account:read",
        "works:read",
        "generate"
      ]
    }
  ],
  "paths": {
    "/mcp": {
      "post": {
        "operationId": "mcpJsonRpc",
        "summary": "MCP JSON-RPC request (initialize, tools/list, tools/call)",
        "description": "Send a JSON-RPC 2.0 request or batch. Tools the token has no scope for are hidden from tools/list. Without a valid token the server answers 401 with WWW-Authenticate carrying resource_metadata and scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonRpcRequest"
              },
              "examples": {
                "listTools": {
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 1,
                    "method": "tools/list"
                  }
                },
                "searchTemplates": {
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 2,
                    "method": "tools/call",
                    "params": {
                      "name": "search_templates",
                      "arguments": {
                        "query": "новогоднее фото"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, expired or revoked token. See the WWW-Authenticate header."
          },
          "429": {
            "description": "Rate limited; retry later."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "description": "OAuth 2.1 authorization code with PKCE (S256); dynamic client registration at /oauth/register; public clients.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://mcp.theoutput.app/oauth/authorize",
            "tokenUrl": "https://mcp.theoutput.app/oauth/token",
            "refreshUrl": "https://mcp.theoutput.app/oauth/token",
            "scopes": {
              "templates:read": "View templates",
              "account:read": "See your name, token balance and subscription",
              "works:read": "See your works and generation status",
              "generate": "Create photos and videos: spends your tokens or subscription"
            }
          }
        }
      }
    },
    "schemas": {
      "JsonRpcRequest": {
        "type": "object",
        "required": [
          "jsonrpc",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "integer"
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "initialize",
              "notifications/initialized",
              "ping",
              "tools/list",
              "tools/call"
            ]
          },
          "params": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "JsonRpcResponse": {
        "type": "object",
        "required": [
          "jsonrpc"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "result": {
            "type": "object",
            "additionalProperties": true
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}