Skip to main content
POST
Create reference
Save a reference: a name, a kind, and the media for that kind. An object, location, pose, or outfit takes an image (an https URL, an upload URL, or a data URL of a JPEG or PNG), stored with the reference for as long as it exists. An audio reference takes an audio clip (MP3 or WAV) instead, which goes through the same processing as a clip uploaded in the app: trimmed to 15 seconds and normalized. The handle follows the same rules as a character’s: 1 to 15 lowercase letters, digits, underscores, or dashes, starting with a letter, unique among live characters and references, and fixed once created. Leave it out to have one derived from the name. A handle already in use is a 409 handle_taken. References created through the API are private.

Authorizations

Authorization
string
header
required

An API key from Settings → API, sent as Authorization: Bearer mage_sk_…. Keys are for server-side code only.

Body

application/json
name
string
required

The display name.

Required string length: 1 - 50
kind
enum<string>
required

What the reference is. The four image kinds take image; audio takes audio.

Available options:
object,
location,
pose,
outfit,
audio
handle
string

The @handle prompts mention it by: 1 to 15 lowercase letters, digits, underscores, or dashes, starting with a letter. Derived from the name when omitted. Cannot be changed later.

image

The image, for the four image kinds: an https URL, an upload URL, or a data URL of a JPEG or PNG. Stored permanently with the reference.

audio

The clip, for kind: "audio": an https URL, an upload URL, or a data URL of an MP3 or WAV. Trimmed to 15 seconds and normalized, like a clip uploaded in the app.

description
string

Optional notes, for your own reference.

Maximum string length: 500

Response

The reference.

id
string<uuid>
required

The reference id, as DELETE /v1/references/{reference_id} takes it.

handle
string
required

Mention the reference in a prompt as @handle.

name
string
required

The display name.

kind
enum<string>
required

What the reference is.

Available options:
object,
location,
pose,
outfit,
audio
description
string | null
required

Your notes, or null.

image_url
string<uri> | null
required

The image, for the four image kinds; null for an audio reference.

audio_url
string<uri> | null
required

The processed clip, for kind: "audio"; null otherwise.

created_at
string<date-time>
required

When it was created.

Last modified on September 18, 2026