cURL
curl --request DELETE \
--url https://api.mage.space/v1/characters/{character_id} \
--header 'Authorization: Bearer <token>'import Mage from '@mage-space/sdk';
const mage = new Mage(); // reads MAGE_API_KEY
await mage.characters.delete('CHARACTER_ID');from mage_space import Mage
mage = Mage() # reads MAGE_API_KEY
mage.characters.delete("CHARACTER_ID")const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mage.space/v1/characters/{character_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": {
"code": "unauthorized",
"message": "The API key is invalid or has been revoked."
}
}{
"error": {
"code": "payment_required",
"message": "The Mage API and MCP server need a successful payment on this account first: buy any Gem pack or start a plan at https://www.mage.space/gems, then retry. Signup bonus Gems work in the Mage app only."
}
}{
"error": {
"code": "character_not_found",
"message": "No character with this id belongs to the account."
}
}{
"error": {
"code": "internal_error",
"message": "Something went wrong on our side. Retry, and contact support if it persists."
}
}Endpoints
Delete character
DELETE /v1/characters/ removes one of the account’s characters; its handle stops resolving at once.
DELETE
/
v1
/
characters
/
{character_id}
cURL
curl --request DELETE \
--url https://api.mage.space/v1/characters/{character_id} \
--header 'Authorization: Bearer <token>'import Mage from '@mage-space/sdk';
const mage = new Mage(); // reads MAGE_API_KEY
await mage.characters.delete('CHARACTER_ID');from mage_space import Mage
mage = Mage() # reads MAGE_API_KEY
mage.characters.delete("CHARACTER_ID")const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mage.space/v1/characters/{character_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": {
"code": "unauthorized",
"message": "The API key is invalid or has been revoked."
}
}{
"error": {
"code": "payment_required",
"message": "The Mage API and MCP server need a successful payment on this account first: buy any Gem pack or start a plan at https://www.mage.space/gems, then retry. Signup bonus Gems work in the Mage app only."
}
}{
"error": {
"code": "character_not_found",
"message": "No character with this id belongs to the account."
}
}{
"error": {
"code": "internal_error",
"message": "Something went wrong on our side. Retry, and contact support if it persists."
}
}Remove one of your characters by the
id from GET /v1/characters. The response is 204 with no body. From then on a prompt that mentions its handle is refused with 400 invalid_config, and the handle may be taken by a new character or reference.
Only your own characters can be deleted here; any other id is a 404 character_not_found. Requests that already ran with the character keep their results.Authorizations
Create a key in API → API Keys: select Create API key, name it in the popup, then select Create key. Copy the one-time key and send it as Authorization: Bearer mage_sk_…. Keys are for server-side code only.
Path Parameters
The character's id.
Response
The character was deleted.
Last modified on September 23, 2026

