{
  "worker": "my-first-worker",
  "baseUrl": "https://my-first-worker.cap-8888.workers.dev",
  "timeoutMs": 12000,
  "defaults": {
    "refreshCookies": false,
    "flyBackup": false,
    "flyOnly": false,
    "openUrlMode": "worker"
  },
  "routes": [
    {
      "method": "GET",
      "path": "/status",
      "summary": "Live defaults and timeout."
    },
    {
      "method": "GET",
      "path": "/docs",
      "summary": "This HTML reference."
    },
    {
      "method": "GET",
      "path": "/docs.json",
      "summary": "Same reference as JSON (includes live defaults)."
    },
    {
      "method": "POST",
      "path": "/openUrl",
      "summary": "Fetch a Bybit URL. Default is worker only (direct CF → Bybit). Fly is opt-in. Query overrides body, body overrides env. flyOnly wins over flyBackup.",
      "query": {
        "flyOnly": "1 = skip worker, Fly only",
        "flyBackup": "1 = worker first, Fly on any failure (including WAF)",
        "refreshCookies": "1 = homepage cookie hop on non-WAF/timeout fail"
      },
      "body": {
        "url": "required https://api2.bybitglobal.com/… URL",
        "method": "ignored; always GET",
        "flyOnly": "same as ?flyOnly=",
        "flyBackup": "same as ?flyBackup=",
        "refreshCookies": "same as ?refreshCookies="
      },
      "headers": {
        "X-Trabo-OpenUrl-Mode": "worker | worker_then_fly | fly",
        "X-Trabo-Cookie-Source": "uuid | homepage | fly",
        "X-Trabo-Fly-Only": "0 | 1",
        "X-Trabo-Fly-Backup": "0 | 1",
        "X-Trabo-Fly-Detail": "Fly proxy URL when Fly was used",
        "X-Trabo-Refresh-Cookies": "0 | 1"
      },
      "errors": {
        "bybit-waf": "HTTP 429, Retry-After 60. If Fly backup also fails after a WAF, original WAF is rethrown.",
        "timeout": "HTTP 504 after 12s",
        "upstream-error": "HTTP 500"
      }
    },
    {
      "method": "POST",
      "path": "/axiosCookies",
      "summary": "Fetch a Bybit URL using stored secure-token cookies. Same flyBackup / flyOnly flags as /openUrl.",
      "query": {
        "username": "credential account name (required)",
        "flyBackup": "1 = worker first, Fly on any failure (including WAF)",
        "flyOnly": "1 = Fly only via proxy-service-auto"
      },
      "body": {
        "url": "required https://api2.bybitglobal.com/… URL",
        "flyBackup": "same as ?flyBackup=",
        "flyOnly": "same as ?flyOnly="
      }
    }
  ]
}