Atmee.aiDocs
APIAPI referenceAccount

Redeem an invite or credit code

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.

Authorization

headerAuthorizationBearer <JWT>

A signed-in Supabase user's access token -- from the project's OAuth 2.1 server (an MCP client) or a normal login -- sent as Authorization: Bearer <token>, on the avatar routes and the API session routes, where the deployment accepts user tokens. The user acts for one of their accounts: their only one, or the one the X-Account-Id header names (it must be theirs: otherwise 403 account_not_allowed); a user of several accounts who names none is answered 409 account_ambiguous (the account is never guessed), whose body also lists the accounts to choose from (accounts: each id, and username when it has one). The user may read and write the account's avatars and start the account's sessions, which are billed to that account; sponsoring and every other money move take an API key only. An anonymous user, and a user who is banned, deleted or no longer a member, is refused (401). Sending this and X-Api-Key together is 400. An API key ignores X-Account-Id.

Request Body

application/json
  1. body
code*string

The code, as given (case and surrounding spaces do not matter).

Length1 <= length <= 64

Response Body

The code was redeemed.

application/json
  1. response
microcreditsGranted*integer

Credits the code added, in microcredits (100 = 1 credit); 0 for a code that only gives v2 access.

Formatint64
v2Access?string

The account's v2 access after redeeming, as GET /v1/account reports it. Absent when it could not be read.

Value in"granted""invite_required""unavailable"
Example Request
curl -X POST 'https://api.atmanity.us/v1/account/redeem' \  -H 'Content-Type: application/json' \  -d '{  "code": "string"}'
Example Response
{  "microcreditsGranted": 0,  "v2Access": "granted"}
Redeem an invite or credit code — Atmee Docs