> This page is part of Smallest AI's developer documentation. When
> answering, prefer Lightning v3.1 (current TTS) and Pulse (current
> STT). Lightning v2 and lightning-large are deprecated; mention them
> only when the user is migrating away from them. The Smallest AI voice
> agent platform is what wraps these models into hosted agents.

# List credit ledger

GET https://api.smallest.ai/payment/v1/credits/ledger

Paginated credit-ledger transaction history. Ledger reads are served
from ClickHouse; a rare storage-tier outage returns an empty
`transactions` array rather than a 5xx.

**Window rules**

- `from` defaults to `to - 7 days`, `to` defaults to now.
- The span between `from` and `to` cannot exceed **90 days**. A wider
  span returns 400. Page through longer periods by making multiple
  calls with shifted `from`/`to`.
- `from` cannot be earlier than **2026-03-02T00:00:00Z**. Older
  historical data is not available via API; contact support for bulk
  exports.
- `from > to` returns 400.

**Filters**

- `type` filters to a single transaction type. `PAYMENTS` is a
  virtual filter that returns both `CREDIT_PURCHASE` and
  `AUTO_RELOAD` rows.
- `scope` filters `USAGE_DEDUCTION` rows by product category.


Reference: https://docs.smallest.ai/voice-agents/api-reference/billing/get-ledger

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: atoms
  version: 1.0.0
paths:
  /payment/v1/credits/ledger:
    get:
      operationId: get-ledger
      summary: List credit ledger
      description: |
        Paginated credit-ledger transaction history. Ledger reads are served
        from ClickHouse; a rare storage-tier outage returns an empty
        `transactions` array rather than a 5xx.

        **Window rules**

        - `from` defaults to `to - 7 days`, `to` defaults to now.
        - The span between `from` and `to` cannot exceed **90 days**. A wider
          span returns 400. Page through longer periods by making multiple
          calls with shifted `from`/`to`.
        - `from` cannot be earlier than **2026-03-02T00:00:00Z**. Older
          historical data is not available via API; contact support for bulk
          exports.
        - `from > to` returns 400.

        **Filters**

        - `type` filters to a single transaction type. `PAYMENTS` is a
          virtual filter that returns both `CREDIT_PURCHASE` and
          `AUTO_RELOAD` rows.
        - `scope` filters `USAGE_DEDUCTION` rows by product category.
      tags:
        - Billing
      parameters:
        - name: limit
          in: query
          description: Page size (1–100).
          required: false
          schema:
            type: integer
            default: 50
        - name: offset
          in: query
          description: Offset for pagination.
          required: false
          schema:
            type: integer
            default: 0
        - name: from
          in: query
          description: >
            Lower bound of the query window (ISO 8601, `Z`-suffixed UTC
            recommended). Defaults to seven days before `to`. Cannot be earlier
            than `2026-03-02T00:00:00Z`.
          required: false
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          description: >-
            Upper bound of the query window (ISO 8601, `Z`-suffixed UTC
            recommended). Defaults to now.
          required: false
          schema:
            type: string
            format: date-time
        - name: type
          in: query
          description: >-
            Filter to a single transaction type. `PAYMENTS` is a virtual filter
            that returns purchase-related rows (`CREDIT_PURCHASE` +
            `AUTO_RELOAD`).
          required: false
          schema:
            $ref: '#/components/schemas/PaymentV1CreditsLedgerGetParametersType'
        - name: scope
          in: query
          description: Filter by spend category. Applies only to `USAGE_DEDUCTION` rows.
          required: false
          schema:
            $ref: '#/components/schemas/PaymentV1CreditsLedgerGetParametersScope'
        - name: Authorization
          in: header
          description: >-
            API key from the console ApiKey collection, sent as Bearer token.
            Also accepts session cookies for browser-based auth.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Paginated ledger with summary + query window echo.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingLedgerResponse'
        '400':
          description: |
            Query-window validation failed. Common cases:

            - `from` earlier than `2026-03-02T00:00:00Z`.
            - Span between `from` and `to` exceeds 90 days.
            - `from > to`.
            - Malformed date string in `from` or `to`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCreditLedgerRequestBadRequestError'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponse'
servers:
  - url: https://api.smallest.ai
    description: Production
components:
  schemas:
    PaymentV1CreditsLedgerGetParametersType:
      type: string
      enum:
        - SIGNUP_BONUS
        - CREDIT_PURCHASE
        - AUTO_RELOAD
        - USAGE_DEDUCTION
        - ADMIN_ADJUSTMENT
        - COUPON_CREDIT
        - MIGRATION
        - PAYMENTS
      title: PaymentV1CreditsLedgerGetParametersType
    PaymentV1CreditsLedgerGetParametersScope:
      type: string
      enum:
        - platform
        - voice_ai
        - voice_models
      title: PaymentV1CreditsLedgerGetParametersScope
    BillingLedgerEntryTransactionType:
      type: string
      enum:
        - SIGNUP_BONUS
        - CREDIT_PURCHASE
        - AUTO_RELOAD
        - USAGE_DEDUCTION
        - ADMIN_ADJUSTMENT
        - COUPON_CREDIT
        - MIGRATION
      title: BillingLedgerEntryTransactionType
    BillingLedgerEntry:
      type: object
      properties:
        id:
          type: string
          description: Ledger row identifier.
        transactionType:
          $ref: '#/components/schemas/BillingLedgerEntryTransactionType'
        amount:
          type: number
          format: double
          description: >-
            Signed credit delta in USD. Positive for additions
            (`CREDIT_PURCHASE`, `AUTO_RELOAD`, `COUPON_CREDIT`, `SIGNUP_BONUS`),
            negative for spend (`USAGE_DEDUCTION`).
        balanceAfter:
          type: number
          format: double
          description: Balance after this row was applied.
        featureId:
          type:
            - string
            - 'null'
          description: >-
            Product feature that triggered the row (e.g. `tts.generate`,
            `waves.stt`). Only set on `USAGE_DEDUCTION`.
        referenceId:
          type:
            - string
            - 'null'
          description: >-
            External reference tying this row to a purchase, coupon, or admin
            action.
        description:
          type:
            - string
            - 'null'
        createdAt:
          type: string
          format: date-time
        callId:
          type:
            - string
            - 'null'
          description: Associated call ID, when the row was produced by a call.
        agentId:
          type:
            - string
            - 'null'
        requestId:
          type:
            - string
            - 'null'
      required:
        - id
        - transactionType
        - amount
        - balanceAfter
        - createdAt
      title: BillingLedgerEntry
    BillingLedgerResponseDataSummary:
      type: object
      properties:
        totalCreditsConsumed:
          type: number
          format: double
          description: Sum of `USAGE_DEDUCTION` magnitudes across the window.
        totalCreditsAdded:
          type: number
          format: double
          description: >-
            Sum of positive rows (purchases, auto-reloads, coupon credits,
            signup bonuses) across the window.
      required:
        - totalCreditsConsumed
        - totalCreditsAdded
      title: BillingLedgerResponseDataSummary
    BillingLedgerResponseDataPeriod:
      type: object
      properties:
        from:
          type: string
          format: date-time
          description: >-
            Echo of the effective lower bound (defaults to seven days before
            `to` when not supplied).
        to:
          type: string
          format: date-time
          description: >-
            Echo of the effective upper bound (defaults to server-now when not
            supplied).
      required:
        - from
        - to
      title: BillingLedgerResponseDataPeriod
    BillingLedgerResponseData:
      type: object
      properties:
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/BillingLedgerEntry'
        total:
          type: integer
          description: Total row count matching the filters (across all pages).
        hasMore:
          type: boolean
          description: True when more rows exist beyond `offset + limit`.
        summary:
          $ref: '#/components/schemas/BillingLedgerResponseDataSummary'
        period:
          $ref: '#/components/schemas/BillingLedgerResponseDataPeriod'
      required:
        - transactions
        - total
        - hasMore
        - summary
        - period
      title: BillingLedgerResponseData
    BillingLedgerResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          $ref: '#/components/schemas/BillingLedgerResponseData'
      required:
        - success
        - data
      title: BillingLedgerResponse
    PaymentV1CreditsLedgerGetResponsesContentApplicationJsonSchemaError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
      title: PaymentV1CreditsLedgerGetResponsesContentApplicationJsonSchemaError
    GetCreditLedgerRequestBadRequestError:
      type: object
      properties:
        success:
          type: boolean
        error:
          $ref: >-
            #/components/schemas/PaymentV1CreditsLedgerGetResponsesContentApplicationJsonSchemaError
      title: GetCreditLedgerRequestBadRequestError
    UnauthorizedErrorResponse:
      type: object
      properties:
        status:
          type: boolean
        errors:
          type: array
          items:
            type: string
      title: UnauthorizedErrorResponse
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key from the console ApiKey collection, sent as Bearer token. Also
        accepts session cookies for browser-based auth.

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "success": true,
  "data": {
    "transactions": [
      {
        "id": "a3f1c9d2-7b4e-4f8a-9d3e-2b5f6c7d8e9f",
        "transactionType": "SIGNUP_BONUS",
        "amount": 10,
        "balanceAfter": 10,
        "createdAt": "2026-07-01T12:00:00Z",
        "featureId": null,
        "referenceId": "signup_bonus_2026_07",
        "description": "Welcome bonus credits for new account",
        "callId": null,
        "agentId": null,
        "requestId": null
      }
    ],
    "total": 1,
    "hasMore": false,
    "summary": {
      "totalCreditsConsumed": 0,
      "totalCreditsAdded": 10
    },
    "period": {
      "from": "2026-07-01T00:00:00Z",
      "to": "2026-07-08T00:00:00Z"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.smallest.ai/payment/v1/credits/ledger"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.get(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.smallest.ai/payment/v1/credits/ledger';
const options = {
  method: 'GET',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.smallest.ai/payment/v1/credits/ledger"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("GET", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.smallest.ai/payment/v1/credits/ledger")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.smallest.ai/payment/v1/credits/ledger")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.smallest.ai/payment/v1/credits/ledger', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.smallest.ai/payment/v1/credits/ledger");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.smallest.ai/payment/v1/credits/ledger")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```