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

# Credits burned

> Retrieve credits burned per day, broken down by tier. Each item holds one date and a `data` array whose `key` is the tier number (`"1"`, `"2"`, `"3"`) and whose `value` is the credits burned on that tier. The date range may span at most 365 days.

If the API key is restricted to specific packages, results (and any `package_ids` filter) are limited to those packages.

Requires the `proxy:analytics:read` scope.



## OpenAPI

````yaml api/openapi.json POST /v1/proxy/analytics/credits-burned
openapi: 3.1.0
info:
  title: SOAX API
  version: v1
  description: >-
    Programmatic access to your SOAX account: manage proxy packages, generate
    connection strings, browse available locations, pull usage analytics, and
    manage API keys. All endpoints are served over HTTPS and return JSON.
servers:
  - url: https://api.platform.soax.com
security:
  - bearerAuth: []
tags:
  - name: API Keys
    description: >-
      Self-service management of the API keys used to authenticate with this
      API.
  - name: Packages
    description: >-
      Read proxy packages, build proxy connection strings, and rotate package
      passwords.
  - name: Locations
    description: >-
      Location reference data: tiers, countries, regions, cities, ISPs, ASNs,
      and ZIP codes.
  - name: Account
    description: Read-only account, credit, and subscription information.
  - name: Analytics
    description: Usage analytics for your proxy packages.
paths:
  /v1/proxy/analytics/credits-burned:
    post:
      tags:
        - Analytics
      summary: Get credits burned for proxy usage
      description: >-
        Retrieve credits burned per day, broken down by tier. Each item holds
        one date and a `data` array whose `key` is the tier number (`"1"`,
        `"2"`, `"3"`) and whose `value` is the credits burned on that tier. The
        date range may span at most 365 days.


        If the API key is restricted to specific packages, results (and any
        `package_ids` filter) are limited to those packages.


        Requires the `proxy:analytics:read` scope.
      operationId: get_credits_burned_v1_proxy_analytics_credits_burned_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreditsRequest'
            example:
              from_date: '2026-08-01T00:00:00Z'
              to_date: '2026-08-03T23:59:59Z'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/CreditsResponseItem'
                type: array
                title: >-
                  Response Get Credits Burned V1 Proxy Analytics Credits Burned
                  Post
              example:
                - date: '2026-08-01'
                  data:
                    - key: '1'
                      value: 100
                    - key: '2'
                      value: 20.5
                - date: '2026-08-02'
                  data:
                    - key: '1'
                      value: 84.2
                    - key: '2'
                      value: 31
                - date: '2026-08-03'
                  data:
                    - key: '1'
                      value: 91.7
        '400':
          description: >-
            A parameter value or combination is invalid. Service-level
            validation errors use the `error` key; endpoint-level checks use
            `detail`. Read `detail ?? error`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  error:
                    type: string
              example:
                error: Date range cannot be more than 1 year
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ForbiddenScope'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    CreditsRequest:
      properties:
        from_date:
          type: string
          format: date-time
          title: From Date
          description: Start of the query range (ISO 8601).
        to_date:
          type: string
          format: date-time
          title: To Date
          description: >-
            End of the query range (ISO 8601). At most 365 days after
            `from_date`.
        package_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Package Ids
          description: Restrict results to these package IDs.
      type: object
      required:
        - from_date
        - to_date
      title: CreditsRequest
      description: Request model for credits burned breakdown analysis.
    CreditsResponseItem:
      properties:
        date:
          type: string
          title: Date
        data:
          items:
            $ref: '#/components/schemas/CreditsDataPoint'
          type: array
          title: Data
      type: object
      required:
        - date
        - data
      title: CreditsResponseItem
      description: Response item for credits burned breakdown analysis.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CreditsDataPoint:
      properties:
        key:
          type: string
          title: Key
        value:
          type: number
          title: Value
      type: object
      required:
        - key
        - value
      title: CreditsDataPoint
      description: Single data point in credits breakdown.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  responses:
    Unauthorized:
      description: Missing, invalid, or revoked API key.
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
          example:
            detail: Invalid API key
    ForbiddenScope:
      description: The API key does not carry the scope this endpoint requires.
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
          example:
            detail: 'Missing required scope: proxy:packages:read'
    RateLimited:
      description: >-
        Rate limit exceeded (5 requests/second per API key, 500 requests/minute
        per IP). The response includes `Retry-After` (seconds),
        `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset` (Unix
        time) headers — wait `Retry-After` seconds and retry.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
          example:
            error: 'Rate limit exceeded: 5 per 1 second'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key secret (starts with `s_live_`). Create keys in the dashboard
        under **Settings → API keys**, or via `POST /v1/api-keys/`. Send it as
        `Authorization: Bearer <secret>`.

````