Overview
The Generated Content API provides access to content generated through Junis AI agents using Replicate models. This includes images, videos, audio files, and 3D models (GLB format).Content Generation: Content is generated through AI agents that use the
replicate_generate tool. This API provides read-only access to view and retry generated content.Authentication
All endpoints require API key authentication with specific scopes:| Endpoint | Required Scope |
|---|---|
GET /content | content:read |
GET /content/{id} | content:read |
POST /content/{id}/retry | content:retry |
X-API-Key header:
Content Types
Generated content is categorized into the following types:| Type | Description | Example Models |
|---|---|---|
image | Static images (PNG, JPG, WebP) | SDXL, Flux, Stable Diffusion |
video | Video files (MP4, WebM) | Runway Gen-3, AnimateDiff |
audio | Audio files (MP3, WAV) | MusicGen, Bark |
glb | 3D models (GLB format) | Point-E, Shap-E |
other | Other content types | Various |
Content Status
Content goes through the following status lifecycle:| Status | Description |
|---|---|
pending | Generation request received, waiting to be processed |
processing | Content is being generated by Replicate |
completed | Generation successful, content available |
failed | Generation failed (can be retried) |
List Content
Retrieve a paginated list of generated content for your organization.Endpoint
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number (default: 1, min: 1) |
page_size | integer | No | Items per page (default: 20, max: 100) |
content_type | string | No | Filter by type: image, video, audio, glb, other |
status | string | No | Filter by status: pending, processing, completed, failed |
Request Example
cURL
Python
Response
Status Code:200 OK
Response Fields
| Field | Type | Description |
|---|---|---|
items | array | List of content items |
total | integer | Total number of items matching the filter |
page | integer | Current page number |
page_size | integer | Number of items per page |
has_more | boolean | Whether more pages are available |
Content Item Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique content ID (UUID) |
content_type | string | Type of content (image, video, audio, glb, other). null until generation completes. |
status | string | Current status |
prompt | string | Generation prompt (may be truncated in list view) |
replicate_version | string | Replicate model version used |
output_url | string | Direct URL to generated content (Replicate CDN) |
storage_url | string | Permanent URL (Kakao Cloud storage) |
error_message | string | Error description if failed |
processing_time_ms | integer | Generation time in milliseconds |
credit_cost | number | Credit cost for this generation (6 decimal places) |
created_at | string | Creation timestamp (ISO 8601) |
completed_at | string | Completion timestamp (ISO 8601) |
Get Content Detail
Retrieve detailed information about a specific content item.Endpoint
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
content_id | string | Yes | Content ID (UUID format) |
Request Example
cURL
Response
Status Code:200 OK
Additional Detail Fields
| Field | Type | Description |
|---|---|---|
organization_id | string | Organization that owns this content |
user_id | string | User who initiated the generation |
replicate_prediction_id | string | Replicate’s internal prediction ID |
replicate_input | object | Full input parameters sent to Replicate |
storage_path | string | Path in cloud storage bucket |
retry_count | integer | Number of retry attempts made |
max_retries | integer | Maximum allowed retries (default: 3) |
started_at | string | Processing start timestamp |
Retry Failed Content
Retry a failed content generation. This re-queues the generation with the original parameters.Endpoint
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
content_id | string | Yes | Content ID of failed generation (UUID format) |
Prerequisites
- Content must have status
failed retry_countmust be less thanmax_retries(default: 3)
Request Example
cURL
Python
Response
Status Code:200 OK
Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Whether retry was queued successfully |
message | string | Human-readable status message |
generation_id | string | Content ID being retried |
Error Responses
Common Errors
400 Bad Request - Invalid Filter
400 Bad Request - Cannot Retry
400 Bad Request - Max Retries Reached
403 Forbidden - Insufficient Scopes
404 Not Found
Best Practices
Polling for Content Completion
Polling for Content Completion
When content is in
pending or processing status, poll the detail endpoint to check for completion:Filtering by Content Type
Filtering by Content Type
Use content type filters to retrieve specific types of generated content:
Handling Storage URLs
Handling Storage URLs
Generated content has two URLs:
output_url: Replicate’s CDN URL (may expire)storage_url: Permanent Kakao Cloud storage URL
storage_url for persistent access to content.Credit Cost Tracking
Credit Cost Tracking
The
credit_cost field shows the credit deducted for each generation. Use this for:- Billing reconciliation
- Usage monitoring
- Cost optimization
