> ## Documentation Index
> Fetch the complete documentation index at: https://webscrape.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Current SmartBrowse plan caps and 30-day usage

> Returns the caller's rolling-30-day run count, plan caps
(runs/month, pages/run, cost/page), schedule allowance, and a
summary of their last run (if any).

Polling is free — `credits_used` is always 0.




## OpenAPI

````yaml /openapi.yaml get /smartbrowse/usage
openapi: 3.1.0
info:
  title: webscrape.ai API
  version: '1.0'
  description: |
    The public webscrape.ai API. Fetch pages and get back structured JSON,
    HTML, markdown, or replayed browser output.

    Every response is wrapped in one of three envelope shapes —
    `completed`, `queued`, or `error`. Always check the top-level
    `status` first, then read `data` (success or queued) or `error`
    (failure).
  contact:
    name: webscrape.ai support
    email: hello@webscrape.ai
    url: https://webscrape.ai
servers:
  - url: https://api.webscrape.ai/v1
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Scrape
    description: Raw fetching and structured extraction.
  - name: SmartBrowse
    description: Real-Chrome recipe replay with pagination and interactions.
paths:
  /smartbrowse/usage:
    get:
      tags:
        - SmartBrowse
      summary: Current SmartBrowse plan caps and 30-day usage
      description: |
        Returns the caller's rolling-30-day run count, plan caps
        (runs/month, pages/run, cost/page), schedule allowance, and a
        summary of their last run (if any).

        Polling is free — `credits_used` is always 0.
      operationId: getSmartBrowseUsage
      responses:
        '200':
          description: Usage returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmartBrowseUsageSuccess'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    SmartBrowseUsageSuccess:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          required:
            - data
            - credits_used
            - credits_remaining
          properties:
            status:
              type: string
              enum:
                - completed
            data:
              $ref: '#/components/schemas/SmartBrowseUsageData'
            credits_used:
              type: integer
              description: Always 0 — polling usage is free.
              example: 0
            credits_remaining:
              type: integer
    EnvelopeBase:
      type: object
      required:
        - status
        - request_id
      properties:
        status:
          type: string
          enum:
            - completed
            - queued
            - error
          description: Discriminator for the envelope variant.
        request_id:
          type: string
          example: req_aB3xY9Kp
          description: |
            Per-request id. Also returned as the `X-Request-ID` response
            header. Include it when reporting issues.
    SmartBrowseUsageData:
      type: object
      required:
        - runs_used_30d
        - runs_per_month_cap
        - pages_per_run_cap
        - cost_per_page
        - schedules_count
        - schedules_allowed
      properties:
        runs_used_30d:
          type: integer
          description: Runs initiated by this account in the last 30 days.
        runs_per_month_cap:
          type: integer
          description: Hard ceiling from the caller's current plan.
        pages_per_run_cap:
          type: integer
          description: Per-run page ceiling from the caller's current plan.
        cost_per_page:
          type: integer
          description: Credit cost per extracted page.
        schedules_count:
          type: integer
          description: Number of enabled recurring schedules on this account.
        schedules_allowed:
          type: boolean
          description: Whether the caller's plan allows recurring schedules.
        last_run:
          oneOf:
            - $ref: '#/components/schemas/SmartBrowseLastRun'
            - type: 'null'
          description: The most recent run, or null when the account has never run.
    EnvelopeError:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          required:
            - error
          properties:
            status:
              type: string
              enum:
                - error
            error:
              type: object
              required:
                - code
                - message
              properties:
                code:
                  $ref: '#/components/schemas/ErrorCode'
                message:
                  type: string
                  description: >-
                    Human-readable. May change between releases. Log it; don't
                    pattern-match.
                details:
                  description: >-
                    Optional structured context (e.g. `{balance, required}` for
                    `insufficient_credits`).
    SmartBrowseLastRun:
      type: object
      required:
        - id
        - status
        - pages_extracted
        - effective_cap
        - clamped_by_credits
        - created_at
      properties:
        id:
          type: string
          example: k7Xb9dRmQ2p
          description: Opaque run ID (~11 base62 chars).
        status:
          $ref: '#/components/schemas/SmartBrowseRunStatus'
        pages_extracted:
          type: integer
        effective_cap:
          type: integer
          description: |
            Page ceiling actually applied to this run — `min(plan
            pages/run, balance / cost_per_page)`. May be lower than the
            plan cap when the caller's balance was thin at dispatch.
        clamped_by_credits:
          type: boolean
          description: |
            True when `effective_cap < plan.pages_per_run_cap` at dispatch
            — i.e. credits, not the plan, was the binding constraint.
        created_at:
          type: string
          format: date-time
        completed_at:
          type: string
          format: date-time
          description: Omitted while the run is still in flight.
    ErrorCode:
      type: string
      description: Stable error code. SDKs branch on this.
      enum:
        - invalid_request
        - unauthorized
        - insufficient_credits
        - email_verification_required
        - forbidden
        - not_found
        - conflict
        - account_deletion_pending
        - validation_failed
        - rate_limited
        - internal_error
        - service_unavailable
    SmartBrowseRunStatus:
      type: string
      enum:
        - queued
        - running
        - completed
        - failed
        - cancelled
      description: |
        Run lifecycle state. Renamed from `status` to avoid colliding
        with the envelope's outer `status`. `cancelled` appears when the
        run was force-stopped (e.g. account deletion confirmed while a
        run was in flight); `failed` covers everything else terminal.
  responses:
    Unauthorized:
      description: Missing, invalid, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EnvelopeError'
          example:
            status: error
            error:
              code: unauthorized
              message: missing or invalid credentials
            request_id: req_aB3xY9Kp
    InternalError:
      description: Internal server error. Safe to retry with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EnvelopeError'
          example:
            status: error
            error:
              code: internal_error
              message: internal error
            request_id: req_aB3xY9Kp
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: |
        Generate from the [dashboard](https://webscrape.ai/app/api-keys).
        Format: `wsg_live_<32 base62 chars>`.

````