# List credits (/docs/api-reference/billing/list-credits)

The organization's credits, newest first: each month's plan credit, prepaid commitments and credits from coss.com support (in dollars, or free units of a product), with what's left. Only usable ones by default (`status=all` for every one). Pass the last `id` as `after` to get the next page while `has_more` is true.

`GET https://api.coss.com/v1/billing/credits`

Authenticate with your API key as a bearer token (`Authorization: Bearer coss_test_…`). Responses are JSON with snake_case fields; errors are `{ error: { type, code, message, param?, issues?, request_id } }` (https://coss.com/docs/api-reference/errors.md).

## Query parameters

- `status` ("active" | "all"): `active` (default): usable now or later, with something left; `all`: every credit, newest first.
- `after` (string, at most 64 characters): Continue after this id (the last of the previous page).
- `limit` (integer, 1-100): At most this many (default 20).

## Example request

TypeScript (the `coss` package):

```ts
import { Coss } from "coss";

const coss = new Coss({
  apiKey: process.env.COSS_API_KEY,
  baseUrl: "https://api.coss.com",
});

const { data, error } = await coss.billing.credits.list();
```

HTTP:

```sh
curl -X GET "https://api.coss.com/v1/billing/credits" \
  -H "Authorization: Bearer $COSS_API_KEY"
```

Python:

```python
from coss import Coss

client = Coss()  # api_key= or COSS_API_KEY

client.billing.credits.list()
```

Go:

```go
import (
	"context"

	billing "github.com/cosscom/coss-go/billing"
	cossclient "github.com/cosscom/coss-go/client"
)

client := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY

request := &billing.ListCreditsRequest{}
client.Billing.Credits.List(
    context.TODO(),
    request,
)
```

Ruby:

```ruby
require "coss"

client = Coss::Client.new # api_key: or COSS_API_KEY

client.billing.credits.list
```

PHP:

```php
<?php

use Coss\Coss;
use Coss\Billing\Credits\Requests\ListCreditsRequest;

$client = new Coss(); // apiKey: or COSS_API_KEY

$client->billing->credits->list(
    new ListCreditsRequest([]),
);
```

Java:

```java
import com.coss.Coss;
import com.coss.resources.billing.credits.requests.ListCreditsRequest;

Coss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY

client.billing().credits().list(
    ListCreditsRequest
        .builder()
        .build()
);
```

.NET:

```csharp
using Coss;
using Coss.Billing;

var client = new CossClient(); // apiKey: or COSS_API_KEY

await client.Billing.Credits.ListAsync(new ListCreditsRequest());
```

## Response 200

A page of credits.

- `object` ("list", required)
- `data` (object[], required)
  - `object` ("credit", required)
  - `id` (string, required)
  - `kind` ("amount" | "units", required): `amount`: dollars (`amount` and `remaining` in cents); `units`: free units of `meter`.
  - `amount` (integer, required): How much was granted: cents, or units for a `units` credit.
  - `remaining` (integer, required): How much is left, in the same unit as `amount`.
  - `meter` (string | null, required, one of "email.recipients", "email.dedicated_ip", "email.attachment_data", "email.received", "email.received_data", "email.inboxes", "sms.segments", "sms.received_segments", "sms.numbers", "sms.registrations", "sign.completed_requests", "risk.phone_checks", "risk.assessments", "risk.content_checks", "verify.verifications", "verify.sms", "forms.submissions", "forms.file_uploads", "scheduling.bookings", "scheduling.hosts", "hooks.messages", null): What a `units` credit covers.
  - `meters` (string[] | null, required): What an `amount` credit pays for (`null`: any usage).
  - `applies_to` ("usage" | "any", required): `any`: also fees and other charges.
  - `source` ("fee" | "commitment" | "support" | "promotion" | "refund" | "sla" | "threshold", required): Where it came from: `fee`, `commitment`, `support`, `promotion`, `refund` or `sla`.
  - `description` (string, required): What it's for.
  - `effective_at` (string, required, date-time): When it can start being used.
  - `expires_at` (string | null, required, date-time): When what's left expires. `null`: never.
  - `voided_at` (string | null, required, date-time): When it was voided. `null`: it wasn't.
  - `created_at` (string, required, date-time)
- `has_more` (boolean, required)

Example:

```json
{
  "object": "list",
  "data": [
    {
      "object": "credit",
      "id": "bcg_01k7c8m4q2f3e9v6t5r1n0p8yz",
      "kind": "units",
      "amount": 50000,
      "remaining": 12000,
      "meter": "email.recipients",
      "meters": null,
      "applies_to": "usage",
      "source": "support",
      "description": "Migration credit",
      "effective_at": "2026-10-01T00:00:00.000Z",
      "expires_at": "2027-01-01T00:00:00.000Z",
      "voided_at": null,
      "created_at": "2026-10-01T09:30:00.000Z"
    }
  ],
  "has_more": false
}
```

## Errors

- `400`: The `Coss-Version` header names an unknown API version (`invalid_api_version`).
- `401`: The API key is missing, invalid, revoked or expired (`authentication_error`).
- `403`: The API key lacks the permission this endpoint needs (`permission_error`), or its organization is suspended (`organization_suspended`).
- `422`: A query parameter failed validation (`validation_error`).
- `429`: Too many requests with this API key (`rate_limited`), or too many requests with invalid keys from this address (`too_many_failed_authentications`). Retry after `Retry-After` seconds. Successful responses carry `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds until the limit is fully restored).
- `500`: Unexpected server error (`api_error` / `internal_error`).
- `503`: The API key could not be verified right now; retry (`service_unavailable`).