curl --request POST 'https://api.voicecheap.ai/v1/actions/thumbnails_generate' \
--header "x-api-key: $VOICECHEAP_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"requestId":"2fcb6b7f-4e5d-421a-b35b-b68548dfd83e","prompt":"A clean YouTube thumbnail showing a mountain sunrise, with the text “A new adventure”.","referenceImageKeys":["uploads/example-user/2502829e-3fde-4aad-b3c7-ce0f779fa2e6-reference.png"]}'
const input = {
requestId: '2fcb6b7f-4e5d-421a-b35b-b68548dfd83e',
prompt: 'A clean YouTube thumbnail showing a mountain sunrise, with the text “A new adventure”.',
referenceImageKeys: ['uploads/example-user/2502829e-3fde-4aad-b3c7-ce0f779fa2e6-reference.png'],
};
const response = await fetch('https://api.voicecheap.ai/v1/actions/thumbnails_generate', {
method: 'POST',
headers: {
'x-api-key': process.env.VOICECHEAP_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify(input),
});
const body = await response.json();
if (!response.ok) throw new Error(body.code + ': ' + body.message);
console.log(body);
import os
import requests
response = requests.post(
"https://api.voicecheap.ai/v1/actions/thumbnails_generate",
headers={"x-api-key": os.environ["VOICECHEAP_API_KEY"]},
json={"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e", "prompt": "A clean YouTube thumbnail showing a mountain sunrise, with the text “A new adventure”.", "referenceImageKeys": ["uploads/example-user/2502829e-3fde-4aad-b3c7-ce0f779fa2e6-reference.png"]},
timeout=120,
)
body = response.json()
if not response.ok:
raise RuntimeError(f"{body.get('code')}: {body.get('message')}")
print(body)
{
"data": {
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e",
"status": "running",
"pollAction": "action_request_get",
"pollAfterSeconds": 5
},
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e"
}
{
"data": {
"generationId": "109c61cb35dbdc01a94aabb3b1a128519ed1f8823800a7a327b9d8d8c2c0e10b",
"status": "completed",
"width": 1280,
"height": 720,
"referenceImageCount": 1,
"createdAt": 1792144800000,
"updatedAt": 1792144800000,
"expiresAt": 1792749600000
},
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e"
}
{
"data": {
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e",
"operation": "thumbnails_generate",
"createdAt": 1792144800000,
"updatedAt": 1792144820000,
"status": "running",
"pollAfterSeconds": 5
},
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e"
}
{
"data": {
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e",
"operation": "thumbnails_generate",
"createdAt": 1792144800000,
"updatedAt": 1792144820000,
"status": "completed",
"resultStored": false,
"message": "The action completed. Retrieve its output from the corresponding history or resource action."
},
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e"
}
Thumbnails
Generate a YouTube thumbnail
Generate a 1280×720 thumbnail for the connected account, using the web app’s media allowance. Reuse requestId when retrying the same request; use thumbnails_download to retrieve the result.
POST
/
v1
/
actions
/
thumbnails_generate
curl --request POST 'https://api.voicecheap.ai/v1/actions/thumbnails_generate' \
--header "x-api-key: $VOICECHEAP_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"requestId":"2fcb6b7f-4e5d-421a-b35b-b68548dfd83e","prompt":"A clean YouTube thumbnail showing a mountain sunrise, with the text “A new adventure”.","referenceImageKeys":["uploads/example-user/2502829e-3fde-4aad-b3c7-ce0f779fa2e6-reference.png"]}'
const input = {
requestId: '2fcb6b7f-4e5d-421a-b35b-b68548dfd83e',
prompt: 'A clean YouTube thumbnail showing a mountain sunrise, with the text “A new adventure”.',
referenceImageKeys: ['uploads/example-user/2502829e-3fde-4aad-b3c7-ce0f779fa2e6-reference.png'],
};
const response = await fetch('https://api.voicecheap.ai/v1/actions/thumbnails_generate', {
method: 'POST',
headers: {
'x-api-key': process.env.VOICECHEAP_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify(input),
});
const body = await response.json();
if (!response.ok) throw new Error(body.code + ': ' + body.message);
console.log(body);
import os
import requests
response = requests.post(
"https://api.voicecheap.ai/v1/actions/thumbnails_generate",
headers={"x-api-key": os.environ["VOICECHEAP_API_KEY"]},
json={"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e", "prompt": "A clean YouTube thumbnail showing a mountain sunrise, with the text “A new adventure”.", "referenceImageKeys": ["uploads/example-user/2502829e-3fde-4aad-b3c7-ce0f779fa2e6-reference.png"]},
timeout=120,
)
body = response.json()
if not response.ok:
raise RuntimeError(f"{body.get('code')}: {body.get('message')}")
print(body)
{
"data": {
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e",
"status": "running",
"pollAction": "action_request_get",
"pollAfterSeconds": 5
},
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e"
}
{
"data": {
"generationId": "109c61cb35dbdc01a94aabb3b1a128519ed1f8823800a7a327b9d8d8c2c0e10b",
"status": "completed",
"width": 1280,
"height": 720,
"referenceImageCount": 1,
"createdAt": 1792144800000,
"updatedAt": 1792144800000,
"expiresAt": 1792749600000
},
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e"
}
{
"data": {
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e",
"operation": "thumbnails_generate",
"createdAt": 1792144800000,
"updatedAt": 1792144820000,
"status": "running",
"pollAfterSeconds": 5
},
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e"
}
{
"data": {
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e",
"operation": "thumbnails_generate",
"createdAt": 1792144800000,
"updatedAt": 1792144820000,
"status": "completed",
"resultStored": false,
"message": "The action completed. Retrieve its output from the corresponding history or resource action."
},
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e"
}
Generate a 1280×720 thumbnail for the connected account, using the web app’s media allowance. Reuse requestId when retrying the same request; use thumbnails_download to retrieve the result.
Required permissions:
POST https://api.voicecheap.ai/v1/actions/thumbnails_generate
Authentication and permissions
string
required
Send a VoiceCheap API key in this header. Authorization: Bearer with the same API key is also supported. OAuth access tokens are accepted only by
MCP, not by this REST endpoint.
thumbnails:write.
An active paid subscription is required. Permissions do not change team roles, resource ownership, media credits, or plan limits.
Parameters
string
Optional at the transport boundary: the server injects an identifier before validation when omitted. Supply your own stable UUID v4 to recover safely from a lost response.Format: “uuid”. Pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$.string
required
Text value.Minimum length: 10. Maximum length: 1200.
array
List of values. See the complete input schema for its item structure.Maximum items: 3. Default: [].
Complete input schema
Complete input schema
The JSON Schema below preserves the exact field names, nested types, defaults, bounds, and accepted values exposed by discovery. Additional cross-field rules are listed in the operation notes.
{
"type": "object",
"properties": {
"requestId": {
"type": "string",
"format": "uuid",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
"description": "UUID v4 for this action. Reuse the same ID with identical arguments on retries."
},
"prompt": {
"type": "string",
"minLength": 10,
"maxLength": 1200
},
"referenceImageKeys": {
"default": [],
"maxItems": 3,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 512,
"description": "An uploaded JPG, PNG or WebP object key under uploads/{yourUserId}/. Remote URLs are not accepted."
}
}
},
"required": ["prompt"],
"additionalProperties": false
}
Idempotency
Use a UUID v4 in requestId or the Idempotency-Key HTTP header for each mutation. Reuse the same identifier and identical arguments after a network failure. If both are supplied, they must match. Replaying a saved request does not repeat the operation or charge another monthly call. Failed or interrupted requests are not restarted automatically. Every mutation can return HTTP 202 when a retry finds the same request still running, even when its first execution is normally synchronous. If execution completed but resultStored is false, a retry returns HTTP 200 with saved request state instead of the original result. Retrieve the output through its domain history, result, or download action.Request examples
Replace example resource identifiers and media keys with values returned for your account. Keep the request identifier stable when retrying the same mutation.curl --request POST 'https://api.voicecheap.ai/v1/actions/thumbnails_generate' \
--header "x-api-key: $VOICECHEAP_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"requestId":"2fcb6b7f-4e5d-421a-b35b-b68548dfd83e","prompt":"A clean YouTube thumbnail showing a mountain sunrise, with the text “A new adventure”.","referenceImageKeys":["uploads/example-user/2502829e-3fde-4aad-b3c7-ce0f779fa2e6-reference.png"]}'
const input = {
requestId: '2fcb6b7f-4e5d-421a-b35b-b68548dfd83e',
prompt: 'A clean YouTube thumbnail showing a mountain sunrise, with the text “A new adventure”.',
referenceImageKeys: ['uploads/example-user/2502829e-3fde-4aad-b3c7-ce0f779fa2e6-reference.png'],
};
const response = await fetch('https://api.voicecheap.ai/v1/actions/thumbnails_generate', {
method: 'POST',
headers: {
'x-api-key': process.env.VOICECHEAP_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify(input),
});
const body = await response.json();
if (!response.ok) throw new Error(body.code + ': ' + body.message);
console.log(body);
import os
import requests
response = requests.post(
"https://api.voicecheap.ai/v1/actions/thumbnails_generate",
headers={"x-api-key": os.environ["VOICECHEAP_API_KEY"]},
json={"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e", "prompt": "A clean YouTube thumbnail showing a mountain sunrise, with the text “A new adventure”.", "referenceImageKeys": ["uploads/example-user/2502829e-3fde-4aad-b3c7-ce0f779fa2e6-reference.png"]},
timeout=120,
)
body = response.json()
if not response.ok:
raise RuntimeError(f"{body.get('code')}: {body.get('message')}")
print(body)
Response
This operation returns HTTP 202 while running. Save requestId and poll action_request_get with that identifier and the original operation name. Polling states are running, completed, failed, and interrupted. A completed result can point to a separate media job; continue with the operation-specific status or output action. Final thumbnail metadata returned after generation finishes. The output is 1280 × 720 pixels; image bytes, previewDataUrl, and handoff tokens are not included.{
"data": {
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e",
"status": "running",
"pollAction": "action_request_get",
"pollAfterSeconds": 5
},
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e"
}
{
"data": {
"generationId": "109c61cb35dbdc01a94aabb3b1a128519ed1f8823800a7a327b9d8d8c2c0e10b",
"status": "completed",
"width": 1280,
"height": 720,
"referenceImageCount": 1,
"createdAt": 1792144800000,
"updatedAt": 1792144800000,
"expiresAt": 1792749600000
},
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e"
}
{
"data": {
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e",
"operation": "thumbnails_generate",
"createdAt": 1792144800000,
"updatedAt": 1792144820000,
"status": "running",
"pollAfterSeconds": 5
},
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e"
}
{
"data": {
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e",
"operation": "thumbnails_generate",
"createdAt": 1792144800000,
"updatedAt": 1792144820000,
"status": "completed",
"resultStored": false,
"message": "The action completed. Retrieve its output from the corresponding history or resource action."
},
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e"
}
Result fields
| Field | Description |
|---|---|
data.generationId | Identifier to pass unchanged to thumbnails_get or thumbnails_download. |
data.status | completed, expired, or deleted. A deleted record remains deleted even after its expiry time. |
data.width | Output width in pixels: 1280. |
data.height | Output height in pixels: 720. |
data.referenceImageCount | Number of reference images used: 0 to 3. |
data.createdAt | Creation time in Unix milliseconds. |
data.updatedAt | Last update time in Unix milliseconds. |
data.expiresAt | Time in Unix milliseconds after which the generated thumbnail cannot be downloaded. |
Recover and poll this request
Use the same identifier even after a lost connection. If resultStored is false, retrieve the output through the corresponding history, result, or download action. Never start a second generation merely to check progress.curl --request POST 'https://api.voicecheap.ai/v1/actions/action_request_get' \
--header "x-api-key: $VOICECHEAP_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"requestId":"2fcb6b7f-4e5d-421a-b35b-b68548dfd83e","operation":"thumbnails_generate"}'
HTTP 200
{
"data": {
"requestId": "2fcb6b7f-4e5d-421a-b35b-b68548dfd83e",
"operation": "thumbnails_generate",
"status": "completed",
"createdAt": 1792144800000,
"updatedAt": 1792144820000,
"resultStored": true,
"result": {
"generationId": "109c61cb35dbdc01a94aabb3b1a128519ed1f8823800a7a327b9d8d8c2c0e10b",
"status": "completed",
"width": 1280,
"height": 720,
"referenceImageCount": 1,
"createdAt": 1792144800000,
"updatedAt": 1792144800000,
"expiresAt": 1792749600000
}
}
}
Operation notes
- Requires thumbnails:write. The prompt is trimmed and must contain 10–1200 characters; it is also normalized before generation. referenceImageKeys defaults to [] and accepts at most three keys.
- This is a long-running action. The initial API/MCP response normally reports running; poll action_request_get with operation thumbnails_generate and the same requestId to obtain the final result shown here.
- Uses the account’s normal daily thumbnail-generation allowance. New account thumbnails expire seven days after creation; download the result before expiresAt.
- This action uses the connected user’s own creations and uploads, including when the credential is connected in a team context.
- Reference keys must point to completed uploads under uploads/{yourUserId}/ and end in .jpg, .jpeg, .png, or .webp. Remote URLs, other users’ keys, traversal segments, backslashes, percent escapes, query strings, fragments, and control characters are rejected.
- Each reference must be non-empty, at most 8 MiB (8,388,608 bytes), decode as the image type identified by its extension, and measure 128–4096 pixels on each side. Decoded pixel counts are bounded as well. An uploaded reference remains reusable; these generation actions do not consume or delete its uploaded file.
- Use a UUID v4 requestId, or the HTTP Idempotency-Key header, and reuse it with identical inputs when retrying. The integration layer records each mutation and returns its recorded state or result without rerunning it. A failed or interrupted request is not automatically retried.
- A completed request can return the existing thumbnail. A previously failed or interrupted integration request is not rerun automatically. Inspect request state and thumbnails_list before starting a new request.
- Use thumbnails_get or thumbnails_list for metadata and thumbnails_download for WebP bytes. The generation identifier is an opaque string, not requestId.
Usage
Each successful invocation consumes one monthly API/MCP call. Media credits and the operation’s own generation allowances also apply.Errors
| HTTP status | Code | Meaning or recovery |
|---|---|---|
| 400 | CREDENTIAL_IN_QUERY | Credentials were supplied in an access_token or api_key query parameter. Send credentials in headers. |
| 400 | IDEMPOTENCY_CONFLICT | The Idempotency-Key header and requestId body field must match. |
| 400 | INVALID_REQUEST_ID | requestId or Idempotency-Key is not a UUID v4. |
| 400 | REFERENCE_IMAGE_INVALID | A reference key or its bytes fail ownership, type, size, dimensions, or decoding checks. |
| 400 | THUMBNAIL_PROMPT_INVALID | The normalized prompt is outside the 10–1200 character range. |
| 400 | VALIDATION_ERROR | An argument is missing, has an unsupported value, exceeds its limit, or is not part of the strict input schema. |
| 401 | API_KEY_EXPIRED | The API key has expired. |
| 401 | INVALID_API_KEY | Provide a valid, unexpired API key. |
| 401 | INVALID_CREDENTIAL | The Authorization header is malformed or conflicts with x-api-key. |
| 401 | MISSING_CREDENTIAL | No usable header credential was supplied, or it exceeded 4096 characters. |
| 401 | USER_NOT_FOUND | The credential’s account no longer exists. |
| 403 | ACCOUNT_UNAVAILABLE | The acting or billing account is unavailable or being deleted. |
| 403 | AMBIGUOUS_TEAM_API_KEY | The credential’s user belongs to more than one team, so the billing context is ambiguous. |
| 403 | INSUFFICIENT_SCOPE | Grant every required permission or choose another credential. |
| 403 | INTEGRATION_PLAN_UNSUPPORTED | The account’s integration limits could not be verified. |
| 403 | SUBSCRIPTION_REQUIRED | Use an active paid subscription. |
| 403 | TEAM_OWNER_NOT_FOUND | The effective team owner account could not be found. |
| 409 | CONCURRENT_ACTION_LIMIT_REACHED | This account already has 10 integration actions running. Poll an existing request before starting another. |
| 409 | IDEMPOTENCY_CONFLICT | The request identifier was already used with different arguments; a header/body identifier mismatch returns HTTP 400 with the same code. |
| 409 | THUMBNAIL_GENERATION_IN_PROGRESS | The thumbnail request is already processing. |
| 409 | THUMBNAIL_REQUEST_FAILED | This thumbnail attempt previously failed. Inspect its state before deciding whether to start a new request. |
| 409 | THUMBNAIL_REQUEST_ID_REUSED | The thumbnail request identifier is already associated with different input. |
| 410 | THUMBNAIL_NOT_FOUND | The previously completed result for this request has expired or is no longer available. |
| 422 | THUMBNAIL_REQUEST_REJECTED | The thumbnail cannot be generated from this prompt or reference. Change the content for a new request. |
| 429 | INTEGRATION_MONTHLY_LIMIT_REACHED | Wait for the monthly reset or change plan. |
| 429 | INTEGRATION_RATE_LIMIT_REACHED | Wait for Retry-After when present and use backoff. |
| 429 | THUMBNAIL_DAILY_LIMIT_REACHED | The account’s daily thumbnail-generation allowance is exhausted. |
| 500 | INTERNAL_ERROR | Check saved request state and resource history before deciding to retry a mutation. |
| 502 | INTERNAL_ERROR | Generation or preparation of the thumbnail failed. Inspect request state before deciding to start another generation. |
| 503 | ACTION_RESULT_UNAVAILABLE | The action ran but its result could not be saved. Inspect saved request state and resource history before starting a new generation. |
| 503 | INTERNAL_ERROR | Thumbnail generation or its stored result is temporarily unavailable. Inspect request state before retrying. |
| 503 | SERVER_RESTARTING | The server is restarting. Retry shortly and keep the same request identifier for a mutation. |
{
"code": "INSUFFICIENT_SCOPE",
"message": "This credential does not permit the requested action.",
"status": 403,
"details": {
"requiredScopes": ["thumbnails:write"]
}
}
Was this page helpful?

