LanaChat

API: Vault-Medien und signierte Uploads

5 Min. LesezeitAktualisiert Markdown

Der Vault enthält Fotos, Videos und Sprachnachrichten einer Creatorin, sortiert in Ordnern. Jedes Element ist Free, Teaser oder Paid mit einem Stars-Preis. Dateien werden niemals über die API übertragen: Sie fordern eine signierte Upload-URL an, senden die Datei dorthin und bestätigen anschließend.

Endpoints #

MethodPathDescriptionPermissionStatus
GET/mediaList media (creator_id= required, folder_id=, type=photo,video,voice, access=free,teaser,paid)can_setupPlanned
POST/media/uploadsGet a signed URL to upload one file (valid 15 minutes)can_setupPlanned
POST/media/uploads/{upload_id}/completeConfirm the upload; the media is created and processedcan_setupPlanned
GET/media/{id}One media, its preview and where it is usedcan_setupPlanned
PATCH/media/{id}Change its description, access, price or foldercan_setupPlanned
DELETE/media/{id}Delete it (refused while a script step uses it)can_setupPlanned
GET/media/foldersFolders of a creator's Vaultcan_setupPlanned
POST/media/foldersCreate a foldercan_setupPlanned
PATCH/media/folders/{id}Rename or move a foldercan_setupPlanned
DELETE/media/folders/{id}Delete an empty foldercan_setupPlanned

The media object #

{
  "id": "med_5521",
  "creator_id": "cr_lea",
  "type": "photo",
  "status": "ready",
  "folder_id": "vf_3",
  "access": "paid",
  "stars": 300,
  "description": "Beach, golden hour, white bikini",
  "preview_url": "https://cdn.lanachat.ai/w/7Hq2/cr_lea/med_5521/preview.jpg",
  "created_at": "2026-10-06T14:21:40Z"
}
FieldTypeDescription
idstringStarts with med_
creator_idstringWhose Vault it is in
typestringphoto, video or voice
statusstringprocessing, ready or failed (with a reason)
folder_idstring or nullIts Vault folder
accessstringfree, teaser or paid
starsnumber or nullPrice in Stars, required when access is paid (1 to 100,000)
descriptionstring or nullHelps the AI pick the right media; never shown to the fan
preview_urlstring or nullA preview, once the media is ready
created_atstringISO 8601, UTC

Media #

List media #

GET /media · can_setup

ParameterTypeRequiredDescription
creator_idstringYesThe creator
folder_idstringNoOnly this folder
typestringNophoto, video or voice; several separated by commas
accessstringNofree, teaser or paid; several separated by commas
limit, cursornumber, stringNoPagination
curl "https://api.lanachat.ai/v1/media?creator_id=cr_lea&type=photo&access=paid" \
  -H "Authorization: Bearer $LANACHAT_TOKEN"
{
  "data": [
    { "id": "med_5522", "creator_id": "cr_lea", "type": "photo", "status": "ready", "folder_id": "vf_3", "access": "paid", "stars": 250, "description": "Mirror, black dress", "preview_url": "https://cdn.lanachat.ai/w/7Hq2/cr_lea/med_5522/preview.jpg", "created_at": "2026-10-06T14:25:10Z" },
    { "id": "med_5521", "creator_id": "cr_lea", "type": "photo", "status": "ready", "folder_id": "vf_3", "access": "paid", "stars": 300, "description": "Beach, golden hour, white bikini", "preview_url": "https://cdn.lanachat.ai/w/7Hq2/cr_lea/med_5521/preview.jpg", "created_at": "2026-10-06T14:21:40Z" }
  ],
  "next_cursor": null
}

Without creator_id the API answers 400.

Upload a file #

Three calls: ask for a signed URL, send the file there, confirm.

Step 1. POST /media/uploads · can_setup

ParameterTypeRequiredDescription
creator_idstringYesWhose Vault receives it
file_namestringYesThe file name, for example beach-01.jpg
content_typestringYesFor example image/jpeg or video/mp4
size_bytesnumberYesFile size, up to 2 GB
folder_idstringNoThe Vault folder to put it in
curl -X POST https://api.lanachat.ai/v1/media/uploads \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"creator_id": "cr_lea", "file_name": "beach-01.jpg", "content_type": "image/jpeg", "size_bytes": 2483201, "folder_id": "vf_3"}'
{
  "upload_id": "up_7781",
  "url": "https://uploads.lanachat.ai/w/7Hq2/up_7781?X-Signature=…&X-Expires=1759760100",
  "method": "PUT",
  "headers": { "Content-Type": "image/jpeg" },
  "expires_at": "2026-10-06T14:35:00Z"
}

The URL is valid 15 minutes.

Step 2. Send the file with PUT to url, with exactly the headers given (no Authorization header there).

curl -X PUT "https://uploads.lanachat.ai/w/7Hq2/up_7781?X-Signature=…&X-Expires=1759760100" \
  -H "Content-Type: image/jpeg" --data-binary @beach-01.jpg

Step 3. POST /media/uploads/{upload_id}/complete · can_setup

curl -X POST https://api.lanachat.ai/v1/media/uploads/up_7781/complete \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"
{
  "id": "med_5521",
  "creator_id": "cr_lea",
  "type": "photo",
  "status": "processing",
  "folder_id": "vf_3",
  "access": "paid",
  "stars": null,
  "description": null,
  "preview_url": null,
  "created_at": "2026-10-06T14:21:40Z"
}

status goes from processing to ready (previews and the Telegram copy are made) or failed with a reason. A webhook media.ready tells you when, see Webhooks. Accepted: JPEG, PNG, HEIC, MP4, MOV, OGG and M4A, up to 2 GB.

Get a media #

GET /media/{id} · can_setup

curl https://api.lanachat.ai/v1/media/med_5521 \
  -H "Authorization: Bearer $LANACHAT_TOKEN"

The answer is the media object, with its preview and where it is used. An unknown id answers 404.

Price and describe #

PATCH /media/{id} · can_setup

ParameterTypeRequiredDescription
accessstringNofree, teaser or paid
starsnumberWhen access is paid1 to 100,000
descriptionstringNoWhat it shows, for the AI
folder_idstring or nullNoMove it to another folder
curl -X PATCH https://api.lanachat.ai/v1/media/med_5521 \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"access": "paid", "stars": 300, "description": "Beach, golden hour, white bikini"}'

The answer is the updated media. stars is required when access is paid (1 to 100,000), otherwise the API answers 400. The description helps the AI pick the right media; it is never shown to the fan.

Delete a media #

DELETE /media/{id} · can_setup

curl -X DELETE https://api.lanachat.ai/v1/media/med_5521 \
  -H "Authorization: Bearer $LANACHAT_TOKEN"

A media that a script step still uses is refused (409): take it out of the script first.

Folders #

List folders #

GET /media/folders · can_setup

ParameterTypeRequiredDescription
creator_idstringYesWhose Vault
curl "https://api.lanachat.ai/v1/media/folders?creator_id=cr_lea" \
  -H "Authorization: Bearer $LANACHAT_TOKEN"

Create a folder #

POST /media/folders · can_setup

ParameterTypeRequiredDescription
creator_idstringYesWhose Vault
namestringYesFolder name
curl -X POST https://api.lanachat.ai/v1/media/folders \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"creator_id": "cr_lea", "name": "Beach"}'

Rename or move a folder #

PATCH /media/folders/{id} · can_setup

curl -X PATCH https://api.lanachat.ai/v1/media/folders/vf_3 \
  -H "Authorization: Bearer $LANACHAT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "Beach, summer"}'

Delete a folder #

DELETE /media/folders/{id} · can_setup

curl -X DELETE https://api.lanachat.ai/v1/media/folders/vf_3 \
  -H "Authorization: Bearer $LANACHAT_TOKEN"

Only an empty folder can be deleted; otherwise the API answers 409.

Die neuesten Nachrichten zu Lana auf Telegram

Neue Releases und Beta-Einladungen, zuerst im Kanal.