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

# Get Billing

> Get billing information including subscription details and linked organizations

## Endpoint

```
GET https://api.ugc.inc/billing
```

## Overview

Retrieve your billing information, including Stripe subscription status, slot counts by tier, and linked organizations. Requires a profile-scoped API key.

## Request

No request body required. Authentication via profile-scoped Bearer token.

## Response

<ResponseField name="data" type="object">
  <Expandable title="Response properties">
    <ResponseField name="billing_id" type="string">
      Unique billing record identifier
    </ResponseField>

    <ResponseField name="subscription" type="object | null">
      Stripe subscription details (null if no subscription)

      <Expandable title="Subscription properties">
        <ResponseField name="status" type="string">
          Stripe subscription status (e.g., `active`, `canceled`, `past_due`)
        </ResponseField>

        <ResponseField name="cancel_at_period_end" type="boolean">
          Whether the subscription will cancel at the end of the current period
        </ResponseField>

        <ResponseField name="current_period_start" type="string">
          ISO 8601 timestamp of the current billing period start
        </ResponseField>

        <ResponseField name="current_period_end" type="string">
          ISO 8601 timestamp of the current billing period end
        </ResponseField>

        <ResponseField name="slots" type="object">
          Account slot counts by tier

          <Expandable title="Slot properties">
            <ResponseField name="basic" type="number">
              Number of basic tier slots
            </ResponseField>

            <ResponseField name="premium" type="number">
              Number of premium tier slots
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="orgs" type="array">
      Linked organizations

      <Expandable title="Org properties">
        <ResponseField name="id" type="string">
          Organization ID
        </ResponseField>

        <ResponseField name="name" type="string | null">
          Organization name
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.ugc.inc/billing \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```typescript React theme={null}
  import { UGCClient } from 'ugcinc';

  const client = new UGCClient({ apiKey: 'YOUR_API_KEY' });
  const response = await client.billing.getBilling();

  if (response.ok) {
    console.log(`Subscription status: ${response.data.subscription?.status}`);
    console.log(`Basic slots: ${response.data.subscription?.slots.basic}`);
    console.log(`Premium slots: ${response.data.subscription?.slots.premium}`);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "ok": true,
    "code": 200,
    "message": "Success",
    "data": {
      "billing_id": "bill_123",
      "subscription": {
        "status": "active",
        "cancel_at_period_end": false,
        "current_period_start": "2025-01-01T00:00:00.000Z",
        "current_period_end": "2025-02-01T00:00:00.000Z",
        "slots": {
          "basic": 5,
          "premium": 2
        }
      },
      "orgs": [
        {
          "id": "org_123",
          "name": "My Organization"
        }
      ]
    }
  }
  ```
</ResponseExample>
