---
title: "Set the spending limit"
method: PUT
path: "/v2/teamspaces/{teamspaceId}/spending-limit"
tags: ["Teamspace Admin"]
---

# Set the spending limit

`PUT /v2/teamspaces/{teamspaceId}/spending-limit`

## Request

- Base URL: `https://context7.com/api`
- URL: `https://context7.com/api/v2/teamspaces/{teamspaceId}/spending-limit`
- Auth: HTTP bearer

Caps billed API usage per month; requests over the cap are refused. Owners and admins only.

## Request body

- object
  - `limitCents` integer, nullable, required: Cents; null removes the limit.

## Response `200`

Spending limit saved

- TeamspaceSpendingLimit
  - `limitCents` integer, nullable: Monthly cap on billed API usage in cents; null is no cap.
  - `currentSpendCents` integer: Billed API usage this month, in cents.
  - `canEdit` boolean: GET only. The caller is an owner or admin.
  - `alreadyOver` boolean: PUT only. This month's spend already reaches the new limit.

## Other responses

- `400`: Bad Request - Invalid input parameters
- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden - Insufficient permissions or plan restrictions
- `500`: Internal Server Error

## Changes

- **2026-10-22** `e17589fd8767`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/context7/apis/context7-public-api/changes/v2/teamspaces/:teamspaceId/spending-limit/put.md)

---

[API](https://skmtc.dev/context7/apis/context7-public-api.md) - [All operations](https://skmtc.dev/context7/apis/context7-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/context7/apis/context7-public-api/revisions/945f7834fa8c?raw)
