Download OpenAPI specification:
API fro ChatRPG
New user registration
| name required | string Name of new user |
| email required | string <email> Email address of new user |
| password required | string Password for user |
| confirm_password required | string Confirmation password |
| url | string <url> User validation. Create hidden input, empty by default. Fails if it is anything other than an empty string. |
{- "name": "John Smith",
- "email": "john.smith@mail.com",
- "password": "password123",
- "confirm_password": "password123",
- "url": ""
}{- "success": true
}User login
| email required | string <email> User email |
| password required | string <password> User password |
{- "email": "john.smith@mail.com",
- "password": "password123"
}{- "success": true
}Create the Stripe payment intent for the user
| token_packs required | number >= 5 Number of token packs for the user to purchase |
{- "token_packs": 8
}{- "client-secret": "pi_3MtwBwLkdIwHu7ix28a3tqPa_secret_YrKJUKribcBjcG8HVhfZluoGH"
}[- {
- "id": "019eb747-4371-7230-b3f0-53550cd253c6",
- "title": "Demon Barber of Fleet Street",
- "world_context": "Lorem Ipsum, etc...",
- "created_at": "2026-06-11T15:26:34.176Z"
}
]Create a new game
| title required | string Title for the game |
| game_context required | string Any information/context that the user wants to provide for the running of the overall game. |
{- "title": "Demon Barber of Fleet Street",
- "game_context": "Lorem Ipsum, etc..."
}{- "id": "019eb747-4371-7230-b3f0-53550cd253c6",
- "title": "Demon Barber of Fleet Street",
- "world_context": "Lorem Ipsum, etc...",
- "created_at": "2026-06-11T15:26:34.176Z"
}Retrieve all necessary data for a single game
| game_id required | string <uuid> Example: 019ec246-dd08-7e1b-ba4e-e941d8ba2206 Game ID |
{- "game": {
- "id": "019eb747-4371-7230-b3f0-53550cd253c6",
- "title": "Demon Barber of Fleet Street",
- "world_context": "Lorem Ipsum, etc...",
- "created_at": "2026-06-11T15:26:34.176Z"
}, - "character": {
- "id": "019eb74c-632b-7c1e-87bc-bac42335d85a",
- "game_id": "019eb74e-00ce-76ca-a88e-6ffaa8062b26",
- "name": "Sweeney Todd",
- "description": "Lorem Ipsum, etc..."
}, - "sessions": [
- {
- "id": "019eb74f-c5c3-771c-b3ce-399a9ffeafe0",
- "game_id": "cbc7d94e-12fe-4773-b095-43ce28d601d4",
- "summary": "Lorem Ipsum, etc...",
- "started_at": "2026-06-11T15:42:12.281Z",
- "ended_at": "2026-06-11T15:42:50.417Z"
}
], - "turns": [
- {
- "id": "019eb75b-bb35-77b7-a16f-38b85223085d",
- "session_id": "019eb75c-41cd-7456-95fe-382787dc4f12",
- "tokens_used": 1876,
- "user_text": "Lorem Ipsum, etc...",
- "llm_text": "Lorem Ipsum, etc...",
- "created_at": "2026-06-11T15:48:40.705Z"
}
], - "tokens_remaining": 873042
}Create playable character for a game
| game_id required | string <uuid> Example: 019eb861-4cca-7721-8eb6-524f9edc6d17 Game ID |
| name required | string User chosen name of the character |
| description required | string User provided details/description of their character |
{- "name": "Sweeney Todd",
- "description": "Lorem Ipsum, etc..."
}{- "id": "019eb74c-632b-7c1e-87bc-bac42335d85a",
- "game_id": "019eb74e-00ce-76ca-a88e-6ffaa8062b26",
- "name": "Sweeney Todd",
- "description": "Lorem Ipsum, etc..."
}Create a new session. Will also be the first turn to set the scene.
| game_id required | string <uuid> Example: 019eb91d-9820-7624-b22b-4e2423b1942b Game ID |
{- "id": "019eb74f-c5c3-771c-b3ce-399a9ffeafe0",
- "game_id": "cbc7d94e-12fe-4773-b095-43ce28d601d4",
- "summary": "Lorem Ipsum, etc...",
- "started_at": "2026-06-11T15:42:12.281Z",
- "ended_at": "2026-06-11T15:42:50.417Z"
}Create a new turn
| game_id required | string <uuid> Example: 019ec14f-c42c-7ad2-a0fb-37f712eba704 Game ID |
| session_id required | string <uuid> Example: 019ec150-72ef-7f9e-b164-6dbbcc045e29 Session ID |
| content required | string User response and instructions for the turn |
{- "content": "Pull out my sword and swing at the enemy"
}{- "turn": {
- "id": "019eb75b-bb35-77b7-a16f-38b85223085d",
- "session_id": "019eb75c-41cd-7456-95fe-382787dc4f12",
- "tokens_used": 1876,
- "user_text": "Lorem Ipsum, etc...",
- "llm_text": "Lorem Ipsum, etc...",
- "created_at": "2026-06-11T15:48:40.705Z"
}, - "tokens_remaining": 997364
}