{
  "openapi": "3.1.0",
  "info": {
    "title": "Scrapigo API",
    "version": "1.0.0",
    "description": "Generate proxy lines, buy data with your credit and read your usage from your own tools. Authenticate with an API key created in the dashboard (https://app.scrapigo.cc/app/api). Responses to authenticated requests carry RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset (seconds), except 401 and 403; every response carries X-Request-Id. Limits per minute, per key / per account: reads 120/300, generation 60/120, purchases and quotes 10/10. Full guide: https://scrapigo.cc/docs/api"
  },
  "servers": [
    {
      "url": "https://api.scrapigo.cc/v1"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "Account",
      "description": "Your account, products and credentials"
    },
    {
      "name": "Proxies",
      "description": "Ready-to-use proxy lines"
    },
    {
      "name": "Purchases",
      "description": "Buy data with your credit"
    },
    {
      "name": "Stats",
      "description": "Your usage"
    },
    {
      "name": "Meta",
      "description": "This document"
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Account, credit, reserves and the key in use",
        "operationId": "getMe",
        "security": [
          {
            "bearer": [
              "read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/products": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Products, price grid and constraints",
        "operationId": "listProducts",
        "security": [
          {
            "bearer": [
              "read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Product"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/countries": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Countries served by products without their own country list",
        "operationId": "listCountries",
        "security": [
          {
            "bearer": [
              "read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Country"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/credentials": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Active proxy credentials (never the password)",
        "operationId": "listCredentials",
        "security": [
          {
            "bearer": [
              "read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Credential"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/proxies/generate": {
      "post": {
        "tags": [
          "Proxies"
        ],
        "summary": "Generate 1 to 10,000 ready-to-use proxy lines",
        "description": "Nothing is stored: a line is derived from your credential and read by the gateway when you connect. Sticky lines each get a distinct session alias, so N lines give N different IPs. Send `Accept: text/plain` to get one line per row.",
        "operationId": "generateProxies",
        "security": [
          {
            "bearer": [
              "generate"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lines",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/purchases": {
      "get": {
        "tags": [
          "Purchases"
        ],
        "summary": "Purchase history, most recent first",
        "operationId": "listPurchases",
        "security": [
          {
            "bearer": [
              "read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "nextCursor of the previous page"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Purchase"
                      }
                    },
                    "nextCursor": {
                      "type": "string"
                    },
                    "hasMore": {
                      "type": "boolean"
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Purchases"
        ],
        "summary": "Buy data for a product with your credit",
        "description": "Idempotent: retrying with the same Idempotency-Key and body returns the original purchase (200, Idempotent-Replayed: true) and never charges twice.",
        "operationId": "createPurchase",
        "security": [
          {
            "bearer": [
              "purchase"
            ]
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,64}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replay of an earlier purchase",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseResult"
                }
              }
            }
          },
          "201": {
            "description": "Purchased",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseResult"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/purchases/quote": {
      "post": {
        "tags": [
          "Purchases"
        ],
        "summary": "Price a purchase without buying",
        "operationId": "quotePurchase",
        "security": [
          {
            "bearer": [
              "read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/stats/summary": {
      "get": {
        "tags": [
          "Stats"
        ],
        "summary": "Totals for a period",
        "operationId": "statsSummary",
        "security": [
          {
            "bearer": [
              "read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/period"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Summary"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/stats/usage": {
      "get": {
        "tags": [
          "Stats"
        ],
        "summary": "Time series, one point per hour or day (empty buckets included)",
        "operationId": "statsUsage",
        "security": [
          {
            "bearer": [
              "read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "granularity",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "hour",
                "day"
              ],
              "default": "day"
            },
            "description": "hour: period 24h or 7d. day: today, 7d, 30d or 90d."
          },
          {
            "$ref": "#/components/parameters/period"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "period": {
                      "type": "string"
                    },
                    "from": {
                      "type": "integer",
                      "description": "Start of the counted window (Unix seconds). 7d = 7 UTC calendar days, today included."
                    },
                    "to": {
                      "type": "integer",
                      "description": "End of the counted window (Unix seconds, now)."
                    },
                    "granularity": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Point"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/stats/breakdown": {
      "get": {
        "tags": [
          "Stats"
        ],
        "summary": "Usage split by country, credential or product",
        "operationId": "statsBreakdown",
        "security": [
          {
            "bearer": [
              "read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "by",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "country",
                "credential",
                "product"
              ],
              "default": "country"
            },
            "description": "Covers up to 90 days on every axis."
          },
          {
            "$ref": "#/components/parameters/period"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "period": {
                      "type": "string"
                    },
                    "from": {
                      "type": "integer",
                      "description": "Start of the counted window (Unix seconds). 7d = 7 UTC calendar days, today included."
                    },
                    "to": {
                      "type": "integer",
                      "description": "End of the counted window (Unix seconds, now)."
                    },
                    "by": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BreakdownRow"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "tags": [
          "Meta"
        ],
        "summary": "This document",
        "operationId": "getOpenAPI",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key `sk_live_…`, created in the dashboard. Scopes: read, generate, purchase."
      }
    },
    "headers": {
      "RateLimit-Limit": {
        "schema": {
          "type": "integer"
        },
        "description": "Requests allowed in the current window"
      },
      "RateLimit-Remaining": {
        "schema": {
          "type": "integer"
        }
      },
      "RateLimit-Reset": {
        "schema": {
          "type": "integer"
        },
        "description": "Seconds until the window resets"
      }
    },
    "parameters": {
      "period": {
        "name": "period",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "24h",
            "today",
            "7d",
            "30d",
            "90d"
          ],
          "default": "7d"
        },
        "description": "UTC. 24h is the last 24 hourly buckets."
      }
    },
    "responses": {
      "Error": {
        "description": "Error. `code` is stable; `message` is for humans. 401 invalid_api_key, 403 account_suspended | ip_not_allowed | insufficient_scope, 429 rate_limited (see Retry-After), 400 bad_request | idempotency_key_required, 402 insufficient_credit, 404 not_found, 409 product_unavailable | no_credential | credential_password_unavailable, 422 sticky_required | country_not_allowed | contact_only | invalid_quantity | invalid_discount_code | spend_cap_exceeded | idempotency_key_reused.",
        "headers": {
          "X-Request-Id": {
            "schema": {
              "type": "string"
            }
          },
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "ByteCount": {
        "type": "string",
        "pattern": "^[0-9]+$",
        "description": "Bytes, as a decimal string (exceeds JavaScript integer precision)."
      },
      "USD": {
        "type": "string",
        "pattern": "^-?[0-9]+\\.[0-9]{2}$",
        "examples": [
          "12.50"
        ]
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "requestId": {
                "type": "string"
              }
            }
          }
        }
      },
      "Me": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "integer"
          },
          "creditUsd": {
            "$ref": "#/components/schemas/USD"
          },
          "reserves": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "product": {
                  "type": "string"
                },
                "remainingBytes": {
                  "$ref": "#/components/schemas/ByteCount"
                },
                "creditedBytes": {
                  "$ref": "#/components/schemas/ByteCount"
                }
              }
            }
          },
          "key": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "prefix": {
                "type": "string"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "read",
                    "generate",
                    "purchase"
                  ]
                }
              },
              "ipAllowlist": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "IP addresses or CIDR ranges allowed for this key; empty = any."
              },
              "dailySpendCapUsd": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/USD"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Daily spend cap of this key (UTC day), null = none."
              }
            }
          },
          "callerIp": {
            "type": "string",
            "description": "The IP the server sees for this request."
          }
        }
      },
      "Product": {
        "type": "object",
        "properties": {
          "product": {
            "type": "string",
            "examples": [
              "residential"
            ]
          },
          "available": {
            "type": "boolean"
          },
          "tiers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "minGb": {
                  "type": "integer"
                },
                "pricePerGbUsd": {
                  "$ref": "#/components/schemas/USD"
                }
              }
            }
          },
          "countries": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Empty: see GET /countries."
          },
          "stickyOnly": {
            "type": "boolean"
          }
        }
      },
      "Country": {
        "type": "object",
        "properties": {
          "iso": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "Credential": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "product": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "main",
              "sub"
            ]
          },
          "username": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "quotaBytes": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ByteCount"
              },
              {
                "type": "null"
              }
            ]
          },
          "quotaUsedBytes": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ByteCount"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "GenerateRequest": {
        "type": "object",
        "required": [
          "product"
        ],
        "additionalProperties": false,
        "properties": {
          "product": {
            "type": "string",
            "examples": [
              "residential"
            ]
          },
          "credentialId": {
            "type": "integer",
            "description": "Default: the product's main credential. A sub-user id is accepted."
          },
          "country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2, or any.",
            "default": "any"
          },
          "session": {
            "type": "string",
            "enum": [
              "rotating",
              "sticky"
            ],
            "default": "rotating"
          },
          "ttlMinutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 360,
            "default": 10,
            "description": "Sticky only."
          },
          "protocol": {
            "type": "string",
            "enum": [
              "http",
              "socks5"
            ],
            "default": "http"
          },
          "format": {
            "type": "string",
            "enum": [
              "user_pass_host_port",
              "host_port_user_pass",
              "protocol_host_port_user_pass",
              "url",
              "user_pass",
              "host_port",
              "custom"
            ],
            "default": "user_pass_host_port"
          },
          "template": {
            "type": "string",
            "maxLength": 256,
            "description": "Required with format custom. Tokens: {USER} {PASS} {HOST} {PORT} {PROTOCOL}."
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000,
            "default": 1
          }
        }
      },
      "PurchaseRequest": {
        "type": "object",
        "required": [
          "product",
          "gb"
        ],
        "additionalProperties": false,
        "properties": {
          "product": {
            "type": "string"
          },
          "gb": {
            "type": "number",
            "minimum": 0.5,
            "description": "Up to 3 decimals."
          },
          "code": {
            "type": "string",
            "description": "Optional discount code."
          }
        }
      },
      "Purchase": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "product": {
            "type": "string"
          },
          "gb": {
            "type": "number"
          },
          "pricePerGbUsd": {
            "$ref": "#/components/schemas/USD"
          },
          "discountUsd": {
            "$ref": "#/components/schemas/USD"
          },
          "totalUsd": {
            "$ref": "#/components/schemas/USD"
          },
          "discountCode": {
            "type": "string"
          },
          "apiKeyId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null for a purchase made in the dashboard."
          },
          "createdAt": {
            "type": "integer",
            "description": "Unix seconds"
          }
        }
      },
      "PurchaseResult": {
        "type": "object",
        "properties": {
          "purchase": {
            "$ref": "#/components/schemas/Purchase"
          },
          "creditUsd": {
            "$ref": "#/components/schemas/USD"
          },
          "reserve": {
            "type": "object",
            "properties": {
              "product": {
                "type": "string"
              },
              "remainingBytes": {
                "$ref": "#/components/schemas/ByteCount"
              }
            }
          }
        }
      },
      "Quote": {
        "type": "object",
        "properties": {
          "product": {
            "type": "string"
          },
          "gb": {
            "type": "number"
          },
          "pricePerGbUsd": {
            "$ref": "#/components/schemas/USD"
          },
          "subtotalUsd": {
            "$ref": "#/components/schemas/USD"
          },
          "discountUsd": {
            "$ref": "#/components/schemas/USD"
          },
          "totalUsd": {
            "$ref": "#/components/schemas/USD"
          },
          "creditUsd": {
            "$ref": "#/components/schemas/USD"
          },
          "creditAfterUsd": {
            "$ref": "#/components/schemas/USD"
          },
          "sufficient": {
            "type": "boolean"
          },
          "spendCapRemainingUsd": {
            "$ref": "#/components/schemas/USD",
            "description": "Keys with a daily spend cap only: what is left of it today (UTC day)."
          },
          "withinSpendCap": {
            "type": "boolean",
            "description": "Keys with a daily spend cap only: whether this purchase fits in it."
          }
        }
      },
      "Summary": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string"
          },
          "from": {
            "type": "integer",
            "description": "Start of the counted window (Unix seconds). 7d = 7 UTC calendar days, today included."
          },
          "to": {
            "type": "integer",
            "description": "End of the counted window (Unix seconds, now)."
          },
          "bytesUp": {
            "$ref": "#/components/schemas/ByteCount"
          },
          "bytesDown": {
            "$ref": "#/components/schemas/ByteCount"
          },
          "bytesTotal": {
            "$ref": "#/components/schemas/ByteCount"
          },
          "sessions": {
            "type": "integer",
            "description": "Tunnels opened"
          },
          "byProduct": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ByteCount"
            }
          }
        }
      },
      "Point": {
        "type": "object",
        "properties": {
          "ts": {
            "type": "integer",
            "description": "Bucket start, Unix seconds (UTC)"
          },
          "bytes": {
            "$ref": "#/components/schemas/ByteCount"
          },
          "sessions": {
            "type": "integer"
          },
          "byProduct": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ByteCount"
            }
          }
        }
      },
      "BreakdownRow": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "bytes": {
            "$ref": "#/components/schemas/ByteCount"
          },
          "sessions": {
            "type": "integer"
          }
        }
      }
    }
  }
}
