POST /v1/generate
Generate a thumbnail from a title. This is the only endpoint you need.
POST https://api.thumbapi.dev/v1/generate
Headers
| Header | Required | Value |
|---|---|---|
x-api-key | Yes | YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | The title to generate a thumbnail for (max 200 characters) |
format | string | Yes* | youtube | instagram | x | blogpost | linkedin. *Optional when customAssetsId is provided — the format is taken from the saved reference set. |
category | string | No | Content niche — biases reference search and final tone. See Categories below. Default: auto. |
usePhoto | boolean | No | Include a personal photo as the main subject (uses your saved photo unless photoImage is provided). Default: false. |
useLogo | boolean | No | Overlay a brand logo in the corner (uses your saved logo + saved position unless logoImage is provided). Default: false. Can be combined with usePhoto. |
photoImage | string | No | Inline base64 photo (data-URL). Max 2MB. Overrides the saved photo for this request. |
logoImage | string | No | Inline base64 logo (data-URL). Max 1MB. Overrides the saved logo for this request. |
customAssetsId | string | No | ID of a saved reference set to use as the style source. The set's format is auto-applied; the AI mirrors the references at 80–100% fidelity. |
model | string | No | Quality: sd (default, 1K render) | hd (2K render, Pro+ only). See Credit cost below. |
outputFormat | string | No | webp (default) | png |
Legacy parameters (still accepted)
The following older parameter names continue to work — older SDKs and the WordPress plugin can keep sending them without changes:
| Legacy field | Maps to |
|---|---|
imageStyle: "faceless" | usePhoto: false, useLogo: false |
imageStyle: "with-image" or "with-photo" | usePhoto: true |
imageStyle: "with-logo" | useLogo: true |
personImage | photoImage (when style is with-image/with-photo) or logoImage (when style is with-logo) |
usePersonalPhoto: true | usePhoto: true using the saved asset |
You cannot combine photo + logo through the legacy imageStyle enum — use the new usePhoto / useLogo flags for that case.
Format Dimensions
| Format | Width | Height | Aspect |
|---|---|---|---|
youtube | 1280 | 720 | 16:9 |
blogpost | 1200 | 630 | 1.91:1 |
linkedin | 1200 | 627 | 1.91:1 |
x | 1200 | 675 | 16:9 |
instagram | 1024 | 1024 | 1:1 |
Categories
Bias the generation toward a specific niche. The category influences both the reference grid search query and a soft final-tone hint appended to the prompt — it never overrides the references.
auto (default), tech-saas, business-finance, education-tutorial, fitness-wellness, medical-healthcare, lifestyle-vlog, food-cooking, travel, gaming, entertainment-comedy, news-commentary, creative-design.
Photo & Logo (independent flags)
usePhoto and useLogo are independent — you can use either, both, or neither.
usePhoto: true— the API uses your saved Personal Photo, or the inlinephotoImageif you provide one. The photo is fed to the model so it integrates the face into the generated scene.useLogo: true— the API overlays your saved Logo onto the final image programmatically (sharp composite, never sent to the model). Position, size, and drop shadow come from your saved Logo config. To override, save a different config in the dashboard or passlogoImageinline.- Both
true— face in the scene + logo overlay in the corner.
If you set usePhoto: true (or useLogo: true) without inline data and have no saved asset, the API returns 400.
Custom Reference Sets
customAssetsId points to a 1–6 image set you uploaded as your own style template. When provided, the AI clones your set's style at 80–100% fidelity instead of auto-discovering YouTube references. The set's stored format wins — you don't need to send format separately (and it's ignored if you do).
Credit cost
Each generation deducts credits from your monthly plan quota. The cost depends on the model and which add-ons you enable:
| Operation | Credits |
|---|---|
Base generation — model: "sd" (1K, default) | 10 |
Base generation — model: "hd" (2K, Pro+ only) | 20 |
usePhoto: true add-on | +2 |
useLogo: true add-on | +2 |
customAssetsId add-on | +2 |
Examples:
- Faceless 1K thumbnail → 10 credits
- 1K thumbnail with photo → 12 credits
- 2K thumbnail with photo + logo → 24 credits (20 + 2 + 2)
- 2K thumbnail with photo + logo + reference set → 26 credits
Your plan's monthly credit allowance:
| Plan | Credits / month |
|---|---|
| Free | 50 |
| Creator | 750 |
| Pro | 2,500 |
| Business | 10,000 |
Defaults: model: "sd" (1K), category: "auto". The 2K quality (model: "hd") is gated to Pro and Business plans — sending it on Free/Creator returns 403 UPGRADE_REQUIRED.
Example Requests
Faceless (default)
curl -X POST https://api.thumbapi.dev/v1/generate \
-H "x-api-key: tb_live_abc123" \
-H "Content-Type: application/json" \
-d '{
"title": "10 Tips to Grow Your YouTube Channel",
"format": "youtube",
"category": "education-tutorial"
}'
With saved photo
curl -X POST https://api.thumbapi.dev/v1/generate \
-H "x-api-key: tb_live_abc123" \
-H "Content-Type: application/json" \
-d '{
"title": "How I Built a $1M SaaS",
"format": "youtube",
"category": "business-finance",
"usePhoto": true
}'
Photo + logo (both)
curl -X POST https://api.thumbapi.dev/v1/generate \
-H "x-api-key: tb_live_abc123" \
-H "Content-Type: application/json" \
-d '{
"title": "My 2026 Annual Review",
"format": "youtube",
"usePhoto": true,
"useLogo": true
}'
Logo only, inline
curl -X POST https://api.thumbapi.dev/v1/generate \
-H "x-api-key: tb_live_abc123" \
-H "Content-Type: application/json" \
-d '{
"title": "New Product Launch",
"format": "instagram",
"useLogo": true,
"logoImage": "data:image/png;base64,iVBORw0KGgo..."
}'
Custom reference set
curl -X POST https://api.thumbapi.dev/v1/generate \
-H "x-api-key: tb_live_abc123" \
-H "Content-Type: application/json" \
-d '{
"title": "Episode 47: The Future of AI",
"customAssetsId": "ref_brand_v2"
}'
2K render (Pro+)
curl -X POST https://api.thumbapi.dev/v1/generate \
-H "x-api-key: tb_live_abc123" \
-H "Content-Type: application/json" \
-d '{
"title": "Annual Report 2026",
"format": "linkedin",
"category": "business-finance",
"model": "hd"
}'
Response
{
"image": "data:image/webp;base64,UklGRp4HAA...",
"format": "youtube",
"outputFormat": "webp"
}
Response Fields
| Field | Type | Description |
|---|---|---|
image | string | Base64-encoded WebP or PNG image with data URI prefix |
format | string | The format that was used (echoed back, useful when customAssetsId set it) |
outputFormat | string | webp or png |
Error Responses
| Status | Cause |
|---|---|
400 | Missing or invalid title, format, or category; asset toggle on without a saved asset; image exceeds size cap |
401 | Missing or invalid API key |
403 | Plan does not include the feature (saved photos/logos and custom reference sets require Pro or Business; webhooks require Business) |
404 | customAssetsId does not exist |
429 | Rate limit or generation limit exceeded |
500 | Server error during generation |
See Error Codes for full details.
Common Mistakes
- Asset toggle without a saved asset —
usePhoto: true/useLogo: truerequires either the saved asset or an inlinephotoImage/logoImage. Otherwise the API returns400. - Invalid format value — must be exactly
youtube,instagram,x,blogpost, orlinkedin. No aliases. - Empty title — the
titlefield must be a non-empty string (max 200 characters). - Logo too large —
logoImagecap is 1 MB (smaller than the 2 MB photo cap, since logos compress well). - Sending
formatwithcustomAssetsId— harmless but ignored. The reference set's stored format wins.
Next Steps
- Custom assets guide — in-depth guide to photos, logos, and reference sets
- Code examples — copy-paste snippets in 3 languages
- Rate limits — understand your quota
- Webhooks — async generation for high-volume use