Models API

Predictions

Core prediction workflow operations for submitting requests and tracking their progress.

The asynchronous prediction workflow consists of three steps:

  1. Submit a prediction request (with Model header)
  2. Poll for status updates
  3. Download the generated content

Alternatively, use the synchronous workflow by setting Try-Sync: true header, which returns the final result directly if generation completes within 60 seconds.

Submit a content generation request

Submit a request to generate images or videos using one of the available AI models. This is the first step in the workflow.
The request will be queued for processing and you’ll receive a prediction ID to track its status.

The model to use is specified via the Model header. The request body structure varies by model (see examples below).

If the Try-Sync header is set to true, the API will wait up to 60 seconds for completion. If generation completes within this time, the response will include the final result directly.

post
https://api.pruna.ai/v1/predictions

Headers

Modelstringrequired

The AI model to use for generation. Each model has specific capabilities and input requirements.

Allowed values:flux-devflux-dev-lorawan-i2vwan-t2vwan-image-smallqwen-imageqwen-image-edit-plusvacep-imagep-image-edit

Try-Syncboolean

If true, the API will wait up to 60 seconds for the generation to complete. If generation completes within this time, returns the final result directly with status ‘succeeded’ and generation_url. If it times out or this header is false/absent, follows the standard asynchronous workflow where you poll the status endpoint.

Default:false

Body

application/json

PredictionRequest

PredictionRequestobject
One Of
inputobjectrequired
* Additional properties are NOT allowed.
Show Child Parameters

Response

application/json

Prediction request created successfully. Returns either an async response with prediction ID (default) or a sync response with final results (if Try-Sync=true and generation completes within 60 seconds).

One Of
idstringrequired

Unique identifier for the prediction

Example:1zww7deyssrme0csqwr90phzzr

modelstringrequired

Model identifier used for this prediction

Example:vace

inputobjectrequired

The input parameters provided for this prediction

* Additional properties are allowed.
get_urlstring(uri)required

URL to check prediction status

Example:https://api.pruna.ai/v1/predictions/status/1zww7deyssrme0csqwr90phzzr

post/v1/predictions

Body

{ "input": { "prompt": "A beautiful landscape with mountains and a lake at sunset, vibrant colors, photorealistic", "speed_mode": "Juiced 🔥 (default)", "num_inference_steps": 28, "guidance": 3.5, "seed": 42, "aspect_ratio": "16:9", "image_size": 1024, "output_format": "jpg", "output_quality": 80 } }
 
application/json

Get prediction status

Check the status of a prediction request. This is the second step in the asynchronous workflow.
When the prediction is completed successfully, the response will include download URLs for the generated content (images or videos).

Rate limit: 30,000 requests per minute.

get
https://api.pruna.ai/v1/predictions/status/{id}

Path Parameters

idstringrequired

The prediction ID returned from the initial request

Example:1knpbkf075rme0csjqr987hg4w

Response

application/json

Prediction status retrieved successfully

PredictionStatusResponse

statusstringrequired

Current status of the prediction

Allowed values:startingprocessingsucceededfailedcanceled

Example:processing

generation_urlstring

URL to download the generated content (available when status is ‘succeeded’)

Example:https://api.pruna.ai/v1/predictions/delivery/xezq/52UGYRrRfqViaKmvYsEnENTh0qLDAWHptQ8jOnEHu7XC6AtKA/output.mp4

messagestring

Status message

Example:Generation in progress

errorstring

Error details (available when status is ‘failed’)

Example:Number of samples, -5, must be non-negative.

get/v1/predictions/status/{id}
 
application/json

File Management

Upload files (images or videos) to be used as input for predictions. Uploaded files are stored temporarily and can be referenced in prediction requests by their URL.

Upload a file

Upload a file (image or video) to be used as input for predictions. The uploaded file will be stored temporarily and can be referenced in prediction requests by its URL.

Uploaded files are available for a limited time and are automatically deleted after expiration. Use the returned URL in your prediction input fields that accept file URLs.

Rate limit: 10000 requests per minute

Example with curl:

curl -X POST "https://api.pruna.ai/v1/files" \
  -H "apikey: YOUR_API_KEY" \
  -F "content=@/path/to/your/file.jpg"

Note: Use -F (form) with @ prefix to upload a file from your local filesystem. The file path should be absolute or relative to your current directory.

post
https://api.pruna.ai/v1/files

Body

multipart/form-data
contentstringrequired

The file to upload (image or video)

Response

application/json

File uploaded successfully

FileUploadResponse

idstringrequired

Unique identifier for the uploaded file

Example:fqadqq42xq

namestringrequired

Original filename

Example:test.jpg

content_typestringrequired

MIME type of the uploaded file

Example:image/jpeg

sizeintegerrequired

File size in bytes

Example:185093

etagstring

Entity tag for cache validation

Example:"14e9a51deaac6bee2dd8b5c52d7d0b5f"

checksumsobject

File integrity checksums

Show Child Parameters
metadataobject

Additional file metadata (varies by file type)

Show Child Parameters
created_atstring(date-time)required

Timestamp when the file was uploaded

Example:2025-01-08T18:51:26.729Z

expires_atstring(date-time)required

Timestamp when the file will expire and be deleted

Example:2025-01-09T18:51:26.729Z

urlsobjectrequired

URLs to access the uploaded file

Show Child Parameters
post/v1/files

Body

{ "content": "content" }
 
application/json