{
  "openapi": "3.1.0",
  "info": {
    "title": "Copy2LLM",
    "version": "0.3.0",
    "description": "HTTP surface of copy.computer: the Copy2LLM context-layer product site, docs, and MCP handshake. Extraction itself is client-side (copy2llm-core); there is no URL-fetch extract API.",
    "contact": {
      "name": "Vlad Arbatov",
      "url": "https://arbatov.dev",
      "email": "v.o.arbatov@gmail.com"
    },
    "license": {
      "name": "MIT",
      "url": "https://github.com/vladzima/copy2llm/blob/main/LICENSE"
    }
  },
  "servers": [
    {
      "url": "https://copy.computer"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "operationId": "getHomepage",
        "summary": "Product homepage",
        "description": "Copy2LLM homepage. Send Accept: text/markdown for the Markdown representation.",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "schema": {
              "type": "string",
              "example": "text/markdown"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Homepage HTML or Markdown",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "406": {
            "description": "No acceptable representation"
          }
        }
      }
    },
    "/docs": {
      "get": {
        "operationId": "getDocs",
        "summary": "Developer documentation",
        "description": "Install paths, OpenAPI, MCP, rate-limit conventions, and when to use Copy2LLM.",
        "responses": {
          "200": {
            "description": "Docs HTML or Markdown",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApi",
        "summary": "OpenAPI specification",
        "description": "This OpenAPI document, for function-calling clients.",
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "getLlmsTxt",
        "summary": "llms.txt",
        "description": "Agent index for Copy2LLM: when to use it and links to Markdown docs.",
        "responses": {
          "200": {
            "description": "llms.txt Markdown",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Health check",
        "description": "Liveness JSON with RFC 9118 RateLimit headers. Use this to confirm the Worker is up.",
        "responses": {
          "200": {
            "description": "Service is up",
            "headers": {
              "RateLimit": {
                "schema": {
                  "type": "string"
                },
                "description": "RFC 9118 RateLimit, e.g. \"default\";r=60;t=60"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "RFC 9118 RateLimit-Policy, e.g. \"default\";q=60;w=60"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "service": {
                      "type": "string"
                    }
                  },
                  "required": ["ok"]
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "get": {
        "operationId": "getMcpCard",
        "summary": "MCP server card",
        "description": "Static MCP server card for Streamable HTTP discovery. Same payload as GET /.well-known/mcp.",
        "responses": {
          "200": {
            "description": "MCP server card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postMcp",
        "summary": "MCP Streamable HTTP endpoint",
        "description": "JSON-RPC MCP endpoint. Start with method initialize, then tools/list or tools/call (get_install_snippet, get_docs).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["jsonrpc", "method"],
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "enum": ["2.0"]
                  },
                  "id": {},
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Notification accepted"
          },
          "400": {
            "description": "JSON-RPC or protocol error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/mcp": {
      "get": {
        "operationId": "getWellKnownMcp",
        "summary": "MCP well-known discovery",
        "description": "MCP server card at /.well-known/mcp for live handshake discovery.",
        "responses": {
          "200": {
            "description": "MCP server card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postWellKnownMcp",
        "summary": "MCP handshake at the well-known URL",
        "description": "Same Streamable HTTP MCP endpoint as POST /mcp, hosted at the well-known discovery URL.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message", "hint"],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "hint": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
