DocsAPI referenceOperations
Estimate an AI upscale
What POST /v1/ai-upscale with the same body would reserve under your plan, and how long it is expected to take. No job is made, nothing is fetched and no credits are used. The input is not read, so the clip is the trim's duration or the plan's longest, both frame-rate bands are given, and the enhancement (full or faithful) is not known yet: it is chosen from the input's size. A scoped API key needs the jobs:run scope (full keys may call it).
POST /v1/ai-upscale/estimate
Needs an API key: Authorization: Bearer $VIDEXO_API_KEY.
Body AiUpscaleRequest
| Name | Type | Description |
|---|---|---|
input required | string or object | An http or https URL, videxo://uploads/<upload_id>, { "url" } or { "upload_id" }. |
resolution required | one of 1080p, 1440p, 4k | The target: 1080p, 1440p or 4k. The input must be smaller. |
frame_rate | one of source, smooth | source (default) keeps the input's rate, at most 60 fps; smooth doubles a rate of 30 fps or less. |
trim | object | The part of the input to process, in seconds. |
audio | one of keep, remove | keep (default) puts the source's own sound back in sync; remove leaves the output silent. |
filename | string | The stored file name; .mp4 only. |
webhook_url | string, URL, up to 2,048 characters or null | An https URL that gets the job when it ends (M4). |
metadata | map of string to string, up to 500 characters | Your own string pairs, returned with the job and its webhook: at most 20 keys of up to 40 characters, values up to 500. |
Request
bash
curl "$VIDEXO_API_URL/v1/ai-upscale/estimate" \
-H "Authorization: Bearer $VIDEXO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "https://videxo.io/samples/talk.mp4",
"resolution": "1080p",
"trim": {
"start": 0,
"duration": 8
}
}'Copy failed. The text is selected; copy it with your keyboard.
JavaScript
const response = await fetch(`${process.env.VIDEXO_API_URL}/v1/ai-upscale/estimate`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VIDEXO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"input": "https://videxo.io/samples/talk.mp4",
"resolution": "1080p",
"trim": {
"start": 0,
"duration": 8
}
}),
});
const estimate = await response.json();Copy failed. The text is selected; copy it with your keyboard.
Response
200 JSON
{
"operation": "ai_upscale",
"max_seconds": 8,
"credits_base": 75,
"credits_per_second": 64,
"credits_max": 587,
"expected_wait_seconds": {
"low": 146,
"high": 446
},
"frame_rate_bands": {
"up_to_30_fps": {
"credits_per_second": 32,
"credits_max": 331,
"expected_wait_seconds": {
"low": 73,
"high": 373
}
},
"above_30_fps": {
"credits_per_second": 64,
"credits_max": 587,
"expected_wait_seconds": {
"low": 146,
"high": 446
}
}
}
}Copy failed. The text is selected; copy it with your keyboard.
Responses
| Status | Body | When |
|---|---|---|
| 200 | AiUpscaleEstimate | What the job would reserve, and its expected wait. |
| 400 | Problem | invalid_request (with errors) |
| 401 | Problem | authentication_failed (missing_api_key, invalid_api_key, api_key_revoked, api_key_expired) |
| 403 | Problem | permission_denied (token_scope): a client token cannot call this route; permission_denied (key_scope): a scoped API key without jobs:run |
| 413 | Problem | limit_exceeded: request_body_size (the body is larger than 512 KB), media_resolution (the plan does not offer the target) or media_duration (trim.duration is longer than the plan allows) |
| 415 | Problem | invalid_request (not_json): the body is not sent as application/json |
| 429 | Problem | rate_limited, with Retry-After in seconds |
| 500 | Problem | internal_error |
| 503 | Problem | service_unavailable (temporary) |