The .prompt parameter

Syntax, accepted values and limits for generating text or image content at render time.

Updated

Overview#

The .prompt parameter enables AI-powered content generation for text and image elements. Instead of providing static content, you can supply a natural language prompt that generates contextual content on-the-fly.

How It Works#

When you add .prompt to a parameterized element, Orshot uses AI to generate appropriate content:

  • Text elements - Get AI-written text
  • Image elements - Get an AI-generated image
  • Video elements - Get an AI-generated clip. See AI video

The generated content replaces the element's default content during render.

Syntax#

JavaScript
parameterID.prompt

For multi-page templates:

JavaScript
pageN@parameterID.prompt

Text Generation#

Basic Usage#

JSON
{
  "modifications": {
    "headline.prompt": "Write a catchy headline about coffee"
  }
}

This generates AI text for the headline element instead of using its template default.

Detailed Prompts#

Be specific to get better results:

JSON
{
  "modifications": {
    "description.prompt": "Write a 2-sentence product description for wireless headphones with noise cancellation, emphasizing comfort and battery life",
    "tagline.prompt": "Create a 5-word motivational tagline about productivity"
  }
}

Multi-Page Example#

JSON
{
  "modifications": {
    "page1@title.prompt": "Write a title about morning routines",
    "page2@title.prompt": "Write a title about evening habits",
    "page1@body.prompt": "Write 3 tips for productive mornings",
    "page2@body.prompt": "Write 3 tips for better sleep"
  }
}

Image Generation#

Basic Usage#

JSON
{
  "modifications": {
    "background.prompt": "A serene mountain landscape at sunset"
  }
}

Detailed Image Prompts#

Include style, mood, and composition details:

JSON
{
  "modifications": {
    "hero.prompt": "Modern office workspace with plants, natural lighting, minimalist design, professional photography style",
    "illustration.prompt": "Flat design illustration of people collaborating, bright colors, vector art style"
  }
}

Multi-Page Image Generation#

JSON
{
  "modifications": {
    "page1@background.prompt": "Sunrise over city skyline, golden hour",
    "page2@background.prompt": "Busy city street at noon, aerial view",
    "page3@background.prompt": "City lights at night, long exposure"
  }
}

Combining with Regular Parameters#

You can mix .prompt with regular parameters to refine the output:

JSON
{
  "modifications": {
    "title.prompt": "Write a headline about innovation",
    "title.fontSize": "48px",
    "title.color": "#0066cc",
    "title.fontFamily": "Montserrat"
  }
}

The AI generates the text content, while the style parameters control its appearance.

Edit Instead of Replace#

Two more keys change how a prompt works on text and image elements.

  • .promptMode - "override" (the default) writes new content. "update" edits the value you send for the same parameter in this request, following your prompt. If you do not send a value, the prompt writes new content.
  • .promptReferences - Image URLs the image model uses as references. Send a comma-separated list or a JSON array. This works on image and video elements.
JSON
{
  "modifications": {
    "headline": "Our spring sale starts Monday",
    "headline.prompt": "Make this shorter and more urgent",
    "headline.promptMode": "update",
    "hero": "https://example.com/product.jpg",
    "hero.prompt": "Place the product on a marble kitchen counter",
    "hero.promptMode": "update",
    "hero.promptReferences": ["https://example.com/kitchen-style.jpg"]
  }
}

Element Type Validation#

The .prompt parameter works on text, image and video elements. .promptMode works on text and image elements only.

Supported:

JSON
{
  "headline.prompt": "Write a headline about coffee",
  "hero.prompt": "A cup of coffee on a wooden table",
  "intro_clip.prompt": "Slow push-in on a coffee cup by a window"
}

Not supported (shape elements are ignored):

JSON
{
  "rectangle.prompt": "Make it blue",
  "circle.prompt": "Make it round"
}

If you try to use .prompt on unsupported elements, Orshot will:

  1. Add a warning to the response
  2. Skip the prompt generation
  3. Use the element's default content

Fallback Behavior#

When AI generation fails (network issues, API errors, etc.), Orshot falls back gracefully:

  1. Regular modification exists - Uses the regular parameter value

    JSON
    {
      "title": "Fallback Title",
      "title.prompt": "Generate a title"
    }

    If AI fails, it uses "Fallback Title"

  2. No regular modification - Uses template default If AI fails and no fallback is provided, the element shows its original template content

The fallback does not cover AI credits. Orshot checks credits for every prompt in the request before it generates anything. If you do not have enough AI credits, or your subscription is paused, the render fails with a 402 error. Top up or upgrade, or remove the .prompt keys.

Best Practices#

Text Prompts#

  1. Be Specific - Include length, tone, and context

    JSON
    {
      "bio.prompt": "Write a 50-word professional bio for a software engineer specializing in AI"
    }
  2. Set Constraints - Specify word/sentence count

    JSON
    {
      "headline.prompt": "Create a 7-word headline about sustainable fashion"
    }
  3. Define Tone - Mention style or emotion

    JSON
    {
      "message.prompt": "Write an encouraging message for students, friendly and motivational tone"
    }

Image Prompts#

  1. Include Style - Specify artistic style or medium

    JSON
    {
      "artwork.prompt": "Abstract watercolor painting of ocean waves, blue and teal colors"
    }
  2. Describe Composition - Mention perspective and layout

    JSON
    {
      "photo.prompt": "Top-down view of healthy breakfast bowl, natural lighting, food photography"
    }
  3. Add Context - Include mood and atmosphere

    JSON
    {
      "scene.prompt": "Cozy coffee shop interior, warm lighting, people working on laptops, relaxed atmosphere"
    }

Real-World Examples#

Social Media Post Generator#

JSON
{
  "modifications": {
    "post_text.prompt": "Write an engaging Instagram caption about travel adventure, include 2 relevant hashtags",
    "background.prompt": "Tropical beach sunset, vibrant colors, palm trees silhouette",
    "username": "@traveler",
    "username.fontSize": "18px"
  }
}

Dynamic Report Headers#

JSON
{
  "modifications": {
    "page1@title.prompt": "Create a professional title for a Q4 2024 sales report",
    "page1@summary.prompt": "Write a 2-sentence executive summary highlighting 25% growth",
    "company_name": "Acme Corp",
    "report_date": "Q4 2024"
  }
}

Personalized Certificates#

JSON
{
  "modifications": {
    "achievement.prompt": "Write a formal achievement description for completing a Python programming course",
    "recipient_name": "John Doe",
    "date": "December 20, 2024",
    "recipient_name.fontSize": "36px"
  }
}

API Integration Examples#

REST API#

Shell
curl -X POST https://api.orshot.com/v1/studio/render \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "templateId": "your-template-id",
    "modifications": {
      "headline.prompt": "Write a tech startup tagline",
      "hero.prompt": "Modern tech office with engineers collaborating",
      "headline.fontSize": "48px"
    },
    "response": {
      "format": "png",
      "type": "url"
    }
  }'

Dynamic URL#

https://api.orshot.com/v1/studio/dynamic-url/motivational-quote.png?templateId=YOUR_TEMPLATE_ID&title.prompt=Create%20a%20motivational%20quote%20about%20success&background.prompt=Inspirational%20mountain%20peak%20at%20sunrise&title.fontSize=42px&title.color=%23ffffff&sign=YOUR_SIGNATURE

Copy the signed URL from your template's Dynamic URL tab, then add your parameters. See Dynamic URLs.

Limitations & Considerations#

  1. AI Credits Required - Each text prompt uses 1 AI credit and each image prompt uses 2. AI video is billed per second. Failed generations cost nothing. See Credits
  2. Generation Time - Each AI prompt adds processing time to the render
  3. Prompt Length - Text prompts are limited to 2,000 characters. Longer prompts are cut
  4. Content Safety - The AI provider may refuse some prompts. When that happens, the element falls back to its regular value or template default
  5. Determinism - Same prompt may generate slightly different results each time

Next Steps#

Was this page helpful?

Ready to automate?

Start rendering images, PDFs and videos from your templates in under 2 minutes. Free plan, no credit card.

Get your API key
  • Image, PDF and video generation via API
  • Visual editor with AI and smart layouts
  • Zapier, Make, MCP and 60+ integrations
  • White-label embed for your own app
  • 100 free credits a month, no credit card required