# The workspace's plan

> Page: https://docs.flung.dev/reference/api/get-v1-billing. Index of every page: https://docs.flung.dev/llms.txt

Which plan this credential's workspace is on, its limits, and what counts against them now.

`GET /v1/billing`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | The workspace's plan. |
| What does it need? | An API key or an OAuth access token. |
| What does it take? | Nothing. |
| What does it return? | Status 200 with a body of type [`Billing`](https://docs.flung.dev/reference/api/schemas.md#billing). |
| In the SDK? | `flung.billing.get()` |
| As an MCP tool? | [`get_billing`](https://docs.flung.dev/mcp/tools/get-billing.md) |
| What can go wrong? | `401` Missing, unknown, revoked or expired API key; `422` The request failed validation; `429` Too many requests for this credential; wait for `retry-after` seconds. Every failure has the same [error shape](https://docs.flung.dev/reference/api/errors.md). |

## What it does

Which plan this credential's workspace is on, its limits, and what counts against them now. Every API key, OAuth app and connect token of a workspace shares its plan. Upgrading happens on the portal, at upgradeUrl.

## Example

**curl**

```bash
curl -X GET 'https://api.flung.dev/v1/billing' \
  --header "Authorization: Bearer $FLUNG_API_KEY"
```

**TypeScript**

```ts
import { Flung } from '@flung.dev/sdk'

const flung = new Flung({ apiKey: process.env.FLUNG_API_KEY! })
const result = await flung.billing.get()
```

**fetch**

```js
const response = await fetch('https://api.flung.dev/v1/billing', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.FLUNG_API_KEY}`,
  },
})
if (!response.ok) throw new Error((await response.json()).error.message)
const result = await response.json()
```

A successful answer looks like this:

```json
{
  "plan": "free",
  "source": "free",
  "status": "string",
  "currentPeriodEnd": "2026-11-01T09:00:00.000Z",
  "cancelAtPeriodEnd": true,
  "limits": {
    "accounts": 1,
    "postsPerMonth": 1,
    "profiles": 1,
    "requestsPerMinute": 1,
    "mediaBytes": 1,
    "webhookEndpoints": 1,
    "accountsPerPlatformPerProfile": 1
  },
  "usage": {
    "accounts": 1,
    "postsThisMonth": 1,
    "profiles": 1,
    "mediaBytes": 1,
    "webhookEndpoints": 1
  },
  "upgradeUrl": "https://example.com"
}
```

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The plan. | [`Billing`](https://docs.flung.dev/reference/api/schemas.md#billing) |
| 401 | Missing, unknown, revoked or expired API key. | [`Error`](https://docs.flung.dev/reference/api/schemas.md#error) |
| 422 | The request failed validation. | [`Error`](https://docs.flung.dev/reference/api/schemas.md#error) |
| 429 | Too many requests for this credential; wait for `retry-after` seconds. | [`Error`](https://docs.flung.dev/reference/api/schemas.md#error) |

## Response body

A 200 answer has the type [`Billing`](https://docs.flung.dev/reference/api/schemas.md#billing).

| Field | Type | Required | Description |
|---|---|---|---|
| `plan` | `"free" \| "pro" \| "business"` | yes | The plan: free, pro ($19 a month) or business ($59 a month). |
| `source` | `"free" \| "subscription" \| "override"` | yes | Where the plan comes from: no subscription, a paying Stripe subscription, or set by Flung. |
| `status` | `string` | yes | The subscription's Stripe status, or none. |
| `currentPeriodEnd` | `string \| null` | yes |  |
| `cancelAtPeriodEnd` | `boolean` | yes |  |
| `limits` | `PlanLimits` | yes |  |
| `limits.accounts` | `integer` | yes | Connected social accounts that are not disconnected. |
| `limits.postsPerMonth` | `integer` | yes | Posts created in one UTC calendar month; a post counts once however many accounts it goes to. |
| `limits.profiles` | `integer \| null` | yes | Profiles; null is no limit. |
| `limits.requestsPerMinute` | `integer` | yes | Requests a minute for each API key, OAuth app or connect token. |
| `limits.mediaBytes` | `integer` | yes | Stored media, in bytes. |
| `limits.webhookEndpoints` | `integer` | yes |  |
| `limits.accountsPerPlatformPerProfile` | `integer \| null` | yes | Live accounts of one platform in one profile, the accounts outside every profile counting as one profile; a LinkedIn page counts apart from a LinkedIn profile. Across the workspace a platform also has at most this times `profiles`. A second is refused with `platform_limit_reached`. null is no limit. |
| `usage` | `object` | yes | What counts against each limit now. |
| `usage.accounts` | `integer` | yes |  |
| `usage.postsThisMonth` | `integer` | yes |  |
| `usage.profiles` | `integer` | yes |  |
| `usage.mediaBytes` | `integer` | yes |  |
| `usage.webhookEndpoints` | `integer` | yes |  |
| `upgradeUrl` | `string \| null` | yes | The workspace's Plan page on the Flung portal, where an owner upgrades. |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.flung.dev/reference/api.md) | Every endpoint |
| [Schemas](https://docs.flung.dev/reference/api/schemas.md) | Every request and response type |
| [Errors](https://docs.flung.dev/reference/api/errors.md) | Every error code and what to do about it |
| [`get_billing`](https://docs.flung.dev/mcp/tools/get-billing.md) | The same operation as an MCP tool |
