{
  "openapi": "3.1.0",
  "info": {
    "title": "cors.tools",
    "version": "1.0.0",
    "description": "Free CORS proxy and URL reader. Fetch APIs across origins or convert webpages to Markdown, plain text and JSON with simple HTTP requests."
  },
  "servers": [
    {
      "url": "https://cors.tools"
    }
  ],
  "externalDocs": {
    "description": "API reference with request examples",
    "url": "https://cors.tools/docs"
  },
  "paths": {
    "/proxy": {
      "get": {
        "operationId": "proxy",
        "summary": "Proxy a public URL. Supports GET, HEAD, POST, PUT, PATCH, DELETE; the original body is forwarded. Cookies/Authorization require explicit X-Upstream-Cookie/X-Upstream-Authorization headers. 10 MiB output limit, 5 redirects, 20s deadline.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Public HTTP(S) destination.",
              "format": "uri",
              "example": "https://example.com"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "proxyPost",
        "summary": "Forward a request to a public HTTP(S) upstream. url is always a query parameter.",
        "requestBody": {
          "required": false,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "application/json": {
              "schema": {}
            },
            "text/plain": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Public HTTP(S) destination.",
              "format": "uri",
              "example": "https://example.com"
            }
          }
        ]
      },
      "put": {
        "operationId": "proxyPut",
        "summary": "Forward a request to a public HTTP(S) upstream. url is always a query parameter.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Public HTTP(S) destination.",
              "format": "uri",
              "example": "https://example.com"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "application/json": {
              "schema": {}
            },
            "text/plain": {
              "schema": {
                "type": "string"
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "proxyPatch",
        "summary": "Forward a request to a public HTTP(S) upstream. url is always a query parameter.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Public HTTP(S) destination.",
              "format": "uri",
              "example": "https://example.com"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "application/json": {
              "schema": {}
            },
            "text/plain": {
              "schema": {
                "type": "string"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "proxyDelete",
        "summary": "Forward a request to a public HTTP(S) upstream. url is always a query parameter.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Public HTTP(S) destination.",
              "format": "uri",
              "example": "https://example.com"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "application/json": {
              "schema": {}
            },
            "text/plain": {
              "schema": {
                "type": "string"
              }
            }
          }
        }
      },
      "head": {
        "operationId": "proxyHead",
        "summary": "Forward a request to a public HTTP(S) upstream. url is always a query parameter.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Public HTTP(S) destination.",
              "format": "uri",
              "example": "https://example.com"
            }
          }
        ]
      }
    },
    "/read": {
      "get": {
        "operationId": "readPageGet",
        "summary": "Extract article content from a public URL. render=true uses the browser service for JavaScript pages.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Public HTTP(S) destination.",
              "format": "uri",
              "example": "https://example.com"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Output.",
              "enum": [
                "markdown",
                "text",
                "json"
              ],
              "default": "markdown"
            }
          },
          {
            "name": "render",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "readPagePost",
        "summary": "Extract article content from a public URL. render=true uses the browser service for JavaScript pages.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Public HTTP(S) destination.",
                    "format": "uri",
                    "example": "https://example.com"
                  },
                  "format": {
                    "type": "string",
                    "description": "Output.",
                    "enum": [
                      "markdown",
                      "text",
                      "json"
                    ],
                    "default": "markdown"
                  },
                  "render": {
                    "type": "boolean",
                    "default": false
                  }
                },
                "required": [
                  "url"
                ]
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Public HTTP(S) destination.",
                    "format": "uri",
                    "example": "https://example.com"
                  },
                  "format": {
                    "type": "string",
                    "description": "Output.",
                    "enum": [
                      "markdown",
                      "text",
                      "json"
                    ],
                    "default": "markdown"
                  },
                  "render": {
                    "type": "boolean",
                    "default": false
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/{url}": {
      "get": {
        "operationId": "proxyPrefix",
        "summary": "Prefix a complete URL, e.g. /https://example.com/path?query=value. Equivalent to /proxy.",
        "parameters": [
          {
            "name": "url",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Public HTTP(S) destination.",
              "format": "uri",
              "example": "https://example.com"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/docs": {
      "get": {
        "operationId": "documentation",
        "summary": "Server-rendered HTML API reference.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/robots.txt": {
      "get": {
        "operationId": "robots",
        "summary": "Crawler access rules and sitemap location.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/sitemap.xml": {
      "get": {
        "operationId": "sitemap",
        "summary": "Public documentation sitemap.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Worker liveness (does not probe external dependencies).",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "agentGuide",
        "summary": "Plain-text agent usage guide.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "Error": {
        "description": "The request failed. See error.code and error.message for details.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
