---
title: "Replace your live IC Key (same budget, spend carried over, old key revoked)"
method: POST
path: "/api/credits/regenerate"
tags: ["keys", "browser-session"]
---

# Replace your live IC Key (same budget, spend carried over, old key revoked)

`POST /api/credits/regenerate`

## Request

- Base URL: `https://www.immersivecommons.com`
- URL: `https://www.immersivecommons.com/api/credits/regenerate`
- Auth: API key in cookie `__session`

Clerk-session only (agents use ic_credits_regenerate). Revokes the member's live member key in the same call (it 401s at the gateway from then on) and mints a new one with the SAME budget, models and default; this month's and lifetime spend carry over, so a regenerate never resets IC Credits. The new plaintext + both paste blocks are returned ONCE and never stored. No body. Counts against the request cap.

## Response `200`

The new key, surfaced once, with what was revoked and carried over.

- CreditsRegenerateResponse
  - `ok` boolean, required
  - `agent_token` string, required: The new plaintext key, surfaced EXACTLY ONCE.
  - `bundle` object: Ready-to-paste Claude Code + OpenAI-compatible configuration for the new key.
  - `token_prefix` string, required: The new key's prefix.
  - `revoked_prefix` string, required: The old key's prefix; it 401s at the gateway from now on.
  - `carried_over` object, required
    - `month_cost_uusd` integer, required: This month's spend copied onto the new key, micro-USD.
    - `total_cost_uusd` integer, required: Lifetime spend copied onto the new key, micro-USD.

## Other responses

- `401`: Not signed in.
- `404`: No live IC Key to regenerate; request one first.
- `429`: Per-user request cap reached (a regenerate is a mint).
- `500`: Mint failed.

---

[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)
