{
  "openapi": "3.1.0",
  "info": {
    "title": "api.xuchunyang.me",
    "version": "1.0.0",
    "description": "httpbin-style test API on Cloudflare Workers. JSON responses are 2-space indented, CORS *, no auth. `?seed=` makes random endpoints deterministic. Invalid params → 400 JSON. Rate limit: 120 requests per 60 s per client IP (/ and /openapi.json exempt); exceeding returns 429 with Retry-After.",
    "license": {
      "name": "MIT",
      "identifier": "MIT"
    }
  },
  "servers": [
    {
      "url": "https://api.xuchunyang.me"
    },
    {
      "url": "http://api.xuchunyang.me"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "HTTP",
      "description": "HTTP"
    },
    {
      "name": "Data",
      "description": "Data"
    },
    {
      "name": "Images",
      "description": "Images"
    },
    {
      "name": "Geo",
      "description": "Geo"
    },
    {
      "name": "Files",
      "description": "Files"
    },
    {
      "name": "Meta",
      "description": "Meta"
    }
  ],
  "paths": {
    "/anything": {
      "get": {
        "operationId": "anything_get",
        "summary": "Echo the request",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "anything_post",
        "summary": "Echo the request",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      },
      "put": {
        "operationId": "anything_put",
        "summary": "Echo the request",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      },
      "patch": {
        "operationId": "anything_patch",
        "summary": "Echo the request",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      },
      "delete": {
        "operationId": "anything_delete",
        "summary": "Echo the request",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      }
    },
    "/anything/{path}": {
      "get": {
        "operationId": "anythingPath_get",
        "summary": "Echo the request (any sub-path)",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "Any sub-path",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "anythingPath_post",
        "summary": "Echo the request (any sub-path)",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "Any sub-path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      },
      "put": {
        "operationId": "anythingPath_put",
        "summary": "Echo the request (any sub-path)",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "Any sub-path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      },
      "patch": {
        "operationId": "anythingPath_patch",
        "summary": "Echo the request (any sub-path)",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "Any sub-path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      },
      "delete": {
        "operationId": "anythingPath_delete",
        "summary": "Echo the request (any sub-path)",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "Any sub-path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      }
    },
    "/get": {
      "get": {
        "operationId": "get_get",
        "summary": "Echo the request",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "get_post",
        "summary": "Echo the request",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      },
      "put": {
        "operationId": "get_put",
        "summary": "Echo the request",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      },
      "patch": {
        "operationId": "get_patch",
        "summary": "Echo the request",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      },
      "delete": {
        "operationId": "get_delete",
        "summary": "Echo the request",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      }
    },
    "/post": {
      "get": {
        "operationId": "post_get",
        "summary": "Echo the request (body parsed as JSON/form)",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "post_post",
        "summary": "Echo the request (body parsed as JSON/form)",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      },
      "put": {
        "operationId": "post_put",
        "summary": "Echo the request (body parsed as JSON/form)",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      },
      "patch": {
        "operationId": "post_patch",
        "summary": "Echo the request (body parsed as JSON/form)",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      },
      "delete": {
        "operationId": "post_delete",
        "summary": "Echo the request (body parsed as JSON/form)",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "*/*": {
              "schema": {}
            }
          }
        }
      }
    },
    "/headers": {
      "get": {
        "operationId": "headers",
        "summary": "Request headers",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Headers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "headers": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/ip": {
      "get": {
        "operationId": "ip",
        "summary": "Caller IP with Cloudflare geo/ASN details",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "IP info",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ip": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "origin": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "city": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "region": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "region_code": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "continent": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "postal": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "loc": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timezone": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "org": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "colo": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "http_protocol": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tls": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "version": {
                      "enum": [
                        4,
                        6,
                        null
                      ]
                    },
                    "asn": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/status/{code}": {
      "get": {
        "operationId": "status",
        "summary": "Respond with the given status (1xx → 400)",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Status echoed (any 2xx–5xx code is returned as-is; 204/205/304 have no body)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "HTTP status",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 599
            }
          }
        ]
      }
    },
    "/delay/{s}": {
      "get": {
        "operationId": "delay",
        "summary": "Wait s seconds, then echo",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "200": {
            "description": "Echo of the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Echo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "required": true,
            "description": "Seconds",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10
            }
          }
        ]
      }
    },
    "/redirect/{n}": {
      "get": {
        "operationId": "redirect",
        "summary": "302 chain of n hops ending at /get",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "302": {
            "description": "Redirect to /redirect/{n-1} or /get",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "n",
            "in": "path",
            "required": true,
            "description": "Hops",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10
            }
          }
        ]
      }
    },
    "/mock": {
      "get": {
        "operationId": "mock_get",
        "summary": "Custom response",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "description": "The configured response",
            "content": {
              "*/*": {
                "schema": {}
              }
            }
          }
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Response status (1xx → 400)",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 599,
              "default": 200
            }
          },
          {
            "name": "body",
            "in": "query",
            "required": false,
            "description": "Raw response body (≤64 KB). If valid JSON and no content_type, returned as pretty-printed application/json, else text/plain",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "content_type",
            "in": "query",
            "required": false,
            "description": "Override Content-Type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "header",
            "in": "query",
            "description": "Response header \"Name: value\", repeatable. Content-Length, Transfer-Encoding and hop-by-hop headers are rejected",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "delay",
            "in": "query",
            "required": false,
            "description": "Seconds to wait",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10,
              "default": 0
            }
          }
        ]
      },
      "post": {
        "operationId": "mock_post",
        "summary": "Custom response",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "description": "The configured response",
            "content": {
              "*/*": {
                "schema": {}
              }
            }
          }
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Response status (1xx → 400)",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 599,
              "default": 200
            }
          },
          {
            "name": "body",
            "in": "query",
            "required": false,
            "description": "Raw response body (≤64 KB). If valid JSON and no content_type, returned as pretty-printed application/json, else text/plain",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "content_type",
            "in": "query",
            "required": false,
            "description": "Override Content-Type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "header",
            "in": "query",
            "description": "Response header \"Name: value\", repeatable. Content-Length, Transfer-Encoding and hop-by-hop headers are rejected",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "delay",
            "in": "query",
            "required": false,
            "description": "Seconds to wait",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10,
              "default": 0
            }
          }
        ],
        "requestBody": {
          "required": false,
          "description": "Alternative to query params when sent as application/json",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MockSpec"
              }
            }
          }
        }
      },
      "put": {
        "operationId": "mock_put",
        "summary": "Custom response",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "description": "The configured response",
            "content": {
              "*/*": {
                "schema": {}
              }
            }
          }
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Response status (1xx → 400)",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 599,
              "default": 200
            }
          },
          {
            "name": "body",
            "in": "query",
            "required": false,
            "description": "Raw response body (≤64 KB). If valid JSON and no content_type, returned as pretty-printed application/json, else text/plain",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "content_type",
            "in": "query",
            "required": false,
            "description": "Override Content-Type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "header",
            "in": "query",
            "description": "Response header \"Name: value\", repeatable. Content-Length, Transfer-Encoding and hop-by-hop headers are rejected",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "delay",
            "in": "query",
            "required": false,
            "description": "Seconds to wait",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10,
              "default": 0
            }
          }
        ]
      },
      "patch": {
        "operationId": "mock_patch",
        "summary": "Custom response",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "description": "The configured response",
            "content": {
              "*/*": {
                "schema": {}
              }
            }
          }
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Response status (1xx → 400)",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 599,
              "default": 200
            }
          },
          {
            "name": "body",
            "in": "query",
            "required": false,
            "description": "Raw response body (≤64 KB). If valid JSON and no content_type, returned as pretty-printed application/json, else text/plain",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "content_type",
            "in": "query",
            "required": false,
            "description": "Override Content-Type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "header",
            "in": "query",
            "description": "Response header \"Name: value\", repeatable. Content-Length, Transfer-Encoding and hop-by-hop headers are rejected",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "delay",
            "in": "query",
            "required": false,
            "description": "Seconds to wait",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10,
              "default": 0
            }
          }
        ]
      },
      "delete": {
        "operationId": "mock_delete",
        "summary": "Custom response",
        "tags": [
          "HTTP"
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "description": "The configured response",
            "content": {
              "*/*": {
                "schema": {}
              }
            }
          }
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Response status (1xx → 400)",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 599,
              "default": 200
            }
          },
          {
            "name": "body",
            "in": "query",
            "required": false,
            "description": "Raw response body (≤64 KB). If valid JSON and no content_type, returned as pretty-printed application/json, else text/plain",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "content_type",
            "in": "query",
            "required": false,
            "description": "Override Content-Type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "header",
            "in": "query",
            "description": "Response header \"Name: value\", repeatable. Content-Length, Transfer-Encoding and hop-by-hop headers are rejected",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "delay",
            "in": "query",
            "required": false,
            "description": "Seconds to wait",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10,
              "default": 0
            }
          }
        ]
      }
    },
    "/time": {
      "get": {
        "operationId": "time",
        "summary": "Current time",
        "tags": [
          "Data"
        ],
        "responses": {
          "200": {
            "description": "Time",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "iso": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "unix": {
                      "type": "integer"
                    },
                    "unix_ms": {
                      "type": "integer"
                    },
                    "tz": {
                      "type": "string"
                    },
                    "local": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "tz",
            "in": "query",
            "required": false,
            "description": "IANA timezone",
            "schema": {
              "type": "string",
              "default": "Asia/Shanghai"
            }
          }
        ]
      }
    },
    "/uuid": {
      "get": {
        "operationId": "uuid",
        "summary": "UUIDv4s",
        "tags": [
          "Data"
        ],
        "responses": {
          "200": {
            "description": "UUIDs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "uuids": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "n",
            "in": "query",
            "required": false,
            "description": "Count",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 1
            }
          },
          {
            "$ref": "#/components/parameters/seed"
          }
        ]
      }
    },
    "/color": {
      "get": {
        "operationId": "color",
        "summary": "Random color",
        "tags": [
          "Data"
        ],
        "responses": {
          "200": {
            "description": "Color",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "hex": {
                      "type": "string"
                    },
                    "rgb": {
                      "type": "string"
                    },
                    "hsl": {
                      "type": "string"
                    }
                  }
                }
              },
              "image/svg+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json (default) or svg",
            "schema": {
              "enum": [
                "json",
                "svg"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/seed"
          }
        ]
      }
    },
    "/logo": {
      "get": {
        "operationId": "logo",
        "summary": "SVG initials logo",
        "tags": [
          "Data"
        ],
        "responses": {
          "200": {
            "description": "SVG",
            "content": {
              "image/svg+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": false,
            "description": "Up to 4 chars",
            "schema": {
              "type": "string",
              "default": "AB",
              "maxLength": 4
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "description": "Pixels",
            "schema": {
              "type": "integer",
              "minimum": 16,
              "maximum": 1024,
              "default": 128
            }
          },
          {
            "$ref": "#/components/parameters/seed"
          }
        ]
      }
    },
    "/quote": {
      "get": {
        "operationId": "quote",
        "summary": "Random quote",
        "tags": [
          "Data"
        ],
        "responses": {
          "200": {
            "description": "Quote",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string"
                    },
                    "author": {
                      "type": "string"
                    },
                    "lang": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Language",
            "schema": {
              "enum": [
                "en",
                "zh"
              ],
              "default": "en"
            }
          },
          {
            "$ref": "#/components/parameters/seed"
          }
        ]
      }
    },
    "/bytes/{n}": {
      "get": {
        "operationId": "bytes",
        "summary": "n random bytes",
        "tags": [
          "Data"
        ],
        "responses": {
          "200": {
            "description": "Bytes",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "n",
            "in": "path",
            "required": true,
            "description": "Byte count",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1048576
            }
          },
          {
            "$ref": "#/components/parameters/seed"
          }
        ]
      }
    },
    "/image": {
      "get": {
        "operationId": "image",
        "summary": "Picsum photo",
        "tags": [
          "Images"
        ],
        "responses": {
          "302": {
            "description": "Redirect to the image",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "w",
            "in": "query",
            "required": false,
            "description": "Width",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 4096,
              "default": 640
            }
          },
          {
            "name": "h",
            "in": "query",
            "required": false,
            "description": "Height",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 4096,
              "default": 480
            }
          },
          {
            "name": "seed",
            "in": "query",
            "description": "Image seed",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/cat": {
      "get": {
        "operationId": "cat",
        "summary": "Cataas cat image",
        "tags": [
          "Images"
        ],
        "responses": {
          "302": {
            "description": "Redirect to the image",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "description": "Upstream provider unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "w",
            "in": "query",
            "required": false,
            "description": "Width (alias width)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 4096
            }
          },
          {
            "name": "h",
            "in": "query",
            "required": false,
            "description": "Height (alias height)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 4096
            }
          },
          {
            "$ref": "#/components/parameters/seed"
          }
        ]
      }
    },
    "/dog": {
      "get": {
        "operationId": "dog",
        "summary": "Dog CEO image",
        "tags": [
          "Images"
        ],
        "responses": {
          "200": {
            "description": "Image URL (format=json)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "format": "uri"
                    },
                    "status": {
                      "const": "success"
                    }
                  }
                }
              }
            }
          },
          "302": {
            "description": "Redirect to the image",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "description": "Upstream provider unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json returns the URL instead of redirecting",
            "schema": {
              "enum": [
                "json"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/seed"
          }
        ]
      }
    },
    "/geo/me": {
      "get": {
        "operationId": "geoMe",
        "summary": "Cloudflare location of the caller",
        "tags": [
          "Geo"
        ],
        "responses": {
          "200": {
            "description": "Location",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "city": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "region": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "latitude": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "longitude": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timezone": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "colo": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "asn": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/geo/countries": {
      "get": {
        "operationId": "countries",
        "summary": "All countries",
        "tags": [
          "Geo"
        ],
        "responses": {
          "200": {
            "description": "Countries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Country"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/geo/random": {
      "get": {
        "operationId": "randomCountry",
        "summary": "Random country",
        "tags": [
          "Geo"
        ],
        "responses": {
          "200": {
            "description": "Country",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Country"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/seed"
          }
        ]
      }
    },
    "/geo/country/{code}": {
      "get": {
        "operationId": "country",
        "summary": "Country by ISO2/ISO3",
        "tags": [
          "Geo"
        ],
        "responses": {
          "200": {
            "description": "Country",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Country"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "ISO 3166 alpha-2 or alpha-3",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/files/{name}": {
      "get": {
        "operationId": "file",
        "summary": "Static sample file",
        "tags": [
          "Files"
        ],
        "responses": {
          "200": {
            "description": "File",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "image/svg+xml": {
                "schema": {
                  "type": "string"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "description": "Not found"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "File name",
            "schema": {
              "enum": [
                "sample.json",
                "sample.csv",
                "sample.txt",
                "sample.svg",
                "sample.png"
              ]
            }
          }
        ]
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "openapi",
        "summary": "This OpenAPI document (not rate limited)",
        "tags": [
          "Meta"
        ],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "seed": {
        "name": "seed",
        "in": "query",
        "required": false,
        "description": "Deterministic randomness seed",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid parameter",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limit exceeded (120 req / 60 s per IP)",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error",
                "retry_after"
              ],
              "properties": {
                "error": {
                  "type": "string"
                },
                "retry_after": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "Echo": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "args": {
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            }
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "body": {
            "type": "string"
          },
          "json": {},
          "form": {
            "type": "object"
          },
          "origin": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MockSpec": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599,
            "default": 200
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "body": {
            "description": "String, or any JSON value (serialized)"
          },
          "content_type": {
            "type": "string"
          },
          "delay": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10,
            "default": 0
          }
        }
      },
      "Country": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "name_zh": {
            "type": "string"
          },
          "iso2": {
            "type": "string"
          },
          "iso3": {
            "type": "string"
          },
          "flag": {
            "type": "string"
          },
          "capital": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "calling_code": {
            "type": "string"
          }
        }
      }
    }
  }
}
