# Redeem an invite or credit code

URL: https://www.atmee.ai/docs/v2/api/reference/account/redeemAccountCode

`POST /v1/account/redeem`

Redeems a code for the account, as Creator Studio's Billing page
does. A code can add credits, let the account into v2 avatars (v2
is invite-only for now: `GET /v1/account`'s `v2Access`), or both;
the answer says what it gave and where v2 access stands after it.
Each account redeems a code at most once.

Only a signed-in user may redeem (the MCP server's sign-in, or
`atmee login`); an API key gets 403 `login_required`, so a leaked
key cannot spend the account's codes. Once v2 is let in, v2 creates
work on the next request.

## Request body

- `application/json`: `RedeemCodeRequest`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | string | yes | The code, as given (case and surrounding spaces do not matter). |

## Responses

| Status | Description | Schema |
| --- | --- | --- |
| `200` | The code was redeemed. | `CodeRedemption` |
| `400` | invalid_body (not JSON) | `ApiErrorResponse` |
| `401` | Missing or invalid API key -- or a user token that is invalid, anonymous, or of a user who may act for no account (invalid_login) | none |
| `403` | login_required (an API key; only a signed-in user redeems) \| redeem_forbidden (the user may not redeem for this account) \| account_not_allowed (a user token whose X-Account-Id names an account the user may not act for) | `ApiErrorResponse` |
| `404` | invalid_code (no such code, or it was switched off) | `ApiErrorResponse` |
| `409` | code_expired \| code_fully_redeemed (no uses left) \| already_redeemed (this account used it) \| own_code_not_redeemable (a creator's own code) \| v2_access_already_granted (a code that only gives v2, and the account has it) -- or account_ambiguous | `ApiErrorResponse` |
| `503` | redeem_unavailable (this instance cannot redeem codes) | `ApiErrorResponse` |

## `200` response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `microcreditsGranted` | integer | yes | Credits the code added, in microcredits (100 = 1 credit); 0 for a code that only gives v2 access. |
| `v2Access` | string (`granted`, `invite_required`, `unavailable`) | no | The account's v2 access after redeeming, as `GET /v1/account` reports it. Absent when it could not be read. |
