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

# Spending Limits

We put no money ceiling on your own provider keys. Managed Keys spends a prepaid balance, so it can run out.

## What Managed Keys can run out of

* **The balance.** The money you prepaid. At zero you get [`402 insufficient_balance`](/errors#insufficient_balance) until you add funds.
* **The daily spending limit.** It counts what you spent today plus what your in-flight requests hold, over a UTC day. Past it you get [`429 spend_velocity_exceeded`](/errors#spend_velocity_exceeded) until the day rolls over.

A risk review can pause managed requests on top of those two. That's [`403 account_under_review`](/errors#account_under_review). Your own key routes keep working through all of it.

## Two headers report your spend

* `x-flexinference-spend-remaining` says `unlimited` when no money ceiling applies. Otherwise it's a signed micro-USD number. It's the smaller of your balance and what's left of today's limit.
* `x-flexinference-spend-as-of` is when we read that number, in epoch milliseconds.

A negative number means we're turning away managed requests until you add money.

## The limits endpoint

Call `GET /v1/limits` with your key. It lists every ceiling on your organization, spending and [usage](/usage-limits) alike.

```bash theme={null}
curl https://api.flexinference.com/v1/limits \
  -H "Authorization: Bearer $FLEXINFERENCE_API_KEY"
```

```json theme={null}
{
  "object": "limits",
  "as_of": 1769558400123,
  "own_keys": {
    "unlimited": true,
    "flex_race_slots": {
      "limit": 40,
      "scope": "organization",
      "on_exceed": "degrade_to_standard"
    }
  },
  "managed": {
    "providers": ["anthropic", "openai"],
    "serving": "ok",
    "paused_reason": null,
    "binding": "daily_spend",
    "spend_remaining_micro_usd": 41200000,
    "currency": "USD",
    "balance": {
      "remaining_micro_usd": 94880000,
      "cash_micro_usd": 84880000,
      "credit_micro_usd": 10000000,
      "reserved_micro_usd": 120000
    },
    "daily_spend": {
      "limit_micro_usd": 250000000,
      "used_micro_usd": 208800000,
      "remaining_micro_usd": 41200000,
      "window": "utc_day",
      "resets_at": 1769644800
    },
    "concurrency": {
      "limit": 10,
      "scope": "organization",
      "on_exceed": "refuse"
    },
    "ramp_week": 1,
    "ramp_defaults": {
      "concurrency": 10,
      "daily_spend_micro_usd": 250000000
    },
    "override_in_force": {
      "concurrency": false,
      "daily_spend": false
    },
    "rates": []
  },
  "abuse_limits": {
    "counted_per_cloudflare_location": true,
    "request_body_bytes": 50000000,
    "rates": [
      {
        "name": "organization_requests",
        "scope": "organization",
        "window_seconds": 60,
        "limit": null,
        "on_exceed": "refuse"
      },
      {
        "name": "api_key_requests",
        "scope": "api_key",
        "window_seconds": 60,
        "limit": null,
        "on_exceed": "refuse"
      },
      {
        "name": "client_ip_requests",
        "scope": "client_ip",
        "window_seconds": 60,
        "limit": null,
        "on_exceed": "refuse"
      },
      {
        "name": "failed_authentications",
        "scope": "client_ip",
        "window_seconds": 60,
        "limit": null,
        "on_exceed": "refuse"
      }
    ]
  }
}
```

Every money field is a micro-USD number, and one USD is a million of them. `as_of` is epoch milliseconds.

* `managed` comes back `null` when no provider runs on Managed Keys.
* `managed.serving` reads `ok` or `paused`. When paused, `paused_reason` carries the matching error code from [the errors page](/errors).
* `managed.binding` names the ceiling closest to stopping you (`balance` or `daily_spend`, with `paused` and `exempt` for the special cases).
* `managed.spend_remaining_micro_usd` matches the `x-flexinference-spend-remaining` header.
* `managed.balance.remaining_micro_usd` adds cash and credit together. `reserved_micro_usd` is money your in-flight requests hold, and we don't subtract it.
* `managed.ramp_week` says which week of the account-age schedule you're in, and `ramp_defaults` is what that week gives you. `override_in_force` means an admin set a number by hand, so the schedule won't move it.
* A `limit` of `null` in `abuse_limits.rates` means the number isn't published. Back off for `Retry-After`.

When we can't read one of these records, you get [`503 limits_unavailable`](/errors#limits_unavailable). Requests keep working.
