Tokenless

Images, video, and Studio

Create and edit media with one Tokenless API key. Studio uses this same API and your existing balance. Media prices are quoted separately from text-token pricing; the text API’s 50% discount does not apply to media.

The job lifecycle

Upload references, request a quote, then submit a job. Jobs continue after you disconnect. Polling is free. Quotes expire after five minutes and become invalid when inputs change. Four media jobs can run per account at a time. Files are retained for 30 days; result download links last 15 minutes and can be refreshed by retrieving the job.

GET /media/modelsModel capabilities, availability, and enabled pricing configurations. Public.
POST /media/uploadsJSON {contentType, bytes}; returns an asset ID and a signed form upload valid for 15 minutes.
POST /media/quotesValidate normalized inputs and uploaded file contents; returns quote ID, chargeMicros, quantity, unit, expiresAt.
POST /media/jobsJSON {quoteId, input} plus Idempotency-Key. Returns the reserved job with HTTP 202.
GET /media/jobsYour 20 newest jobs. Use ?before=nextCursor for older records.
GET /media/jobs/:idOwned job, status, original inputs, reserved/charged amount, and outputs.
GET /media/assets/:idRefresh a validated reference asset’s temporary read URL.
GET /media/elementsYour saved elements (people, products, places, styles) with temporary photo URLs.
POST /media/elementsJSON {name, kind, images, description?}; saves one to four uploaded photos under a name. Kept until deleted.
DELETE /media/elements/:idDelete a saved element and its photos.

Base URL: https://api.tokenless.store/api/v1. The /v1 prefix is also supported. Authenticate with Authorization: Bearer sk-tk-…. These normalized media endpoints are separate from OpenAI-compatible text endpoints.

Inputs and settings

operation is one of image, image_edit, upscale_image, video, video_edit, extend, motion, replace_people, upscale_video, lipsync, avatar, or speech. Supply a model ID, prompt, image asset IDs, optional source video, lastFrame, and audio asset IDs, and settings. Model capabilities determine valid durations, resolutions, quality modes, audio, aspect ratios, voices, and reference limits.

image, image_editCreate an image, or edit one to nine reference images. Aspect ratios include 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 4:5, 5:4, and 21:9 where the model supports them.
upscale_imageRedraw one image at a higher resolution (for example 4K) without changing its content. The prompt is optional guidance.
videoText or images to video. One image is the first frame; add lastFrame for an end frame. Set settings.subjects to true to feature the images as characters, products, or places instead of opening on them. Some models also take an audio track to follow.
video_edit, replace_people, motionChange, recast, or copy the motion of a source video. These use the uploaded video's length; omit settings.duration.
extendContinue a source video. settings.duration is the length to add; the result is the source followed by the new footage.
upscale_videoRe-render a source video at a higher resolution, keeping its content.
avatarA talking video from one portrait and an audio track. It lasts as long as the audio unless the model takes a chosen duration.
lipsyncRe-time the face in a source video to a new audio track, no longer than the video. settings.keepAudio mixes in the original sound.
speechText to speech. The prompt is the script (up to 3,000 characters) and settings.voice is one of the model's voices.

References must be uploaded asset IDs owned by your account, not arbitrary URLs. Use still JPG, PNG, or WebP files up to 15 MB and at least 300 pixels on each side. Images over 10 MB are resized before generation. Video uploads accept MP4/MOV up to 200 MB, with duration limits specific to the selected model. Audio uploads accept MP3, WAV, M4A, or AAC up to 30 MB and 5 minutes; each model sets its own audio length limit. Original audio preservation is model-dependent. Use adaptive as the aspect ratio to follow the input where a model offers it.

javascript
// Node.js 22+. Keep TOKENLESS_API_KEY on your server.
import { readFile } from "node:fs/promises";
import { randomUUID } from "node:crypto";
const base = "https://api.tokenless.store/api/v1";
const headers = {
  Authorization: "Bearer " + process.env.TOKENLESS_API_KEY,
  "Content-Type": "application/json"
};
async function api(path, body, extra = {}) {
  const response = await fetch(base + path, {
    method: body ? "POST" : "GET", headers: {...headers, ...extra},
    ...(body ? {body: JSON.stringify(body)} : {})
  });
  const data = await response.json();
  if (!response.ok) throw new Error(data.error?.message || response.statusText);
  return data;
}
async function upload(path, contentType) {
  const bytes = await readFile(path);
  const asset = await api("/media/uploads", {contentType, bytes: bytes.length});
  const form = new FormData();
  for (const [key, value] of Object.entries(asset.upload.fields)) form.append(key, value);
  form.append("file", new Blob([bytes], {type: contentType}), "upload");
  const response = await fetch(asset.upload.url, {method: "POST", body: form});
  if (!response.ok) throw new Error("Upload failed");
  return asset.id;
}

// Discover availability and validated settings before selecting a model.
const {data: models} = await api("/media/models");
console.log(models.filter(m => m.available));

const imageId = await upload("reference.png", "image/png");
const input = {
  model: "gemini-3.1-flash-image", operation: "image_edit",
  prompt: "Change the background to a bright photography studio.",
  images: [imageId], people: [],
  settings: {resolution: "1K", aspectRatio: "16:9", audio: false, keepAudio: true}
};
const quote = await api("/media/quotes", input);
console.log("Maximum charge in USD:", quote.chargeMicros / 1e6);
// Submit only after your user accepts this quote. Preserve this key on retries.
const idempotencyKey = randomUUID();
let job = await api("/media/jobs", {quoteId: quote.id, input}, {
  "Idempotency-Key": idempotencyKey
});
while (["queued", "submitting", "processing"].includes(job.status)) {
  await new Promise(resolve => setTimeout(resolve, 8000));
  job = await api("/media/jobs/" + job.id);
}
if (job.status === "reconciling") {
  console.log("Do not resubmit: this job is awaiting reconciliation.");
} else if (job.status === "succeeded") {
  console.log(job.outputs); // Temporary download URLs and retention expiry
} else {
  console.log(job.error);
}

Speech, talking avatars, and lip sync

Create a voice track with speech, then use its output asset ID as the audio input of an avatar or lipsync job, or upload your own recording. Talking avatars need one clear, front-facing portrait. Lip sync works on one clearly visible face per video and keeps the clip's length.

json
{
  "model": "kling-avatar",
  "operation": "avatar",
  "prompt": "Warm and upbeat, with small hand gestures.",
  "images": [
    "PORTRAIT_ASSET_ID"
  ],
  "audio": "VOICE_TRACK_ASSET_ID",
  "people": [],
  "settings": {
    "mode": "std",
    "aspectRatio": "adaptive",
    "audio": false,
    "keepAudio": true
  }
}

Elements

Elements save the people, products, places, and styles you use often. Create one from one to four uploaded photos, then pass its photo asset IDs as references in any image or video input. Element photos are kept until you delete the element, unlike uploads, which expire after 30 days. Names are unique per account and up to 32 characters; kind is character, product, location, or style.

Replace people

Upload the source video and one replacement photo per person, and describe who each photo replaces, for example by clothing. Each person is replaced in their own pass, in the order they first appear, and each pass edits the previous result. Each pass is checked shot by shot, and a pass that leaves the original person visible is redone once, so the quote reserves one edit per person plus one retry; only the edits that run are charged. A running job reports pass, passes, and retrying. The new person’s face, hair, skin tone, and clothing come from their photo; position, motion, expressions, and timing come from the video. If a later pass fails, the people already replaced are delivered with a notice and only the completed passes are charged. Choose a person count returned by that model’s personCounts capability. Seedance 2.0 accepts source videos up to 15 seconds. Seedance 2.5 accepts up to 30 seconds, with the strongest edit consistency generally at 20 seconds or less. Exact background, identity, or motion preservation is not guaranteed.

json
{
  "model": "doubao-seedance-2-5-260628",
  "operation": "replace_people",
  "prompt": "Keep the scene and original camera movement.",
  "video": "SOURCE_VIDEO_ASSET_ID",
  "images": [],
  "people": [
    {
      "image": "PHOTO_1_ASSET_ID",
      "description": "Left foreground person in a striped shirt"
    },
    {
      "image": "PHOTO_2_ASSET_ID",
      "description": "Right foreground person wearing orange"
    }
  ],
  "settings": {
    "resolution": "720p",
    "aspectRatio": "16:9",
    "audio": false,
    "keepAudio": true
  }
}

Replace the placeholder IDs with real upload IDs, request a quote, and submit it using the same lifecycle above.

Charges, retries, and errors

Prices use integer micro-dollars: 1,000,000 micros = $1. The maximum quoted charge is reserved on submission. A successful job settles once; a confirmed failure releases the reservation. Usage and billing include the model and media quantity. Settings without verified pricing cannot be submitted.

Keep the same Idempotency-Key, quoteId, and input when retrying a submission after a network failure. Reusing the key with different inputs returns 409. A new generation needs a new quote and key. Closing Studio does not cancel a job.

States: queued, submitting, processing, reconciling, succeeded, failed. If the video model is temporarily unavailable, the job keeps retrying for up to 12 hours and its error says so; while it has not started at the provider it reports cancellable and can be canceled for a full release. If the model’s safety filter declines a request, the job fails with an error that says so, is not retried, and releases its reservation; change the prompt or image before trying again. A reconciling job may already have been accepted, so its reservation stays held while its status is checked. Do not start another generation to recover it. Contact support with the job ID if it remains unresolved.

Errors return {"error":{"code":"…","message":"…"}}: 400 invalid/unsupported input; 401 invalid key; 402 insufficient balance; 404 missing or unowned asset/job; 409 expired/changed/used quote or idempotency conflict; 429 active job limit; 503 unavailable model or infrastructure. A failed generation is represented by the job’s failed status.

Media models and current availability

Only available models with an enabled configuration accept quotes. Unverified variants remain listed for discovery and cannot charge your balance. Exact settings and bounded source-duration ranges are returned by /media/models; obtain a quote for the maximum reservation.

Model IDOperationsAvailability / price
Kling O1kling-video-o1video, video edit, replace peopleValidation required.
Kling 3 Omnikling-v3-omnivideo, video edit, replace people, upscale videoValidation required.
Kling 2.5.turbokling-v2-5-turbovideoValidation required.
Kling 2.6kling-v2-6videoValidation required.
Kling 3kling-v3videoValidation required.
Kling 3.0 Turbokling-3.0-turbovideoValidation required.
Kling 2.6 Motion Controlkling-motion-controlmotionValidation required.
Kling 3 Motion Controlkling-v3-motion-controlmotionValidation required.
Kling Avatarkling-avataravatarValidation required.
Kling Lip Synckling-lipsynclipsyncValidation required.
Kling Omni Imagekling-image-o1image, image editValidation required.
Seedance 1.0 Prodoubao-seedance-1-0-pro-250528videoValidation required.
Seedance 1.0 Pro Fastdoubao-seedance-1-0-pro-fast-251015videoValidation required.
Seedance 1.5 Prodoubao-seedance-1-5-pro-251215videoValidation required.
Seedance 2.0doubao-seedance-2-0-260128video, video edit, replace people, extendValidation required.
Seedance 2.0 Fastdoubao-seedance-2-0-fast-260128video, video edit, replace people, extendValidation required.
Seedance 2.0 Minidoubao-seedance-2-0-mini-260615video, video edit, replace people, extendValidation required.
Seedance 2.5doubao-seedance-2-5-260628video, video edit, replace people, extendValidation required.
Veo 3.1veo_3_1videoValidation required.
Veo 3.1 Fastveo_3_1-fastvideoValidation required.
Veo 3.1 Referencesveo_3_1-componentsvideoValidation required.
Hailuo H3MiniMax-H3videoValidation required.
Wan 2.5 Previewwan2.5-i2v-previewvideo, avatarValidation required.
Wan 2.6wan2.6-i2vvideo, avatarValidation required.
Wan 3.0wan3.0-videovideoValidation required.
HappyHorse 1.1happyhorse-1.1videoValidation required.
HappyHorse Edithappyhorse-1.0-video-editvideo editValidation required.
Wan 2.7 Image Prowan2.7-image-proimage, image editValidation required.
Grok Imagine Videogrok-imagine-videovideo, video editValidation required.
Grok Imagine Video 1.5 Previewgrok-imagine-video-1.5-previewvideoValidation required.
Grok Imagine Imagegrok-imagine-imageimageValidation required.
Grok imagine image qualitygrok-imagine-image-qualityimage, image editValidation required.
Grok imagine image 2.0grok-imagine-image-2.0image, image editValidation required.
Nano Bananagemini-2.5-flash-imageimage, image editValidation required.
Nano Banana Progemini-3-pro-imageimage, image edit, upscale imageValidation required.
Nano Banana Pro Previewgemini-3-pro-image-previewimage, image edit, upscale imageValidation required.
Nano Banana 2gemini-3.1-flash-imageimage, image edit, upscale imageValidation required.
Nano Banana 2 Previewgemini-3.1-flash-image-previewimage, image edit, upscale imageValidation required.
Nano Banana 2.1gemini-nano-banana-2.1image, image edit, upscale imageValidation required.
Nano Banana Litegemini-3.1-flash-lite-imageimage, image editValidation required.
Seedream 3doubao-seedream-3-0-t2i-250415imageValidation required.
Seedream 4doubao-seedream-4-0-250828image, image edit, upscale imageValidation required.
Seedream 4.5doubao-seedream-4-5-251128image, image edit, upscale imageValidation required.
Seedream 5 Litedoubao-seedream-5-0-260128image, image editValidation required.
Seedream 5 Prodoubao-seedream-5-0-pro-260628image, image editValidation required.
GPT Image 2.5 Sunburstgpt-image-2.5-sunburstimage, image editValidation required.
GPT Image 2.5 Flaregpt-image-2.5-flareimage, image editValidation required.
GPT Image 2gpt-image-2image, image editValidation required.
GPT Image 1.5gpt-image-1.5image, image editValidation required.
MiniMax Speech HDspeech-2.8-hdspeechValidation required.
MiniMax Speech Turbospeech-2.8-turbospeechValidation required.
Gemini Speech Progemini-2.5-pro-preview-ttsspeechValidation required.
Gemini Speech Flashgemini-2.5-flash-preview-ttsspeechValidation required.
Kling Multi-Elementskling-multi-elementsCatalog entryNot enabled for this account.
Google Omniomni-flashCatalog entryNot enabled for this account.
Sora 2sora-2Catalog entryNot enabled for this account.
Sora 2 Prosora-2-proCatalog entryNot enabled for this account.

Listed rates and quotes are maximum charges. Once the final generation charge is confirmed, any unused reservation returns to your balance automatically. Your charge never exceeds the accepted quote.

Open Studio →