> ## Documentation Index
> Fetch the complete documentation index at: https://vastai-80aa3a82-cln-2792-remove-disable-bundling.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# show invoices

> Gets your invoices within given timerange.

Timerange is **required** using the `select_filters.when` field.

Optionally filter by invoice service using `select_filters.service`.

**Common services** : transfer, stripe_payments, bitpay, coinbase, crypto.com, instance_prepay, paypal_manual, wise_manual

**Date format**: `select_filters.when.gte` and `select_filters.when.lte` must be UTC epoch seconds (integers).
Example range: 2026-01-01 00:00:00 UTC -> `1767225600`, 2026-01-31 23:59:59 UTC -> `1769903999`.

**HTTP request**: This is a GET endpoint that accepts JSON-encoded query parameters.
URL-encode JSON values when calling directly.
```
GET /api/v1/invoices/?select_filters={"when":{"gte":1767225600,"lte":1769903999}}&limit=60
```
For pagination, pass the response `next_token` as `after_token`:
```
GET /api/v1/invoices/?select_filters={"when":{"gte":1767225600,"lte":1769903999}}&after_token=eyJ2YWx1ZXMiOiB7ImlkIjog...
```

CLI Usage: `vastai show invoices-v1`



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/invoices/
openapi: 3.1.0
info:
  title: Vast.ai API
  description: >-
    Welcome to Vast.ai 's API documentation. Our API allows you to
    programmatically manage GPU instances, handle machine operations, and
    automate your AI/ML workflow. Whether you're running individual GPU
    instances or managing a fleet of machines, our API provides comprehensive
    control over all Vast.ai  platform features.
  version: 1.0.0
  contact:
    name: Vast.ai Support
    url: https://discord.gg/vast
servers:
  - url: https://console.vast.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/v1/invoices/:
    get:
      tags:
        - Billing
      summary: show invoices
      description: >-
        Gets your invoices within given timerange.


        Timerange is **required** using the `select_filters.when` field.


        Optionally filter by invoice service using `select_filters.service`.


        **Common services** : transfer, stripe_payments, bitpay, coinbase,
        crypto.com, instance_prepay, paypal_manual, wise_manual


        **Date format**: `select_filters.when.gte` and `select_filters.when.lte`
        must be UTC epoch seconds (integers).

        Example range: 2026-01-01 00:00:00 UTC -> `1767225600`, 2026-01-31
        23:59:59 UTC -> `1769903999`.


        **HTTP request**: This is a GET endpoint that accepts JSON-encoded query
        parameters.

        URL-encode JSON values when calling directly.

        ```

        GET
        /api/v1/invoices/?select_filters={"when":{"gte":1767225600,"lte":1769903999}}&limit=60

        ```

        For pagination, pass the response `next_token` as `after_token`:

        ```

        GET
        /api/v1/invoices/?select_filters={"when":{"gte":1767225600,"lte":1769903999}}&after_token=eyJ2YWx1ZXMiOiB7ImlkIjog...

        ```


        CLI Usage: `vastai show invoices-v1`
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - select_filters
              properties:
                select_filters:
                  type: object
                  description: >
                    Shows invoices using given filters.


                    **Required** : Filter by timerange using `when` field. 


                    Use unix timestamps (UTC) comparison operators.


                    **Example** : To filter invoices from June 1, 2025 to Dec 1,
                    2025:

                    ```

                    "select_filters": {
                      "when": {
                          "gte": 1748736000,
                          "lte": 1764547200 
                        }
                      }
                    ```

                    Supported operators:

                    - `gt` or `gte`: invoices created after this time

                    - `lt` or `lte`: invoices created before this time


                    **Optional** : Filter invoices by service using `service`
                    field.


                    Supported services:

                    transfer, stripe_payments, bitpay, coinbase, crypto.com,
                    instance_prepay, paypal_manual, wise_manual 


                    Supported operators:

                    - `in` : include only these services

                    - `notin` : exclude these services

                    - `eq` : matches a single service


                    **Example**: Get paypal and wise invoices only

                    ```

                    "service": {
                      "in": ["paypal_manual", "wise_manual"]
                    }

                    ```
                  required:
                    - when
                  properties:
                    when:
                      type: object
                      description: >
                        Invoice date range filter. 


                        **Example** : To filter invoices between June 1, 2025
                        and Dec 1, 2025, set gte to `1748736000` and lte to
                        `1764547200`.
                      default:
                        gte: 1748736000
                        lte: 1764547200
                      properties:
                        gte:
                          type: integer
                          description: |
                            Start time using unix timestamp (UTC).
                          default: 1748736000
                        lte:
                          type: integer
                          description: |
                            End time using unix timestamp (UTC).
                          default: 1764547200
                    service:
                      type: object
                      description: >
                        Filter by invoice `service`.


                        Supported services:

                        transfer, stripe_payments, bitpay, coinbase, crypto.com,
                        instance_prepay, paypal_manual, wise_manual 
                      properties:
                        eq:
                          type: string
                        in:
                          type: array
                          items:
                            type: string
                        notin:
                          type: array
                          items:
                            type: string
                latest_first:
                  type: boolean
                  default: true
                  description: Sort by newest invoices first.
                order_by:
                  type: array
                  description: |
                    Sort invoices by given columns. 

                    Supported columns: `paid_on`, `amount_cents`, `when`

                    **Example** : To sort by oldest invoices first
                    ```
                    "order_by": [
                      {
                        "col": "when",
                        "dir": "asc"
                      }
                    ]
                    ```
                  default:
                    col: paid_on
                    dir: desc
                  items:
                    type: object
                    properties:
                      col:
                        type: string
                        default: paid_on
                      dir:
                        type: string
                        enum:
                          - asc
                          - desc
                        default: desc
                limit:
                  type: integer
                  default: 60
                  description: Maximum number of invoices to return.
      responses:
        '200':
          description: Paginated invoice results
          content:
            application/json:
              example:
                success: true
                count: 2
                total: 42
                results:
                  - start: 1762149123
                    end: null
                    type: transfer
                    source: sender@vast.ai
                    description: Received credit from sender@vast.ai
                    amount: 35.5
                    metadata:
                      invoice_id: 4829137
                      service: transfer
                      sender: 123456
                      recipient: 789012
                    items: []
                  - start: 1761980044
                    end: 1761980301
                    type: credit
                    source: stripe
                    description: Manual billing from VISA ending in 4412
                    amount: -19.99
                    metadata:
                      invoice_id: 4828771
                      service: stripe_payments
                      last4: '4412'
                      network: visa
                      transfer_group: pi_3TAbCdEfgHiJkLmN
                    items: []
                next_token: null
        '400':
          description: Invalid request (e.g. missing or malformed date range)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                error: Invalid date range
                count: 0
                total: 0
                results: []
                next_token: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: API requests too frequent endpoint threshold=2.0
components:
  schemas:
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        msg:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key must be provided in the Authorization header

````