Generations
List generations and check generation status.
List Generations
GET /api/v1/content/generations
List your caption generations with optional filtering.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
status | string | No | Filter by status: pending, processing, completed, failed |
limit | number | No | Results per page (1-100, default: 20) |
cursor | string | No | Cursor for pagination (from next_cursor) |
Example
curl "https://powerpost.ai/api/v1/content/generations?status=completed&limit=10" \
-H "x-api-key: pp_live_sk_YOUR_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_ID"const res = await fetch(
'https://powerpost.ai/api/v1/content/generations?status=completed&limit=10',
{ headers: { 'x-api-key': 'pp_live_sk_YOUR_KEY', 'X-Workspace-Id': 'YOUR_WORKSPACE_ID' } }
)
const data = await res.json()import requests
res = requests.get(
"https://powerpost.ai/api/v1/content/generations",
params={"status": "completed", "limit": 10},
headers={"x-api-key": "pp_live_sk_YOUR_KEY", "X-Workspace-Id": "YOUR_WORKSPACE_ID"},
)
data = res.json()Response
{
"data": [
{
"generation_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"prompt": "We just shipped dark mode",
"platforms": ["tiktok", "instagram"],
"research_mode": "regular",
"credits_used": 10,
"created_at": "2026-01-10T18:30:00Z"
},
{
"generation_id": "661f9511-f3ac-52e5-b827-557766551111",
"status": "completed",
"prompt": "New feature: AI-powered search",
"platforms": ["x", "facebook"],
"research_mode": "deep",
"credits_used": 15,
"created_at": "2026-01-09T12:00:00Z"
}
],
"next_cursor": "gen_cursor_abc123",
"has_more": true
}The list endpoint does not include outputs. Use the Get Generation endpoint below to retrieve
full outputs for a specific generation.
Get Generation
GET /api/v1/content/generations/{id}
Retrieve the status and outputs of a generation.
Request
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The generation ID |
Headers
| Header | Value |
|---|---|
x-api-key | Your API key |
X-Workspace-Id | Your workspace ID |
Example Request
curl https://powerpost.ai/api/v1/content/generations/550e8400-e29b-41d4-a716-446655440000 \
-H "x-api-key: pp_live_sk_YOUR_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_ID"const res = await fetch(
'https://powerpost.ai/api/v1/content/generations/550e8400-e29b-41d4-a716-446655440000',
{ headers: { 'x-api-key': 'pp_live_sk_YOUR_KEY', 'X-Workspace-Id': 'YOUR_WORKSPACE_ID' } }
)
const data = await res.json()import requests
res = requests.get(
"https://powerpost.ai/api/v1/content/generations/550e8400-e29b-41d4-a716-446655440000",
headers={"x-api-key": "pp_live_sk_YOUR_KEY", "X-Workspace-Id": "YOUR_WORKSPACE_ID"},
)
data = res.json()Response (Processing)
{
"generation_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"prompt": "We just shipped dark mode",
"platforms": ["tiktok", "instagram"],
"research_mode": "regular",
"credits_used": 10,
"created_at": "2026-01-10T18:30:00Z"
}Response (Completed)
{
"generation_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"prompt": "We just shipped dark mode",
"platforms": ["tiktok", "instagram"],
"research_mode": "regular",
"credits_used": 10,
"created_at": "2026-01-10T18:30:00Z",
"outputs": {
"tiktok": "🌙 Dark mode activated! POV: your eyes at 2am finally getting some relief... #darkmode #tech #appupdate",
"instagram": "✨ Dark mode is here!\n\nYour late-night scrolling just got easier on the eyes... #DarkMode #ProductUpdate"
}
}YouTube outputs have a different structure with separate title and description fields:
"youtube": {
"title": "We Just Shipped Dark Mode",
"description": "Dark mode is finally here across all our apps... #darkmode"
}All other platforms output a single string with hashtags included.
Response (Failed)
{
"generation_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "failed",
"prompt": "We just shipped dark mode",
"platforms": ["tiktok", "instagram"],
"research_mode": "regular",
"credits_used": 0,
"created_at": "2026-01-10T18:30:00Z",
"error": {
"code": "GENERATION_FAILED",
"message": "Failed to generate content. Please try again."
}
}Response Fields
| Field | Type | Description |
|---|---|---|
generation_id | string | Unique generation ID |
status | string | Current status (see below) |
prompt | string | The original input prompt |
platforms | array | Platforms content was generated for |
research_mode | string | Research mode used |
credits_used | number | Credits charged for this generation |
created_at | string | ISO 8601 timestamp |
outputs | object | Platform content (only when completed) |
error | object | Error details (only when failed) |
Status Values
| Status | Description |
|---|---|
pending | Queued, not yet started |
processing | Generation is running |
completed | Outputs are ready |
failed | Generation failed |
Polling Strategy
We recommend polling every 2-3 seconds until status is completed or failed:
async function waitForGeneration(generationId, apiKey, workspaceId, maxAttempts = 60) {
for (let i = 0; i < maxAttempts; i++) {
const res = await fetch(`https://powerpost.ai/api/v1/content/generations/${generationId}`, {
headers: { 'x-api-key': apiKey, 'X-Workspace-Id': workspaceId },
})
const data = await res.json()
if (data.status === 'completed') return data.outputs
if (data.status === 'failed') throw new Error(data.error.message)
await new Promise((r) => setTimeout(r, 2000))
}
throw new Error('Generation timed out')
}For production, consider using webhooks instead of polling.