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

# Get your provider earnings

> Get the credits your TokenChange endpoints earned over a number of days, in total and per endpoint, after the platform fee. Requires endpoints:read.



## OpenAPI

````yaml api-reference/openapi.json GET /v1/provider/earnings
openapi: 3.1.0
info:
  title: TokenChange API
  description: >-
    Manage TokenChange resources with a gateway API token. Errors share one
    envelope: `{"error":{"type","code","message"}}`.
  license:
    name: ''
  version: '1'
servers:
  - url: https://api.tokenchange.io
security: []
tags:
  - name: models
    description: Catalog models and endpoints
  - name: keys
    description: Inference API keys
  - name: usage
    description: Usage analytics
  - name: billing
    description: Credit balance and history
  - name: provider
    description: Your provider account, endpoints, validations and earnings
paths:
  /v1/provider/earnings:
    get:
      tags:
        - provider
      operationId: earnings
      parameters:
        - name: days
          in: query
          description: Look-back window in days (default 30).
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Earnings'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      security:
        - bearer:
            - endpoints:read
components:
  schemas:
    Earnings:
      type: object
      description: Settled earnings over the last `range_days` days, in micro-credits.
      required:
        - range_days
        - platform_fee_bps
        - requests
        - charged_micro
        - earned_micro
        - endpoints
      properties:
        charged_micro:
          type: integer
          format: int64
        earned_micro:
          type: integer
          format: int64
        endpoints:
          type: array
          items:
            $ref: '#/components/schemas/EndpointEarnings'
        platform_fee_bps:
          type: integer
          format: int32
        range_days:
          type: integer
          format: int32
        requests:
          type: integer
          format: int64
    ErrorBody:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
    EndpointEarnings:
      type: object
      required:
        - endpoint_slug
        - requests
        - charged_micro
        - earned_micro
        - tokens_in
        - tokens_out
      properties:
        charged_micro:
          type: integer
          format: int64
        earned_micro:
          type: integer
          format: int64
        endpoint_slug:
          type: string
        last_settled_at:
          type:
            - string
            - 'null'
        requests:
          type: integer
          format: int64
        tokens_in:
          type: integer
          format: int64
        tokens_out:
          type: integer
          format: int64
    ErrorDetail:
      type: object
      required:
        - type
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        resource_id:
          type:
            - string
            - 'null'
        type:
          type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: A gateway API token (`tcg_…`) created in the dashboard

````

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