Skip to content
Book a callStart free
Reference

list_templates

List the templates run_template can run

View as Markdown

GET /api/v2/templates

Each template says what inputs it needs (name, type, required) and a rough price. Pass dry_run: true to run_template for the exact price. Needs the generate scope.

Example

curl "https://app.diffusr.ai/api/v2/templates" \
-H "Authorization: Bearer $DIFFUSR_KEY"

Response

200 ApiTemplateList

Templates run_template can run, with the inputs each needs.

NameTypeRequiredDescription
templatesobject[]yes
templates[].idstringyesPass this as template to run_template.
templates[].namestringyes
templates[].kind“product_ad” | “video_template” | “talking_head” | “podcast”yes
templates[].aboutstringyes
templates[].inputsobject[]yes
templates[].inputs[].namestringyesThe run_template field this fills (a dotted name like pictures.<slot> is a key inside that field).
templates[].inputs[].typestringyesWhat it takes, e.g. “text”, “image_url”, “video_url”, “image_urls”.
templates[].inputs[].requiredbooleanyes
templates[].inputs[].aboutstringyes
templates[].price_hintobjectnoA rough price. The exact one comes from run_template with dry_run: true.
templates[].price_hint.creditsnumberyes
templates[].price_hint.approximatetrueyes

Errors

Every error body is { error, code, request_id, ... }. All codes and what to do.

  • 401: Missing, wrong, revoked or expired API key (code UNAUTHORIZED, KEY_REVOKED, KEY_EXPIRED).
  • 403: The key may not do this (SCOPE_DENIED, MODEL_NOT_ALLOWED, TEST_MODE_UNSUPPORTED, ACCOUNT_BLOCKED, allowance_exceeded).
  • 429: Too many requests or jobs (RATE_LIMITED, CONCURRENCY_LIMIT, UPLOAD_QUOTA, …). Wait Retry-After seconds, then retry.
  • 500: Our fault (INTERNAL_ERROR). Quote request_id to support.
  • 503: Paused or busy (API_PAUSED, MODEL_PAUSED, PROVIDER_PAUSED, PROVIDER_BUSY, UNAVAILABLE). Wait Retry-After seconds, then retry.

Charges

Free. No credits are spent.