ThumbAPI logoThumbAPI

POST /v1/generate

Generate a thumbnail from a title. This is the only endpoint you need.

POST https://api.thumbapi.dev/v1/generate

Headers

HeaderRequiredValue
x-api-keyYesYOUR_API_KEY
Content-TypeYesapplication/json

Request Body

FieldTypeRequiredDescription
titlestringYesThe title to generate a thumbnail for (max 200 characters)
formatstringYes*youtube | instagram | x | blogpost | linkedin. *Optional when customAssetsId is provided — the format is taken from the saved reference set.
categorystringNoContent niche — biases reference search and final tone. See Categories below. Default: auto.
usePhotobooleanNoInclude a personal photo as the main subject (uses your saved photo unless photoImage is provided). Default: false.
useLogobooleanNoOverlay a brand logo in the corner (uses your saved logo + saved position unless logoImage is provided). Default: false. Can be combined with usePhoto.
photoImagestringNoInline base64 photo (data-URL). Max 2MB. Overrides the saved photo for this request.
logoImagestringNoInline base64 logo (data-URL). Max 1MB. Overrides the saved logo for this request.
customAssetsIdstringNoID 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.
modelstringNoQuality: sd (default, 1K render) | hd (2K render, Pro+ only). See Credit cost below.
outputFormatstringNowebp (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 fieldMaps to
imageStyle: "faceless"usePhoto: false, useLogo: false
imageStyle: "with-image" or "with-photo"usePhoto: true
imageStyle: "with-logo"useLogo: true
personImagephotoImage (when style is with-image/with-photo) or logoImage (when style is with-logo)
usePersonalPhoto: trueusePhoto: 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

FormatWidthHeightAspect
youtube128072016:9
blogpost12006301.91:1
linkedin12006271.91:1
x120067516:9
instagram102410241: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 inline photoImage if 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 pass logoImage inline.
  • 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:

OperationCredits
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:

PlanCredits / month
Free50
Creator750
Pro2,500
Business10,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

FieldTypeDescription
imagestringBase64-encoded WebP or PNG image with data URI prefix
formatstringThe format that was used (echoed back, useful when customAssetsId set it)
outputFormatstringwebp or png

Error Responses

StatusCause
400Missing or invalid title, format, or category; asset toggle on without a saved asset; image exceeds size cap
401Missing or invalid API key
403Plan does not include the feature (saved photos/logos and custom reference sets require Pro or Business; webhooks require Business)
404customAssetsId does not exist
429Rate limit or generation limit exceeded
500Server error during generation

See Error Codes for full details.

Common Mistakes

  1. Asset toggle without a saved assetusePhoto: true / useLogo: true requires either the saved asset or an inline photoImage / logoImage. Otherwise the API returns 400.
  2. Invalid format value — must be exactly youtube, instagram, x, blogpost, or linkedin. No aliases.
  3. Empty title — the title field must be a non-empty string (max 200 characters).
  4. Logo too largelogoImage cap is 1 MB (smaller than the 2 MB photo cap, since logos compress well).
  5. Sending format with customAssetsId — harmless but ignored. The reference set's stored format wins.

Next Steps