AI Generation with .prompt
Generate dynamic text and images using AI with the .prompt parameter
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 - Generates text using
openai/gpt-5-nano - Image elements - Generates images using
google/nano-banana
The generated content replaces the element's default content during render.
Syntax
parameterID.promptFor multi-page templates:
pageN@parameterID.promptText Generation
Basic Usage
{
"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:
{
"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
{
"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
{
"modifications": {
"background.prompt": "A serene mountain landscape at sunset"
}
}Detailed Image Prompts
Include style, mood, and composition details:
{
"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
{
"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:
{
"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.
Element Type Validation
The .prompt parameter only works with text and image elements:
✅ Supported:
{
"textElement.prompt": "...", // ✓ Text element
"imageElement.prompt": "..." // ✓ Image element
}❌ Not Supported:
{
"rectangle.prompt": "...", // ✗ Shape element - ignored
"circle.prompt": "..." // ✗ Shape element - ignored
}If you try to use .prompt on unsupported elements, Orshot will:
- Log a warning
- Skip the prompt generation
- Use the element's default content
Fallback Behavior
When AI generation fails (network issues, API errors, etc.), Orshot falls back gracefully:
-
Regular modification exists - Uses the regular parameter value
{ "title": "Fallback Title", "title.prompt": "Generate a title" }If AI fails, it uses "Fallback Title"
-
No regular modification - Uses template default If AI fails and no fallback is provided, the element shows its original template content
Best Practices
Text Prompts
-
Be Specific - Include length, tone, and context
{ "bio.prompt": "Write a 50-word professional bio for a software engineer specializing in AI" } -
Set Constraints - Specify word/sentence count
{ "headline.prompt": "Create a 7-word headline about sustainable fashion" } -
Define Tone - Mention style or emotion
{ "message.prompt": "Write an encouraging message for students, friendly and motivational tone" }
Image Prompts
-
Include Style - Specify artistic style or medium
{ "artwork.prompt": "Abstract watercolor painting of ocean waves, blue and teal colors" } -
Describe Composition - Mention perspective and layout
{ "photo.prompt": "Top-down view of healthy breakfast bowl, natural lighting, food photography" } -
Add Context - Include mood and atmosphere
{ "scene.prompt": "Cozy coffee shop interior, warm lighting, people working on laptops, relaxed atmosphere" }
Real-World Examples
Social Media Post Generator
{
"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
{
"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
{
"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
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?
title.prompt=Create%20a%20motivational%20quote%20about%20success&
background.prompt=Inspirational%20mountain%20peak%20at%20sunrise&
title.fontSize=42px&
title.color=%23ffffffLimitations & Considerations
- AI Credits Required - Text and image generation consumes AI credits based on your plan
- Generation Time - AI prompts add processing time (typically 2-5 seconds per element)
- Rate Limits - Subject to plan-based rate limits for AI generation
- Content Safety - Generated content passes through safety filters
- Determinism - Same prompt may generate slightly different results each time
Next Steps
- Learn about Adding Interactive Links
- Explore Dynamic Parameters Introduction
- Check Pricing & Plans for AI credit limits