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

# Get usage

> Sum sessions, billed browser time and spending over the last 24 hours, 7, 30 and 90 days, and count sessions per hour or day for a chart. Sessions count by start time, spending by when the ledger posted the charge.



## OpenAPI

````yaml /api-reference/openapi.json get /billing/usage
openapi: 3.1.0
info:
  title: Surfsky API
  version: 0.1.0
  description: >-
    Start cloud browsers, control them through CDP, and manage the profiles,
    proxies, and fingerprints they run with.
servers:
  - url: '{baseUrl}'
    variables:
      baseUrl:
        default: https://YOUR_API_HOST
        description: API base URL from your Surfsky dashboard, including https://.
security:
  - ApiToken: []
tags:
  - name: scrape
    description: >-
      Fetch one page through a browser that is already running: a residential
      proxy and a desktop fingerprint, nothing kept between requests.
  - name: profiles
    description: >-
      Start, stop, and manage browsers. A one-time profile is discarded when it
      stops; a persistent profile keeps its cookies, storage, and fingerprint
      according to its storage settings.
  - name: proxies
    description: >-
      Look up available proxy locations and check traffic quotas for the premium
      and shared pools.
  - name: fingerprints
    description: >-
      Look up accepted renderer, screen, and device model values before
      configuring a fingerprint.
  - name: extensions
    description: Upload Chrome extensions once and load them into any browser you start.
  - name: billing
    description: >-
      Read the balance, the receipt of every session and scrape, usage over time
      windows and the ledger of charges and top-ups.
  - name: site-reports
    description: Tell the Surfsky team about a website that keeps blocking your browsers.
paths:
  /billing/usage:
    get:
      tags:
        - billing
      summary: Get usage
      description: >-
        Sum sessions, billed browser time and spending over the last 24 hours,
        7, 30 and 90 days, and count sessions per hour or day for a chart.
        Sessions count by start time, spending by when the ledger posted the
        charge.
      operationId: billing_usage_billing_usage_get
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Usage'
        '401':
          description: Missing or invalid API token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: Account or feature access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: Request validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    Usage:
      type: object
      properties:
        success:
          type: boolean
        msg:
          type: string
        data:
          type: object
          properties:
            on_demand:
              type: boolean
              description: As on the balance.
            windows:
              type: object
              properties:
                24h:
                  type: object
                  properties:
                    sessions:
                      type: integer
                      description: Sessions and scrapes started in the window.
                    browser_seconds:
                      type: integer
                      description: Billed browser time.
                    browser_minutes:
                      type: integer
                      description: browser_seconds in whole minutes.
                    browser_cost:
                      type: string
                      description: USD as a decimal string, such as "12.5".
                    premium_cost:
                      type: string
                      description: Premium proxy traffic charges.
                    captcha_cost:
                      type: string
                      description: Captcha solve charges.
                    total_spent:
                      type: string
                      description: The three costs added up.
                    premium_gb:
                      type: number
                      description: Premium proxy traffic in decimal GB, three decimals.
                  required:
                    - sessions
                    - browser_seconds
                    - browser_minutes
                    - browser_cost
                    - premium_cost
                    - captcha_cost
                    - total_spent
                    - premium_gb
                7d:
                  type: object
                  properties:
                    sessions:
                      type: integer
                      description: Sessions and scrapes started in the window.
                    browser_seconds:
                      type: integer
                      description: Billed browser time.
                    browser_minutes:
                      type: integer
                      description: browser_seconds in whole minutes.
                    browser_cost:
                      type: string
                      description: USD as a decimal string, such as "12.5".
                    premium_cost:
                      type: string
                      description: Premium proxy traffic charges.
                    captcha_cost:
                      type: string
                      description: Captcha solve charges.
                    total_spent:
                      type: string
                      description: The three costs added up.
                    premium_gb:
                      type: number
                      description: Premium proxy traffic in decimal GB, three decimals.
                  required:
                    - sessions
                    - browser_seconds
                    - browser_minutes
                    - browser_cost
                    - premium_cost
                    - captcha_cost
                    - total_spent
                    - premium_gb
                30d:
                  type: object
                  properties:
                    sessions:
                      type: integer
                      description: Sessions and scrapes started in the window.
                    browser_seconds:
                      type: integer
                      description: Billed browser time.
                    browser_minutes:
                      type: integer
                      description: browser_seconds in whole minutes.
                    browser_cost:
                      type: string
                      description: USD as a decimal string, such as "12.5".
                    premium_cost:
                      type: string
                      description: Premium proxy traffic charges.
                    captcha_cost:
                      type: string
                      description: Captcha solve charges.
                    total_spent:
                      type: string
                      description: The three costs added up.
                    premium_gb:
                      type: number
                      description: Premium proxy traffic in decimal GB, three decimals.
                  required:
                    - sessions
                    - browser_seconds
                    - browser_minutes
                    - browser_cost
                    - premium_cost
                    - captcha_cost
                    - total_spent
                    - premium_gb
                90d:
                  type: object
                  properties:
                    sessions:
                      type: integer
                      description: Sessions and scrapes started in the window.
                    browser_seconds:
                      type: integer
                      description: Billed browser time.
                    browser_minutes:
                      type: integer
                      description: browser_seconds in whole minutes.
                    browser_cost:
                      type: string
                      description: USD as a decimal string, such as "12.5".
                    premium_cost:
                      type: string
                      description: Premium proxy traffic charges.
                    captcha_cost:
                      type: string
                      description: Captcha solve charges.
                    total_spent:
                      type: string
                      description: The three costs added up.
                    premium_gb:
                      type: number
                      description: Premium proxy traffic in decimal GB, three decimals.
                  required:
                    - sessions
                    - browser_seconds
                    - browser_minutes
                    - browser_cost
                    - premium_cost
                    - captcha_cost
                    - total_spent
                    - premium_gb
              required:
                - 24h
                - 7d
                - 30d
                - 90d
              description: Totals over the trailing window.
            series:
              type: object
              properties:
                24h:
                  type: array
                  items:
                    type: object
                    properties:
                      at:
                        type: integer
                        description: Start of the hour or day in Unix seconds, UTC.
                      sessions:
                        type: integer
                    required:
                      - at
                      - sessions
                7d:
                  type: array
                  items:
                    type: object
                    properties:
                      at:
                        type: integer
                        description: Start of the hour or day in Unix seconds, UTC.
                      sessions:
                        type: integer
                    required:
                      - at
                      - sessions
                30d:
                  type: array
                  items:
                    type: object
                    properties:
                      at:
                        type: integer
                        description: Start of the hour or day in Unix seconds, UTC.
                      sessions:
                        type: integer
                    required:
                      - at
                      - sessions
              required:
                - 24h
                - 7d
                - 30d
              description: >-
                Sessions started per hour over 24 hours and per day over 7 and
                30 days, oldest first.
          required:
            - on_demand
            - windows
            - series
      required:
        - success
        - data
    ApiError:
      type: object
      properties:
        success:
          type: boolean
          const: false
        msg:
          type: string
        code:
          type: string
        data: {}
        detail: {}
        error: {}
      description: >-
        Error fields vary for forwarded responses. Check HTTP status and code
        when present.
  securitySchemes:
    ApiToken:
      type: apiKey
      in: header
      name: X-Cloud-Api-Token
      description: API token from your dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.