Generations
Generate content
Generate AI content using a template. Uses credits. Supports both standard and streaming responses via the stream parameter.
POST
/
generations
curl -X POST https://app.mavera.io/api/v1/generations \
-H "Authorization: Bearer mvra_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"app_id": "blog-post-generator",
"input_data": {
"topic": "AI in Marketing",
"tone": "professional",
"length": "medium"
},
"brand_voice_id": "optional-brand-voice-id"
}'{
"id": "<string>",
"object": "generation",
"title": "<string>",
"app": {
"id": "<string>",
"name": "<string>",
"category": "<string>"
},
"brand_voice": {
"id": "<string>",
"label": "<string>"
},
"input_data": {},
"output": "<string>",
"content": "<string>",
"content_type": "markdown",
"workspace_id": "<string>",
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"credits_used": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}Authorizations
API key prefixed with mvra_live_. Create keys at Settings > Developer > API Keys.
Body
application/json
ID of the generation app to use
Input values matching the app's input_fields. Keys should match field names.
Optional brand voice ID to apply styling
Optional persona ID for audience targeting
Target workspace (uses default if not specified)
Custom title (auto-generated if not provided)
If true, returns a streaming response using Server-Sent Events (SSE)
Response
Content generated successfully
Available options:
generation Reference to a generation app
Show child attributes
Show child attributes
Reference to a brand voice
Show child attributes
Show child attributes
The generated content (same as output)
Available options:
markdown, html Show child attributes
Show child attributes
⌘I
curl -X POST https://app.mavera.io/api/v1/generations \
-H "Authorization: Bearer mvra_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"app_id": "blog-post-generator",
"input_data": {
"topic": "AI in Marketing",
"tone": "professional",
"length": "medium"
},
"brand_voice_id": "optional-brand-voice-id"
}'{
"id": "<string>",
"object": "generation",
"title": "<string>",
"app": {
"id": "<string>",
"name": "<string>",
"category": "<string>"
},
"brand_voice": {
"id": "<string>",
"label": "<string>"
},
"input_data": {},
"output": "<string>",
"content": "<string>",
"content_type": "markdown",
"workspace_id": "<string>",
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"credits_used": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}