---
title: "Change a live IC Key's monthly IC Credits budget in place"
method: POST
path: "/api/credits/admin/set-budget"
tags: ["keys"]
---

# Change a live IC Key's monthly IC Credits budget in place

`POST /api/credits/admin/set-budget`

## Request

- Base URL: `https://www.immersivecommons.com`
- URL: `https://www.immersivecommons.com/api/credits/admin/set-budget`
- Auth: one of:
  - API key in cookie `__session`
  - HTTP bearer

Clerk operator session OR an agt_ token carrying `admin:llm_keys`, live tier re-checked. The HTTP twin of the MCP tool `ic_credits_admin_set_budget`. Rewrites the key's proxy block with the new monthly budget (no re-mint, no new plaintext); the gateway enforces the new number on the key's next call. A legacy weekly-token key is moved to the budget model by the same write. Name the key by `token_sha256` OR by `clerk_user_id` (that member's live member key), exactly one. Workshop keys are refused (fixed $5 lifetime). Audited as `set_budget`.

## Request body

- CreditsSetBudgetRequest
  - `budget_usd` 5 | 10 | 20 | 50 | 100, required: The new monthly budget of IC Credits in USD.
  - `token_sha256` string: The key to change, by sha256. Exactly one of token_sha256 / clerk_user_id.
  - `clerk_user_id` string: The member whose live member key to change. Exactly one of token_sha256 / clerk_user_id.

## Response `200`

The key's prefix with the budget before and after.

- CreditsSetBudgetResponse
  - `ok` boolean, required
  - `token_prefix` string, required
  - `before` number, nullable: The previous monthly budget, or null on a legacy weekly-token key.
  - `after` number, required

## Other responses

- `400`: Invalid JSON, an out-of-set budget_usd, or neither / both selectors.
- `401`: No auth.
- `403`: Not an operator / scope not authorized, or a workshop key.
- `404`: No such live key.
- `409`: The key is revoked.

---

[API](https://skmtc.dev/immersivecommons/apis/immersive-commons-agent-rest-api.md) · [All operations](https://skmtc.dev/immersivecommons/apis/immersive-commons-agent-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/immersivecommons/apis/immersive-commons-agent-rest-api/revisions/be67c1f67c27?raw)
