Generate Content
Start a new content generation job from text, images, or video.
POST /api/v1/content/generate
Generate platform-optimized social media content from text, images, or video input.
Input Types
PowerPost supports three input types. The input type is determined automatically based on the fields you provide:
| Input Type | How to Use |
|---|---|
| Text | Send prompt only |
| Images | Send media_ids with image IDs (+ optional prompt) |
| Video | Send media_ids with a video ID (+ optional prompt) |
You must provide either prompt or media_ids (or both).
Text Input
Generate content from a text prompt.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | What you want to post about (3-500 characters) |
post_types | string[] | Yes | Target post types (at least one) |
research_mode | string | Yes | regular or deep |
writing_style_id | string | No | Custom writing style ID (see dashboard) |
cta_text | string | No | Custom call-to-action (max 100 characters) |
Example
curl -X POST https://powerpost.ai/api/v1/content/generate \
-H "x-api-key: pp_live_sk_YOUR_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"prompt": "We just shipped dark mode across all our apps",
"post_types": ["instagram-reel", "tiktok-video", "x-post"],
"research_mode": "regular"
}'const res = await fetch('https://powerpost.ai/api/v1/content/generate', {
method: 'POST',
headers: {
'x-api-key': 'pp_live_sk_YOUR_KEY',
'X-Workspace-Id': 'YOUR_WORKSPACE_ID',
'Content-Type': 'application/json',
},
body: JSON.stringify({
prompt: 'We just shipped dark mode across all our apps',
post_types: ['instagram-reel', 'tiktok-video', 'x-post'],
research_mode: 'regular',
}),
})
const data = await res.json()import requests
res = requests.post(
"https://powerpost.ai/api/v1/content/generate",
headers={
"x-api-key": "pp_live_sk_YOUR_KEY",
"X-Workspace-Id": "YOUR_WORKSPACE_ID",
"Content-Type": "application/json",
},
json={
"prompt": "We just shipped dark mode across all our apps",
"post_types": ["instagram-reel", "tiktok-video", "x-post"],
"research_mode": "regular",
},
)
data = res.json()Image Input
Generate content from uploaded images. PowerPost analyzes the images and creates captions. Optionally provide a prompt for additional context.
Supported formats: JPEG, PNG, WebP
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
media_ids | string[] | Yes | Array of uploaded image media IDs (up to 10) |
prompt | string | No | Additional context to guide the generated content |
post_types | string[] | Yes | Target post types (at least one) |
research_mode | string | Yes | regular or deep |
writing_style_id | string | No | Custom writing style ID (see dashboard) |
cta_text | string | No | Custom call-to-action (max 100 characters) |
Example
curl -X POST https://powerpost.ai/api/v1/content/generate \
-H "x-api-key: pp_live_sk_YOUR_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"media_ids": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"],
"prompt": "Behind the scenes at our product launch",
"post_types": ["instagram-feed", "facebook-post"],
"research_mode": "regular"
}'const res = await fetch('https://powerpost.ai/api/v1/content/generate', {
method: 'POST',
headers: {
'x-api-key': 'pp_live_sk_YOUR_KEY',
'X-Workspace-Id': 'YOUR_WORKSPACE_ID',
'Content-Type': 'application/json',
},
body: JSON.stringify({
media_ids: ['a1b2c3d4-e5f6-7890-abcd-ef1234567890'],
prompt: 'Behind the scenes at our product launch',
post_types: ['instagram-feed', 'facebook-post'],
research_mode: 'regular',
}),
})
const data = await res.json()import requests
res = requests.post(
"https://powerpost.ai/api/v1/content/generate",
headers={
"x-api-key": "pp_live_sk_YOUR_KEY",
"X-Workspace-Id": "YOUR_WORKSPACE_ID",
"Content-Type": "application/json",
},
json={
"media_ids": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"],
"prompt": "Behind the scenes at our product launch",
"post_types": ["instagram-feed", "facebook-post"],
"research_mode": "regular",
},
)
data = res.json()Upload images first using the Upload Media endpoint to get
media_ids.
Video Input
Generate content from an uploaded video. PowerPost analyzes the video using AI video understanding, then generates captions based on the content.
Supported formats: MP4, MOV
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
media_ids | string[] | Yes | Array with the uploaded video media ID |
prompt | string | No | Additional context to focus the generated content |
post_types | string[] | Yes | Target post types (at least one) |
research_mode | string | Yes | regular or deep |
writing_style_id | string | No | Custom writing style ID (see dashboard) |
cta_text | string | No | Custom call-to-action (max 100 characters) |
Example
curl -X POST https://powerpost.ai/api/v1/content/generate \
-H "x-api-key: pp_live_sk_YOUR_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"media_ids": ["f9g0h1i2-j3k4-5678-lmno-pq9876543210"],
"prompt": "Focus on the key insights about productivity",
"post_types": ["tiktok-video", "youtube-short"],
"research_mode": "deep"
}'const res = await fetch('https://powerpost.ai/api/v1/content/generate', {
method: 'POST',
headers: {
'x-api-key': 'pp_live_sk_YOUR_KEY',
'X-Workspace-Id': 'YOUR_WORKSPACE_ID',
'Content-Type': 'application/json',
},
body: JSON.stringify({
media_ids: ['f9g0h1i2-j3k4-5678-lmno-pq9876543210'],
prompt: 'Focus on the key insights about productivity',
post_types: ['tiktok-video', 'youtube-short'],
research_mode: 'deep',
}),
})
const data = await res.json()import requests
res = requests.post(
"https://powerpost.ai/api/v1/content/generate",
headers={
"x-api-key": "pp_live_sk_YOUR_KEY",
"X-Workspace-Id": "YOUR_WORKSPACE_ID",
"Content-Type": "application/json",
},
json={
"media_ids": ["f9g0h1i2-j3k4-5678-lmno-pq9876543210"],
"prompt": "Focus on the key insights about productivity",
"post_types": ["tiktok-video", "youtube-short"],
"research_mode": "deep",
},
)
data = res.json()Upload videos first using the Upload Media endpoint to get
media_ids. Video input requires additional credits for video analysis (6 credits per minute of
video, rounded up).
Common Parameters
Headers
| Header | Value |
|---|---|
x-api-key | Your API key |
X-Workspace-Id | Your workspace ID |
Content-Type | application/json |
Post Types
Specify which post types to generate for. The platform is derived automatically from each post type.
| Platform | Post Types |
|---|---|
instagram-feed, instagram-reel, instagram-story | |
| TikTok | tiktok-video, tiktok-photos |
| YouTube | youtube-video, youtube-short |
| X | x-post |
facebook-post, facebook-reel, facebook-story | |
linkedin-post |
Multiple post types from the same platform (e.g., instagram-reel and instagram-feed) produce
one shared caption for that platform. The post type declares your publishing intent.
Research Modes
| Mode | Description |
|---|---|
regular | Quick generation with basic research |
deep | Extended research for higher engagement |
Writing Styles
Create custom writing styles in Settings → Writing Styles. A writing style captures your brand voice so generated content sounds like you.
Pass the writing_style_id to apply a style:
{
"prompt": "We just shipped dark mode",
"post_types": ["instagram-reel"],
"research_mode": "regular",
"writing_style_id": "ws_abc123"
}If omitted, the generation uses your active writing style (if you have one set), or defaults to no style.
Response
{
"generation_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"credits_used": 10,
"remaining_credits": 90,
"status_url": "/api/v1/content/generations/550e8400-e29b-41d4-a716-446655440000"
}| Field | Type | Description |
|---|---|---|
generation_id | string | Unique ID to track this generation |
status | string | Initial status (always processing) |
credits_used | number | Credits deducted for this generation |
remaining_credits | number | Your credit balance after deduction |
status_url | string | Relative URL to poll for results |
Use the Get Generation endpoint to poll for results.
Credit Costs
Credit costs depend on:
- Research mode — Deep research costs more than regular
- Platform count — More unique platforms require more credits
- Input type — Image and video require extra credits for processing
- Video duration — Longer videos cost more
See the Credits endpoint to check your current balance.
Errors
| Code | Description |
|---|---|
| 400 | Invalid request body |
| 401 | Invalid API key |
| 402 | Insufficient credits |
| 429 | Rate limit exceeded |
What's Next?
Once you have captions:
- Generate Images — Create visuals for your content
- Create & Publish Posts — Publish to social platforms
- Get Generation — Poll for results