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.
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/models | Model capabilities, availability, and enabled pricing configurations. Public. |
| POST /media/uploads | JSON {contentType, bytes}; returns an asset ID and a signed form upload valid for 15 minutes. |
| POST /media/quotes | Validate normalized inputs and uploaded file contents; returns quote ID, chargeMicros, quantity, unit, expiresAt. |
| POST /media/jobs | JSON {quoteId, input} plus Idempotency-Key. Returns the reserved job with HTTP 202. |
| GET /media/jobs | Your 20 newest jobs. Use ?before=nextCursor for older records. |
| GET /media/jobs/:id | Owned job, status, original inputs, reserved/charged amount, and outputs. |
| GET /media/assets/:id | Refresh a validated reference asset’s temporary read URL. |
| GET /media/elements | Your saved elements (people, products, places, styles) with temporary photo URLs. |
| POST /media/elements | JSON {name, kind, images, description?}; saves one to four uploaded photos under a name. Kept until deleted. |
| DELETE /media/elements/:id | Delete 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.
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_edit | Create 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_image | Redraw one image at a higher resolution (for example 4K) without changing its content. The prompt is optional guidance. |
| video | Text 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, motion | Change, recast, or copy the motion of a source video. These use the uploaded video's length; omit settings.duration. |
| extend | Continue a source video. settings.duration is the length to add; the result is the source followed by the new footage. |
| upscale_video | Re-render a source video at a higher resolution, keeping its content. |
| avatar | A talking video from one portrait and an audio track. It lasts as long as the audio unless the model takes a chosen duration. |
| lipsync | Re-time the face in a source video to a new audio track, no longer than the video. settings.keepAudio mixes in the original sound. |
| speech | Text 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.
// 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);
}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.
{
"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 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.
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.
{
"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.
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.
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 ID | Operations | Availability / price |
|---|---|---|
Kling O1kling-video-o1 | video, video edit, replace people | Validation required. |
Kling 3 Omnikling-v3-omni | video, video edit, replace people, upscale video | Validation required. |
Kling 2.5.turbokling-v2-5-turbo | video | Validation required. |
Kling 2.6kling-v2-6 | video | Validation required. |
Kling 3kling-v3 | video | Validation required. |
Kling 3.0 Turbokling-3.0-turbo | video | Validation required. |
Kling 2.6 Motion Controlkling-motion-control | motion | Validation required. |
Kling 3 Motion Controlkling-v3-motion-control | motion | Validation required. |
Kling Avatarkling-avatar | avatar | Validation required. |
Kling Lip Synckling-lipsync | lipsync | Validation required. |
Kling Omni Imagekling-image-o1 | image, image edit | Validation required. |
Seedance 1.0 Prodoubao-seedance-1-0-pro-250528 | video | Validation required. |
Seedance 1.0 Pro Fastdoubao-seedance-1-0-pro-fast-251015 | video | Validation required. |
Seedance 1.5 Prodoubao-seedance-1-5-pro-251215 | video | Validation required. |
Seedance 2.0doubao-seedance-2-0-260128 | video, video edit, replace people, extend | Validation required. |
Seedance 2.0 Fastdoubao-seedance-2-0-fast-260128 | video, video edit, replace people, extend | Validation required. |
Seedance 2.0 Minidoubao-seedance-2-0-mini-260615 | video, video edit, replace people, extend | Validation required. |
Seedance 2.5doubao-seedance-2-5-260628 | video, video edit, replace people, extend | Validation required. |
Veo 3.1veo_3_1 | video | Validation required. |
Veo 3.1 Fastveo_3_1-fast | video | Validation required. |
Veo 3.1 Referencesveo_3_1-components | video | Validation required. |
Hailuo H3MiniMax-H3 | video | Validation required. |
Wan 2.5 Previewwan2.5-i2v-preview | video, avatar | Validation required. |
Wan 2.6wan2.6-i2v | video, avatar | Validation required. |
Wan 3.0wan3.0-video | video | Validation required. |
HappyHorse 1.1happyhorse-1.1 | video | Validation required. |
HappyHorse Edithappyhorse-1.0-video-edit | video edit | Validation required. |
Wan 2.7 Image Prowan2.7-image-pro | image, image edit | Validation required. |
Grok Imagine Videogrok-imagine-video | video, video edit | Validation required. |
Grok Imagine Video 1.5 Previewgrok-imagine-video-1.5-preview | video | Validation required. |
Grok Imagine Imagegrok-imagine-image | image | Validation required. |
Grok imagine image qualitygrok-imagine-image-quality | image, image edit | Validation required. |
Grok imagine image 2.0grok-imagine-image-2.0 | image, image edit | Validation required. |
Nano Bananagemini-2.5-flash-image | image, image edit | Validation required. |
Nano Banana Progemini-3-pro-image | image, image edit, upscale image | Validation required. |
Nano Banana Pro Previewgemini-3-pro-image-preview | image, image edit, upscale image | Validation required. |
Nano Banana 2gemini-3.1-flash-image | image, image edit, upscale image | Validation required. |
Nano Banana 2 Previewgemini-3.1-flash-image-preview | image, image edit, upscale image | Validation required. |
Nano Banana 2.1gemini-nano-banana-2.1 | image, image edit, upscale image | Validation required. |
Nano Banana Litegemini-3.1-flash-lite-image | image, image edit | Validation required. |
Seedream 3doubao-seedream-3-0-t2i-250415 | image | Validation required. |
Seedream 4doubao-seedream-4-0-250828 | image, image edit, upscale image | Validation required. |
Seedream 4.5doubao-seedream-4-5-251128 | image, image edit, upscale image | Validation required. |
Seedream 5 Litedoubao-seedream-5-0-260128 | image, image edit | Validation required. |
Seedream 5 Prodoubao-seedream-5-0-pro-260628 | image, image edit | Validation required. |
GPT Image 2.5 Sunburstgpt-image-2.5-sunburst | image, image edit | Validation required. |
GPT Image 2.5 Flaregpt-image-2.5-flare | image, image edit | Validation required. |
GPT Image 2gpt-image-2 | image, image edit | Validation required. |
GPT Image 1.5gpt-image-1.5 | image, image edit | Validation required. |
MiniMax Speech HDspeech-2.8-hd | speech | Validation required. |
MiniMax Speech Turbospeech-2.8-turbo | speech | Validation required. |
Gemini Speech Progemini-2.5-pro-preview-tts | speech | Validation required. |
Gemini Speech Flashgemini-2.5-flash-preview-tts | speech | Validation required. |
Kling Multi-Elementskling-multi-elements | Catalog entry | Not enabled for this account. |
Google Omniomni-flash | Catalog entry | Not enabled for this account. |
Sora 2sora-2 | Catalog entry | Not enabled for this account. |
Sora 2 Prosora-2-pro | Catalog entry | Not 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.