Pro API: drive cloud rendering from your own server
Everything the app does online (images, retouching, videos, trained characters) is also reachable over HTTP, at the same price in credits, without the app being open. You drive it from your own server, your scripts or your agent, using the credits on your licence.
Available with the Pro licence. The key is created in the app, under Settings > API.
| Base | https://api.tendre.ai/pro/v1 |
| Authentication | header Authorization: Bearer tk_pro_... |
| Format | JSON in and out, PNG for images, MP4 for videos |
| Machine description | openapi-pro.yaml (OpenAPI 3.0), to generate a client |
Get a key
In the app, with a Pro licence: Settings > API > New key. Give it a name ("production server", say), choose its permissions and, if you want, a daily credit cap and an expiry date.
The key is shown once. Copy it straight away. A lost key is replaced, never recovered.
- Three active keys per licence at most. Enough to rotate one without cutting service: create the new one, install it, revoke the old one.
- A key is not a seat. Your computer and your phone stay usable alongside it.
- A key is worth your credits. Never put one in a web page, a distributed app or a public repository. Give it a daily credit cap as soon as it lives on a server.
What a key is allowed to do
| Permission | What it allows |
|---|---|
| Read | Always granted: render status, file download, balance, character list |
| Images | Submit and cancel images (generation, retouching, variation) |
| Videos | Submit and cancel videos |
A call beyond the key's permissions answers 403 portee_manquante, with the missing
permission in portee.
The render lifecycle
Always the same three steps.
- Submit.
POST /imagesorPOST /videos. Immediate answer with ajobIdand the cost. - Poll.
GET /images/{jobId}orGET /videos/{jobId}, every 3 seconds, untilstatusiscompletedorfailed. - Download.
GET /images/{jobId}/fileorGET /videos/{jobId}/file, as soon as the status iscompleted. The file is not kept, so download it without waiting.
Rough timings: 10 to 40 seconds for an image, 1 to 5 minutes for a video, longer when the engine starts cold.
Your first call
KEY=tk_pro_...
B=https://api.tendre.ai/pro/v1
curl -s $B/credits -H "Authorization: Bearer $KEY"
{ "balance": 1830, "licenseId": "lic_...", "key": "k_1a2b3c4d",
"limits": { "concurrent": 2, "perMinute": 60, "perDay": 0 }, "running": 0 }
If that answers, everything else will.
A complete render, three ways
bash
KEY=tk_pro_...
B=https://api.tendre.ai/pro/v1
JOB=$(curl -s $B/images -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"prompt":"a lighthouse at dawn, photorealistic","width":1216,"height":832}' | jq -r .jobId)
until curl -s $B/images/$JOB -H "Authorization: Bearer $KEY" | grep -q '"completed"'; do sleep 3; done
curl -s $B/images/$JOB/file -H "Authorization: Bearer $KEY" -o lighthouse.png
PowerShell
$H = @{ Authorization = "Bearer tk_pro_..." }
$B = "https://api.tendre.ai/pro/v1"
$job = Invoke-RestMethod -Uri "$B/videos" -Method Post -Headers $H -ContentType "application/json" `
-Body '{"prompt":"waves on a beach at sunset, gentle wind","width":1080,"height":1920,"audio":true}'
do { Start-Sleep 5; $s = Invoke-RestMethod -Uri "$B/videos/$($job.jobId)" -Headers $H } while ($s.status -eq "pending")
Invoke-WebRequest -Uri "https://api.tendre.ai$($s.file_url)" -Headers $H -OutFile beach.mp4
Python
import time, requests
KEY, B = "tk_pro_...", "https://api.tendre.ai/pro/v1"
H = {"Authorization": f"Bearer {KEY}"}
job = requests.post(f"{B}/videos", headers=H, json={"prompt": "waves on a beach at sunset, gentle wind", "audio": True}).json()
while (s := requests.get(f"{B}/videos/{job['jobId']}", headers=H).json())["status"] == "pending":
time.sleep(3)
if s["status"] == "completed":
open("beach.mp4", "wb").write(requests.get("https://api.tendre.ai" + s["file_url"], headers=H).content)
else:
print("failed:", s.get("detail"))
Where to go next
- Images: generation, the three retouching modes, characters.
- Videos: formats, the price grid, start and end frames.
- Account: balance, caps, trained characters, activity.
- Limits and errors: caps, every error code, good practice.
What is not there yet
In the order planned: character training from your own photos, voices, upscaling to 2K, a fixed seed to reproduce a render, and webhooks so you can stop polling.
The API is versioned. Everything described here stays valid under /pro/v1: additions never
break what exists, and a breaking change would ship as /pro/v2.