{
  "openapi": "3.1.0",
  "info": {
    "title": "OneLineChat API",
    "version": "1.0.0",
    "description": "Request a OneLineChat key, an install, or Pro checkout. No account or auth needed. Docs: https://onelinechat.com/install.md"
  },
  "servers": [
    {
      "url": "https://onelinechat.com"
    }
  ],
  "paths": {
    "/api/v1/keys": {
      "post": {
        "operationId": "requestApiKey",
        "summary": "Request a free public API key",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "User's email. The key and updates are sent here."
                  },
                  "site": {
                    "type": "string",
                    "description": "Site URL or domain where the widget will run. localhost and preview domains are fine."
                  },
                  "platform": {
                    "type": "string",
                    "description": "nextjs | react-vite | html | lovable | bolt | v0 | replit | wordpress | webflow | framer | other"
                  },
                  "agent": {
                    "type": "string",
                    "description": "Name of the AI agent making the call, e.g. claude-code, cursor, chatgpt."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. During early access the body has status \"coming_soon\" and tells the agent what to tell the user."
          },
          "400": {
            "description": "Missing or invalid field; message says what to ask the user."
          }
        }
      }
    },
    "/api/v1/installs": {
      "post": {
        "operationId": "requestInstall",
        "summary": "Request a done-for-you install",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "site"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "User's email. The key and updates are sent here."
                  },
                  "site": {
                    "type": "string",
                    "description": "Site URL or domain where the widget will run. localhost and preview domains are fine."
                  },
                  "platform": {
                    "type": "string",
                    "description": "nextjs | react-vite | html | lovable | bolt | v0 | replit | wordpress | webflow | framer | other"
                  },
                  "agent": {
                    "type": "string",
                    "description": "Name of the AI agent making the call, e.g. claude-code, cursor, chatgpt."
                  },
                  "notes": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. During early access the body has status \"coming_soon\" and tells the agent what to tell the user."
          }
        }
      }
    },
    "/api/v1/checkout": {
      "post": {
        "operationId": "startCheckout",
        "summary": "Start Pro checkout ($39/month, Stripe)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "plan": {
                    "type": "string",
                    "enum": [
                      "pro"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. During early access the body has status \"coming_soon\" and tells the agent what to tell the user."
          }
        }
      }
    }
  }
}