Quick start
Generate images and video from your own code. The API uses the same models, prices and credit balance as the studio.
1. Base URL and authentication
The base URL is https://jenvid.com (the site address, without /v1); every path below starts with /v1/... and is appended to it. Create a key in your account under Developer, keep it on your server, and send it on every request. Give the key the generate and read scopes: generate submits and cancels, read polls. Export it as JENVID_API_KEY.
Authorization: Bearer $JENVID_API_KEY
# Also accepted, for tools that send an API key header instead:
X-API-Key: $JENVID_API_KEY2. Models
Pass one of these ids as model. The list is live. Prices and the full parameter list for each model are on the models page and, with a key, in GET /v1/media/models. Without a key use GET /api/public/models.
3. Submit a task
POST /v1/media/generate with the model id, a prompt and optional params. Find model ids and their parameters on the models page (or list them without a key at GET /api/public/models; with a key, GET /v1/media/models also returns each model's params). Send an Idempotency-Key (1-200 characters of A-Za-z0-9._:-) so a retry never charges twice; a repeat returns the original task with Idempotent-Replayed: true. The credits for the job are held right away and the response carries a task_id.
Every key in params must be declared by the model. A misspelled or unknown key (including an unknown top-level key) is rejected with 422 unknown_input and details {"field", "suggestion"}; nothing is held or charged, and the suggestion is never applied for you. To cancel, POST /v1/media/tasks/{id}/cancel returns the task with cancellation as a plain string (cancelled, requested or not_cancellable) plus the additive object ; new code should read . means the job may still finish and be charged. While it is pending, returns with and . Credits are valid for 30 days from when they are added; check and in . and are deprecated and ignored. The studio's mentions do not exist in the API: the prompt is sent as plain text. This also covers keys inside object-type inputs: an undeclared child is rejected as instead of being dropped. A literal , or in an API prompt is plain text; in the studio such a token is a mention ( or ).
4. Video and references
Video models take duration in whole seconds, resolution (for example 720p) and aspect_ratio (for example 16:9) inside params. Modes that use reference files (image to video, video to video) take them in the model's own file params, as lists. Each item is a public https URL or {"asset_id": "<uuid>"} for a ready file in your library. Param names, allowed durations, prices and file counts differ per model, and a video can take 10 to 20 minutes to finish. Always read the model's params.
curl -s https://jenvid.com/v1/media/generate \
-H "Authorization: Bearer $JENVID_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "magi-2-1080p-12s",
"prompt": "slow dolly-in on a lighthouse at dusk, waves below",
"params": {
"duration": 6,
"resolution": "1080p",
"aspect_ratio": "16:9"
}
}'
# Reference files: send "mode": "i2v" and add "images_list": [{"asset_id": "<uuid of a ready image asset>"}] to params (an https URL works too).
# Parameter names, ranges and file limits differ per model: read them from GET /v1/media/models?type=video.5. Upload your own files
Needs a key with the assets scope. Allocate an upload, send the bytes, then finalize. The allocation answer has an upload.auth field that says how to authorize the PUT: same_as_request (the usual case) means send the same Authorization: Bearer key you used to allocate; none means the URL is pre-signed and you must send no Authorization header. Use the method and absolute url given and send the listed headers unchanged. Once the asset is ready, pass its id as {"asset_id": "<uuid>"}.
# 1. Allocate (scope: assets)
curl -s https://jenvid.com/v1/assets/uploads \
-H "Authorization: Bearer $JENVID_API_KEY" -H "Content-Type: application/json" \
-d '{"filename":"ref.mp4","mime":"video/mp4","bytes":4821733}'
# -> { "asset": { "id": "<uuid>", ... },
# "upload": { "method": "PUT", "url": "https://...", "headers": { "Content-Type": "video/mp4" },
# "auth": "same_as_request" | "none", "expires_at": "..." } }
# 2. PUT the bytes exactly as told.
# auth = same_as_request -> also send -H "Authorization: Bearer $JENVID_API_KEY"
# auth = none -> pre-signed URL: send NO Authorization header
curl -s -X PUT "<upload.url>" -H "Content-Type: video/mp4" \
-H "Authorization: Bearer $JENVID_API_KEY" --data-binary @ref.mp4
# 3. Finalize; the asset becomes "ready" (or "failed")
curl -s -X POST https://jenvid.com/v1/assets/<uuid>/complete -H "Authorization: Bearer $JENVID_API_KEY"6. Poll until final
GET /v1/media/tasks/{id} returns the state and, when finished, the output URLs. Poll about every 5 seconds and stop when is_final is true (needs the read scope). Failed tasks are refunded automatically. Each output has a url that works without signing in until url_expires_at; polling again returns the same URL (see below).
timing.timing_basis is supplier_reported or dispatch_to_finish. With the second, the model never reported its start, so model_queue_seconds is null (unknown, not zero) and run_seconds runs from dispatch to finish.
curl -s https://jenvid.com/v1/media/tasks/<task_id> \
-H "Authorization: Bearer $JENVID_API_KEY"
# Repeat about every 5 seconds until the response has "is_final": true.7. Download and retention
Generated files are kept for 1 day (24 hours) from completion; files you upload are kept for 30 days. The original output url works without signing in until url_expires_at, which is the same moment as file_expires_at (UTC, ISO 8601). Polling does not renew it. expires_at is a deprecated alias of file_expires_at. After that the task still reads as succeeded, but its links answer 410 OUTPUT_EXPIRED: download every result in time and store it yourself.
Anyone who has the link can download the file, so treat it as a secret. Disabling or revoking an API key does not revoke links that were already issued.
8. Or receive a webhook
Optional: add notify_url (public https, port 443 or 8443) to the submit body and we POST the final task to it (event type media.task). Delivery is attempted at once, then after 10, 30 and 60 seconds until you answer 2xx. Polling stays available as a fallback. These callbacks are separate from the account webhooks you add in the console (generation.* events, a longer retry schedule, per-endpoint secrets).
curl -s https://jenvid.com/v1/media/generate \
-H "Authorization: Bearer $JENVID_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-image-2.6-flare-2k", "prompt": "a lighthouse at dusk",
"notify_url": "https://your-server.example/hooks/jenvid"}'Each delivery carries JenVid-Signature: v1=<hex>, JenVid-Timestamp, JenVid-Event-Id and JenVid-Event-Type. The signature is HMAC-SHA256 over "<timestamp>.<raw body>" with the secret from GET /v1/media/notify-secret (scope read). Reject timestamps more than 300 seconds off and de-duplicate on JenVid-Event-Id.
import hmac, hashlib, time
def verify(secret: str, raw_body: bytes, ts: str, header: str) -> bool:
if not ts or abs(time.time() - int(ts)) > 300:
return False
expected = hmac.new(secret.encode(), f"{ts}.".encode() + raw_body, hashlib.sha256).hexdigest()
return any(hmac.compare_digest(p.strip()[3:], expected) for p in header.split(",") if p.strip().startswith("v1="))
# secret: GET https://jenvid.com/v1/media/notify-secret (needs the read scope). De-duplicate on the JenVid-Event-Id header.9. Errors
Content refusals come back as content_policy_violation (HTTP 422, not retryable): the prompt is blocked before anything is charged, or the model refuses the input or output and the task ends failed with the same code and a full refund. Change the prompt or reference files and submit again.
Errors look like {"error": {"code", "message", "retryable", "request_id"}}. Do not retry permanent errors; retry transient ones with backoff and honour Retry-After. Quote the request_id (also the X-Request-Id header) to support. Limits: 60 requests per minute per key and 120 per minute per account. Successful responses and 429s carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (unix seconds); a 429 also has Retry-After. Other errors (401, 402, 403, 422) carry only X-Request-Id.
| HTTP | Code | Retry | What to do |
|---|---|---|---|
| 400 | invalid_request | No | Fix the request; error.details.errors[] lists bad params. Also returned as 404 (unknown task id), 409, 413, 415. |