# Retrieve the organization's billing (/docs/api-reference/billing/get-billing)

The organization's plan (and contract), the current billing month's usage and what it would add to the next invoice so far, its standing (`past_due`, billing holds), payment method, and what the plan includes. Organization-wide: every environment's key sees the same. Plan changes are made in the dashboard; subscribe to the `billing.*` webhook events to follow them.

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

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).

## 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.get();
```

HTTP:

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

Python:

```python
from coss import Coss

client = Coss()  # api_key= or COSS_API_KEY

client.billing.get()
```

Go:

```go
import (
	"context"

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

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

client.Billing.Get(
    context.TODO(),
)
```

Ruby:

```ruby
require "coss"

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

client.billing.get
```

PHP:

```php
<?php

use Coss\Coss;

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

$client->billing->get();
```

Java:

```java
import com.coss.Coss;

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

client.billing().get();
```

.NET:

```csharp
using Coss;

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

await client.Billing.GetAsync();
```

## Response 200

The organization's billing.

- `object` ("billing", required)
- `organization_id` (string, required): The organization's id.
- `plan` ("free" | "pro" | "scale" | "enterprise", required): The plan in effect now (`free` without a contract).
- `contract` (object | null, required): The contract in effect; `null` on the Free plan.
  - `id` (string, required): The contract's id.
  - `kind` ("self_serve" | "sales" | "internal", required): `self_serve`: chosen in the dashboard. `sales`: agreed with coss.com. `internal`: coss.com's own.
  - `effective_from` (string, required, date-time): When it took effect.
  - `effective_until` (string | null, required, date-time): When it ends. `null`: no end is set.
  - `term_end` (string | null, required, date-time): End of a committed term.
  - `auto_renew` (boolean, required): Whether a committed term renews when it ends.
- `scheduled_change` (object | null, required): A plan change that takes effect later (a downgrade, a cancellation).
  - `effective_at` (string, required, date-time): When it takes effect.
  - `plan` ("free" | "pro" | "scale" | "enterprise", required): The plan it changes to.
- `status` ("active" | "past_due" | "delinquent", required): `past_due`: an invoice is overdue; `delinquent`: past its grace period, and live sending is held.
- `holds` (object[], required): Billing holds on live sending (sandbox keys keep working).
  - `reason` ("delinquent" | "spend_limit" | "credit_limit" | "admin", required): `delinquent`: an invoice is past its grace period. `spend_limit`: the spend limit was reached. `credit_limit`: the credit limit was reached, or a usage charge failed. `admin`: placed by coss.com.
  - `since` (string, required, date-time): When the hold began.
- `currency` ("usd", required): Always `usd`.
- `period` (object, required): The current billing month (UTC).
  - `start` (string, required, date-time): When the period starts (inclusive).
  - `end` (string, required, date-time): When the period ends (exclusive).
- `usage` (object[], required): This month's usage per meter.
  - `meter` (string, 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"): What is counted, e.g. `email.recipients`.
  - `quantity` (integer, required, at least 0): Units used so far this month.
  - `included` (integer | null, required, at least 0): The plan's monthly allowance where usage stops (Free), else `null`.
- `estimate` (object, required): This month so far, as it would be invoiced if it ended now.
  - `usage` (integer, required): Usage this month at your rates.
  - `discount` (integer, required): An amount in cents (USD).
  - `credit` (integer, required): Credit applied to this estimate (your plan's fee is credit).
  - `total` (integer, required): Estimated total including usage and fees billed in arrears, after discounts and credits.
- `credit_remaining` (integer, required): Unused credit usable this month.
- `spend_limit` (integer | null, required): Usage beyond the credit past which live sending is held; `null`: none.
- `credit_limit` (object | null, required): Where the organization stands against its credit limit; `null`: it has none.
  - `limit` (integer, required): What coss.com carries before live sending is held. It rises as payments settle.
  - `used` (integer, required): Usage not invoiced yet, unpaid invoices and recent usage charges.
  - `charge_threshold` (integer | null, required): Usage not invoiced yet is charged early at this amount; `null`: it isn't charged automatically.
- `payment_method` (object | null, required): The payment method on file. `null`: none.
  - `type` (string, required): Its type, such as `card`.
  - `brand` (string | null, required): The card's brand. `null` for other types.
  - `last4` (string | null, required): The card's last four digits. `null` for other types.
- `add_ons` (object[], required): Add-ons of the contract in effect, charged on top of the plan.
  - `key` (string, required): e.g. `dedicated_ips`.
  - `name` (string, required): The add-on's name.
  - `quantity` (integer, required): How many units are on the contract.
  - `unit_amount` (integer, required): The price per unit and interval, in cents.
  - `interval` ("month" | "quarter" | "year", required): How often it's charged.
- `features` (object, required): Which features the plan includes.
  - `tracking_domains` (boolean, required): Custom tracking domains.
  - `audit_log` (boolean, required): The organization's audit log.
  - `log_drains` (boolean, required): Log drains.
  - `sso` (boolean, required): Single sign-on.
  - `scim` (boolean, required): Directory sync (SCIM).
  - `dedicated_ips` (boolean, required): Dedicated IP pools.
- `limits` (object, required): Resource limits (`null`: unlimited).
  - `domains` (integer | null, required): Sending domains. `null`: unlimited.
  - `members` (integer | null, required): Members of the organization. `null`: unlimited.
  - `webhook_endpoints_per_environment` (integer | null, required): Webhook endpoints per environment. `null`: unlimited.
  - `contacts_per_environment` (integer | null, required): Contacts per environment. `null`: unlimited.
  - `inboxes` (integer | null, required): Inboxes. `null`: unlimited.

Example:

```json
{
  "object": "billing",
  "organization_id": "org_01k7c8m4q2f3e9v6t5r1n0p8yz",
  "plan": "pro",
  "contract": {
    "id": "bcon_01k7c8m4q2f3e9v6t5r1n0p8yz",
    "kind": "self_serve",
    "effective_from": "2026-10-01T00:00:00.000Z",
    "effective_until": null,
    "term_end": null,
    "auto_renew": false
  },
  "scheduled_change": null,
  "status": "active",
  "holds": [],
  "currency": "usd",
  "period": {
    "start": "2026-10-01T00:00:00.000Z",
    "end": "2026-11-01T00:00:00.000Z"
  },
  "usage": [
    {
      "meter": "email.recipients",
      "quantity": 120000,
      "included": null
    }
  ],
  "estimate": {
    "usage": 4800,
    "discount": 0,
    "credit": 2500,
    "total": 2300
  },
  "credit_remaining": 0,
  "spend_limit": null,
  "credit_limit": {
    "limit": 50000,
    "used": 2300,
    "charge_threshold": 10000
  },
  "payment_method": {
    "type": "card",
    "brand": "visa",
    "last4": "4242"
  },
  "add_ons": [],
  "features": {
    "tracking_domains": true,
    "audit_log": true,
    "log_drains": false,
    "sso": false,
    "scim": false,
    "dedicated_ips": false
  },
  "limits": {
    "domains": 10,
    "members": 10,
    "webhook_endpoints_per_environment": 10,
    "contacts_per_environment": 50000,
    "inboxes": 1000
  }
}
```

## 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`).
- `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`).