{
  "openapi": "3.0.1",
  "info": {
    "title": "Mintlify Discovery API",
    "description": "An API to integrate Mintlify discovery features into your product.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api-dsc.mintlify.com/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/chat/topic": {
      "post": {
        "summary": "Create a chat topic",
        "description": "Creates a topic to manage message history for a given AI chat conversation.",
        "responses": {
          "200": {
            "description": "Topic created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "topicId": {
                      "type": "string",
                      "description": "The id of the created topic."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/chat/message": {
      "post": {
        "summary": "Generate a message completion",
        "description": "Generate a completion in response to a user query",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["topicId", "message"],
                "properties": {
                  "topicId": {
                    "type": "string",
                    "description": "The topic ID to associate this message with"
                  },
                  "message": {
                    "type": "string",
                    "description": "The user message to generate a completion for"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Topic created successfully",
            "headers": {
              "X-Mintlify-Base-Url": {
                "schema": {
                  "type": "string"
                },
                "description": "The base URL for the Mintlify documentation"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "A text stream in the form `<response>||[chunks]`. The chunks are parts of your docs that most closely matched the user query. Each has the following format: \n ```\n { \n \tid: string;\n \tlink: string;\n \tchunk_html: string;\n \tmetadata: {\n \t\ttitle?: string\n \t}\n} \n``` \n The links are relative links with your docs URL intended as the host. To get an absolute link to your docs, you can use the `X-Mintlify-Base-Url` header as the host and construct a fully-qualified URL."
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
