---
title: "Change a team key's cap or label"
method: PATCH
path: "/v1/keys/team/{key_id}"
tags: ["Account"]
---

# Change a team key's cap or label

`PATCH /v1/keys/team/{key_id}`

## Request

- Base URL: `https://api.puntersedge.online`
- URL: `https://api.puntersedge.online/v1/keys/team/{key_id}`
- Auth: API key in header `X-API-Key`

Cost: 0 credits. Set, change or remove one team key's monthly credit cap, and/or
relabel it. The key string does not change and nothing needs redeploying.

`{"monthly_cap": 5000}` caps this key at 5,000 credits for the rest of this period —
against the counter it has ALREADY spent, so lowering a cap below what a key has used
this month refuses it until the 1st rather than rewriting history. `{"monthly_cap":
null}` removes the cap and lets the key spend the whole pool. Leave a field out and it is
not touched: `{"label": "Jo's laptop"}` alone renames the key and leaves its cap alone.

## Path parameters

- `key_id` string, required: key_id from GET /v1/keys/team.

## Headers

- `X-API-Key` string
- `X-RapidAPI-Proxy-Secret` string

## Request body

- TeamKeyPatchIn: Both fields are optional; only the ones PRESENT in the body are written. `monthly_cap: null` is meaningful (remove the cap) and must not read as "unchanged", so the handler asks model_fields_set which keys the caller actually sent rather than inferring intent from a None that pydantic would produce either way.
  - `label` string, nullable: New label for this key. Omit to leave it alone.
  - `monthly_cap` integer, nullable: Optional. The most credits THIS key may spend per month, hard, inside the account's shared pool — between 1 and the plan's own monthly allowance. Omit it (or send null) and the key may spend the whole pool. Caps reset with the pool on the 1st. Send null to REMOVE an existing cap; omit the field entirely to leave the cap as it is.

## Response `200`

Successful Response

- TeamKeyOut
  - `key_id` string, required
  - `key_hint` string, required
  - `label` string, nullable, required
  - `plan` string, required
  - `created_at` string, nullable
  - `last_used_at` string, nullable
  - `period_calls` integer
  - `period_credits` integer
  - `monthly_cap` integer, nullable: This key's hard per-month credit cap, or null for no cap.
  - `key_credits_used` integer: Credits charged against this key's own counter this period. That is the number the cap is checked against; it stays 0 on an uncapped team key, whose spending is only ever charged to the pool row. Use period_credits for what an uncapped key has spent.

## Other responses

- `401`: Missing or invalid API key. Send `X-API-Key`. See https://puntersedge.online/developers/errors
- `402`: Monthly credit allowance exhausted for this plan. Upgrade at https://puntersedge.online/api/pricing
- `403`: Only the account's primary key may change a team key.
- `404`: No team key with that id on this account.
- `422`: monthly_cap is outside 1..the plan's monthly credit allowance.
- `429`: Rate limit exceeded for this plan. Honour the `Retry-After` header (seconds) before retrying. See https://puntersedge.online/developers/rate-limits
- `500`: Unexpected server error. Safe to retry with backoff.

---

[API](https://skmtc.dev/puntersedge/apis/puntersedge-odds-api.md) · [All operations](https://skmtc.dev/puntersedge/apis/puntersedge-odds-api/llms.txt) · [OpenAPI document](https://skmtc.dev/puntersedge/apis/puntersedge-odds-api/revisions/f35b6aab1946?raw)
