Models API

P-API - Access super fast models with Pruna optimizations

0.1.0OAS 3.0

P-API provides access to multiple AI models for image generation, video generation, and image-to-video transformation. The API supports both asynchronous and synchronous workflows:

Asynchronous Workflow (default):

  1. POST /v1/predictions - Submit a generation request
  2. GET /v1/predictions/status/{id} - Check prediction status and get results
  3. GET /v1/predictions/delivery/{path} - Download the generated content

Synchronous Workflow (with Try-Sync header):

  1. POST /v1/predictions with Try-Sync: true header - Submit a generation request and wait up to 60 seconds for completion. If the generation completes within this time, the response includes the final result directly.

The API exposes 10 AI models across different categories:

  • Text-to-Image: p-image, flux-dev, wan-image-small, qwen-image
  • Image Editing: p-image-edit, qwen-image-edit-plus, flux-dev-lora
  • Text-to-Video: wan-t2v
  • Image-to-Video: wan-i2v
  • Video Generation/Editing: vace

For detailed model documentation, see: https://api.pruna.ai

All requests require API key authentication via the apikey header. Rate limits apply per model (see individual model descriptions).

API Base URL
  • Server 1:https://api.pruna.ai

    Production server

Security
ApiKeyAuth (apiKey)

API key for authentication. You can obtain your API key from the Pruna AI dashboard.
Include it in the apikey header for all requests.

Additional Information

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