API Documentation

API for resellers: image and video generation.

Auth
Bearer token
Orders
Unified format
Upload
Temp uploads
Results
Stable order links
Authentication

All requests must include your API key in the Authorization header.

HTTP Header
Authorization: Bearer YOUR_API_KEY
Keep your API key private. Do not expose it in frontend code or public repositories.
Base URL
Production
https://pluragen.com/api/v1
Available Endpoints
GET /balance
GET /models
POST /upload
GET /upload/status
GET /upload/preview/{token}
POST /orders
GET /orders/{id}
POST /orders/{id}/cancel
GET /prompts
1. Get Balance
GET /balance
cURL
curl -X GET "https://pluragen.com/api/v1/balance" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Response
{
  "success": true,
  "balance_usd": "124.50"
}
2. Get Models
GET /models

Returns the list of available models, supported media rules, prompt behavior, and model-specific option schema for reseller integration.

Field Description
id Model ID used when creating orders.
name Human-readable model name.
type General model category such as image, video, upscale, or remove_bg.
price_usd Price per generation in USD.
fields Allowed request fields for this model.
prompt.mode Prompt behavior: required, optional, or ignored.
media.required Whether any uploaded media is required.
media.max_count Total maximum number of uploaded files allowed for the model.
media.accepted Allowed media file extensions.
media.inputs List of supported media inputs. Each input contains key, required, min, max, and accepted.
options_schema List of model-specific options that can be sent inside options when creating an order. Each item may include key, type, label, required, default, options, min, max, step, placeholder, and help.
Example Response
{
  "success": true,
  "models": [
    {
      "id": 20,
      "name": "Nano Banana",
      "type": "image",
      "price_usd": "0.05",
      "fields": ["prompt", "aspect_ratio", "output_format", "media"],
      "prompt": {
        "mode": "required"
      },
      "media": {
        "required": false,
        "max_count": 6,
        "accepted": ["jpg", "jpeg", "png", "webp"],
        "inputs": [
          {
            "key": "image",
            "required": false,
            "min": 0,
            "max": 6,
            "accepted": ["jpg", "jpeg", "png", "webp"]
          }
        ]
      },
      "options_schema": [
        {
          "key": "aspect_ratio",
          "type": "select",
          "label": "Aspect Ratio",
          "required": false,
          "default": "match_input_image",
          "options": [
            { "value": "match_input_image", "label": "match_input_image" },
            { "value": "1:1", "label": "1:1" },
            { "value": "16:9", "label": "16:9" },
            { "value": "9:16", "label": "9:16" }
          ]
        },
        {
          "key": "output_format",
          "type": "select",
          "label": "Output Format",
          "required": false,
          "default": "png",
          "options": [
            { "value": "jpg", "label": "jpg" },
            { "value": "png", "label": "png" }
          ]
        }
      ]
    }
  ]
}
3. Upload File
POST /upload

Upload media first, then use returned tmp_path inside the order request. Some files such as HEIC and HEIF may be processed asynchronously and return processing before they become ready.

cURL
curl -X POST "https://pluragen.com/api/v1/upload" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -F "file=@/path/to/image.jpg"
Response Example: ready
{
  "success": true,
  "upload": {
    "tmp_path": "tmp/c13d0de5-0795-4c38-b54d-feef2f544b1a",
    "status": "ready",
    "url": "https://pluragen.com/api/v1/upload/preview/c13d0de5-0795-4c38-b54d-feef2f544b1a",
    "original_name": "image.jpg",
    "mime_type": "image/jpeg",
    "size": 2388636,
    "error": null
  }
}
Response Example: processing
{
  "success": true,
  "upload": {
    "tmp_path": "tmp/d81d1ea9-59ec-4223-a489-6b07612020dd",
    "status": "processing",
    "url": null,
    "original_name": "IMG_9508.HEIC",
    "mime_type": "image/heic",
    "size": 3733427,
    "error": null
  }
}
Upload returns a temporary file reference in tmp_path. Use this value in /orders. If upload status is processing, wait until it becomes ready before creating the order. The url field is a temporary authenticated preview URL and should only be used for previewing the uploaded file.
Accepted formats: JPG, JPEG, PNG, WEBP, GIF, HEIC, HEIF, MP4, MOV, WEBM. Maximum file size: 300 MB. Temporary uploads expire after 24 hours. Create the order before expiration.
4. Check Upload Status
GET /upload/status

Check temporary upload status using tmp_path. This is especially useful for HEIC/HEIF files that may require asynchronous conversion before becoming ready.

cURL
curl -G "https://pluragen.com/api/v1/upload/status" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  --data-urlencode "tmp_path=tmp/d81d1ea9-59ec-4223-a489-6b07612020dd"
Response
{
  "success": true,
  "upload": {
    "tmp_path": "tmp/d81d1ea9-59ec-4223-a489-6b07612020dd",
    "status": "ready",
    "url": "https://pluragen.com/api/v1/upload/preview/d81d1ea9-59ec-4223-a489-6b07612020dd",
    "original_name": "IMG_9508.HEIC",
    "mime_type": "image/png",
    "size": 22588415,
    "error": null
  }
}
5. Preview Uploaded File
GET /upload/preview/{token}

Returns the uploaded temporary file for preview. This URL requires the same API token used for upload access. Use it only for previewing uploaded media. Use tmp_path when creating orders.

cURL
curl -X GET "https://pluragen.com/api/v1/upload/preview/c13d0de5-0795-4c38-b54d-feef2f544b1a" \
  -H "Authorization: Bearer YOUR_API_KEY"
Preview URLs are temporary and authenticated. They are not intended to be used as permanent public file links.
Seedance: price quote
POST/orders/quote

options.resolution: 480p (default), 720p or 1080p. The rate depends on quality. Use the same value for quoting and ordering; obtain a new quote after changing quality. Omitting this option retains 480p. The catalog starting price is for 480p.

For models with pricing.quote_required=true, upload media, wait until ready, then request a free quote. It includes your reseller discount and expires after 10 minutes. Send the same parameters to POST /orders with quote_id and an Idempotency-Key header. One quote creates at most one order.

No media: text-to-video; one photo without video: first frame; multiple photos: references; with video: video reference. Optional media.image: up to 6 photos; media.video: one 2-30 second MP4/MOV. HEIC/HEIF files are converted to PNG before use.

options.duration: integer 4-30, default 4. With a video, omit duration: it is rounded up from the source length with a minimum of 4. A conflicting explicit duration is rejected. Photos: 301-5999 px per side, aspect ratio strictly between 0.4 and 2.5, up to 30 MB. Video: up to 200 MB, 24-60 fps, 409600-927408 pixels per frame, aspect ratio 0.4-2.5.

Pricing: without video, output seconds × rate; with video, (input seconds rounded up + output seconds) × rate. The quote includes your discount. Catalog price_usd is the starting price for 4 seconds without source video; quote.price_usd is the final price. Missing, changed and expired quotes return price_quote_required, price_quote_changed and price_quote_expired, respectively, without creating an order.

POST /api/v1/orders/quote
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "model_id": 123,
  "prompt": "Animate the photo with a slow camera movement.",
  "media": {"image": ["tmp/your-ready-upload.png"]},
  "options": {"duration": 4, "aspect_ratio": "adaptive", "resolution": "480p"}
}

123 is a placeholder; use the actual model_id from GET /models. Submit the original parameters plus quote_id, not the entire quote response.

Image resolution

Models with pricing.type = per_image_resolution accept options.resolution. Read the allowed values and default from options_schema in GET /api/v1/models. Omitting resolution preserves the existing default. No quote_id is required.

pricing.resolutions lists each resolution's price: price_usd includes your API account discount; base_price_usd is before the discount. The model's top-level price_usd refers to pricing.default_resolution. Example: "options": {"resolution": "2K", "aspect_ratio": "1:1"}. Fetch current prices before ordering. Gpt Image 2.5 ratios 27:16, 16:27, 9:8 and 8:9 support 1K only, when offered by the model.

Seedream 5.0 Pro also charges by the number of photos in media.image; the first is included. pricing.prices_by_image_count lists final discounted totals for each resolution and image_count. Use these totals instead of adding rounded surcharges. Without photos, use image_count = 0. The default is 1K; 1K and 2K, up to 10 photos and a 4-5000 character prompt are supported. No photos selects text-to-image; photos automatically select editing.

Wan 3.0

First call POST /orders/quote with model_id, prompt and optional options: duration (integer 4-30, default 4), resolution (480p by default, 720p or 1080p), and aspect_ratio (adaptive, 1:1, 16:9, 9:16, 4:3). Audio is enabled. Other options are not supported.

Pass ready temporary uploads in media.image (up to 6 photos) and media.video (one video). Photos: JPG, non-transparent PNG, WebP or converted HEIC/HEIF; up to 20 MB, each side 240-8000 pixels. Videos: MP4/MOV, 1-15 seconds, up to 100 MB, each side 240-4096 pixels. Input media aspect ratios must be between 1:8 and 8:1.

No media generates video from text. One photo without video is the first frame; multiple photos or photos with video act as references. Use Image1, Image2, Video1 in your prompt; @image1 and [Image1] are normalized too. English prompts are recommended.

With video, omit options.duration: output duration follows the source, rounded up to whole seconds with a minimum of 4 seconds. Combined source and output duration cannot exceed 30 seconds. Pricing includes each started source second plus the chosen output seconds, according to resolution and reseller discount. The catalog starting price covers 4 seconds at 480p without video. The exact charge is quote.price_usd.

Send the same parameters to POST /orders with quote_id and an Idempotency-Key header. Quotes expire after 10 minutes, create at most one order, and must be refreshed after changes to settings, media or discounts. Quoting does not start a generation or charge the balance.

Kling 3.0 Omni

Create character videos from photos. A prompt (up to 3072 characters) and 1-7 photos are required. Upload files using the upload API, then pass their identifiers as an array in media.image. JPG, PNG, HEIC/HEIF (converted to PNG): up to 50 MB each, both sides at least 300 pixels, aspect ratio 0.4-2.5.

options.duration: an integer from 4 to 15, default 4. options.aspect_ratio: 1:1, 16:9 or 9:16, default 16:9. options.resolution: 720p (default) or 1080p; pricing depends on quality. Audio is managed by the administrator; do not submit hidden fields. Check GET /models for currently available options.

Request POST /orders/quote, then submit the same parameters to POST /orders with the returned quote_id and an Idempotency-Key header. Quotes last 10 minutes, include your discount and do not charge your balance. Obtain a new quote after changing photos, prompt or settings. The catalog shows the four-second minimum; orders use the confirmed quoted price.

Photos always act as references, including a single photo. Their order is preserved: describe, for example, “the person in the first photo”. Videos, character elements and custom multi-shot inputs are not accepted.

Kling V3 Motion Control

This model now requires POST /orders/quote. Send model_id, an optional prompt and ready uploads in media.image and media.video (one file each). A photo is required; MP4/MOV video must be 3-30 seconds and at most 100 MB. See the model catalog for photo limits.

Duration follows the video. Optional options.resolution: 720p (default) or 1080p. Pricing depends on quality. Send the same value when quoting and ordering; changing quality requires a new quote. Omitting this option retains 720p. options.duration, mode and character_orientation are not accepted; orientation follows the video. Each started second is charged once, without adding the input duration a second time; your reseller discount is included. The catalog shows the minimum price for 3 seconds at 720p; quote.price_usd is the final charge.

Send the same parameters to POST /orders with quote_id and an Idempotency-Key header. Quotes expire after 10 minutes and create at most one order. Legacy requests without quote_id return price_quote_required without creating or charging an order. Obtain a new quote if inputs change or the quote expires.

6. Create Order
POST /orders

Create a generation order using the selected model_id. Use prompt.mode, media.inputs, and options_schema from /models to determine which fields and options are supported for the selected model.

Field Required Description
model_id Yes Model ID from /models.
prompt Depends on model Text prompt. Check prompt.mode in /models.
media Depends on model Object keyed by values from media.inputs[].key. Each key contains an array of temporary upload paths returned by /upload.
options No Model-specific options. Read supported keys and values from options_schema in /models.
Headers
Authorization: Bearer YOUR_API_KEY
Accept: application/json
Content-Type: application/json
Idempotency-Key: UNIQUE_REQUEST_KEY
Use a unique Idempotency-Key for each new order request. Reusing the same key with the same request data returns the original order. Reusing the same key with different request data returns an idempotency_conflict error. Idempotency keys are scoped per API token.
Request Example: single media input
{
  "model_id": 20,
  "prompt": "ultra realistic portrait of a woman, soft cinematic light",
  "media": {
    "image": ["tmp/c13d0de5-0795-4c38-b54d-feef2f544b1a"]
  },
  "options": {
    "aspect_ratio": "1:1",
    "output_format": "png"
  }
}
Request Example: multi image input
{
  "model_id": 20,
  "prompt": "test multi images",
  "media": {
    "image": [
      "tmp/8eb547bf-5dd7-439e-8b6f-4e7055d2b6cc",
      "tmp/c0432f4e-ade1-4ee2-ae93-78a17db596b1",
      "tmp/8720667b-af67-4615-88f4-275803fe0d20"
    ]
  }
}
Request Example: role-based media
{
  "model_id": 3,
  "prompt": "cinematic portrait",
  "media": {
    "character_image": ["tmp/11111111-2222-3333-4444-555555555555"],
    "target_image": ["tmp/66666666-7777-8888-9999-000000000000"]
  }
}
Request Example: prompt-only model
{
  "model_id": 5,
  "prompt": "a futuristic city at sunset",
  "options": {
    "aspect_ratio": "16:9",
    "output_format": "jpg"
  }
}
Request Example: no prompt required
{
  "model_id": 7,
  "media": {
    "image": ["tmp/c13d0de5-0795-4c38-b54d-feef2f544b1a"]
  },
  "options": {
    "upscale_factor": "x2"
  }
}
Response
{
  "success": true,
  "order": {
    "id": "ord_123",
    "model_id": 20,
    "status": "queued",
    "cost_usd": "0.05",
    "result": [],
    "expires_at": null,
    "error": null
  }
}
Media keys are model-specific. Always read /models first and use the keys returned in media.inputs.
Model-specific generation settings must be sent inside options. Always read options_schema from /models before sending values such as aspect_ratio, output_format, upscale_factor, or other model options.
Orders accept only ready uploads. If a file is still processing, check its state via /upload/status and retry after it becomes ready.
If prompt.mode is ignored, you can omit the prompt field entirely.
7. Get Order
GET /orders/{id}

Returns the current order state, cost, result URLs, expiration time for completed files, and error if generation failed.

Response Example
{
  "success": true,
  "order": {
    "id": "ord_123",
    "model_id": 20,
    "status": "completed",
    "cost_usd": "0.05",
    "result": [
      "https://pluragen.com/g/AbC123xYz..."
    ],
    "expires_at": "2026-04-15T12:00:00Z",
    "error": null
  }
}
Status Description
queued Order was created and is waiting to start.
processing Generation is in progress.
completed Generation finished successfully.
failed Generation failed.
cancelled Generation was cancelled.
API uses simplified status values. Internal processing states are not exposed.
Result URLs returned inside the order remain stable in the API response. If the generated file expires later, the URL may return 404, but the order response itself does not change.
8. Cancel Order
POST /orders/{id}/cancel

Cancel an eligible active order. Check can_cancel in the order response. Orders waiting to start may be cancelled when the response contains can_cancel=true. Some models do not support cancellation once processing begins. An unavailable cancellation returns HTTP 409 with cannot_cancel.

If a generation cannot start due to temporary service unavailability, an eligible order stays queued for up to 24 hours and is retried every 5 minutes. The original inputs and price are retained. The response includes waiting with reason, message, until and next_retry_at; otherwise waiting is null. You may cancel while waiting using the same endpoint. Any charged funds are refunded once on cancellation or expiry. After expiry the order becomes failed. Unknown submission outcomes (e.g. a connection timeout) are not resubmitted automatically. Uploaded local files are retained while the order is active. External media URLs supplied through the API must remain accessible throughout the waiting period and generation. Cancellation may take a few seconds to be fully confirmed. You may need to poll /orders/{id} to get the final status.

cURL
curl -X POST "https://pluragen.com/api/v1/orders/ord_123/cancel" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Successful Response
{
  "success": true,
  "order": {
    "id": "ord_123",
    "model_id": 20,
    "status": "cancelled",
    "cost_usd": "0.05",
    "result": [],
    "expires_at": null,
    "error": null
  }
}
Response Example: cannot cancel
{
  "success": false,
  "error": {
    "code": "cannot_cancel",
    "message": "Order cannot be cancelled"
  },
  "order": {
    "id": "ord_123",
    "model_id": 20,
    "status": "completed",
    "cost_usd": "0.05",
    "result": [
      "https://pluragen.com/g/AbC123xYz..."
    ],
    "expires_at": "2026-04-15T12:00:00Z",
    "error": null
  }
}
Response Example: not ready
{
  "success": false,
  "error": {
    "code": "not_ready",
    "message": "Generation not started yet. Try again shortly."
  },
  "order": {
    "id": "ord_123",
    "model_id": 20,
    "status": "queued",
    "cost_usd": "0.05",
    "result": [],
    "expires_at": null,
    "error": null
  }
}
Response Example: cancel pending
{
  "success": false,
  "error": {
    "code": "cancel_pending",
    "message": "Cancellation in progress"
  },
  "order": {
    "id": "ord_123",
    "model_id": 20,
    "status": "processing",
    "cost_usd": "0.05",
    "result": [],
    "expires_at": null,
    "error": null
  }
}
If cancellation is already confirmed, the order status becomes cancelled. If the order is already completed, failed, or otherwise no longer active, the API returns 409.
9. Prompt Library

Returns a paginated list of AI prompts from the prompt library.
Access requirement: available to accounts with a total deposit of $50 or more. Access is granted automatically on first request once the threshold is met.

GET /prompts
Parameter Type Required Description
type string No image or video
category string No Category slug, e.g. zhenskie, portraits, fantasy
search string No Search by title or prompt text (RU & EN)
per_page integer No Results per page. Default: 20, max: 100
page integer No Page number. Default: 1
cURL
curl -X GET "https://pluragen.com/api/v1/prompts?type=image&category=zhenskie&per_page=20" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Response
{
  "success": true,
  "data": [
    {
      "id": 123,
      "type": {
        "key": "image",
        "name_ru": "Изображение",
        "name_en": "Image"
      },
      "category": {
        "key": "zhenskie",
        "name_ru": "Женские",
        "name_en": "Female"
      },
      "title_ru": "Женский портрет",
      "title_en": null,
      "prompt_ru": "Фотореалистичный портрет...",
      "prompt_en": null,
      "preview_url": "https://pluragen.com/prompts/123/preview"
    }
  ],
  "links": {
    "first": "https://pluragen.com/api/v1/prompts?page=1",
    "last": "https://pluragen.com/api/v1/prompts?page=132",
    "prev": null,
    "next": "https://pluragen.com/api/v1/prompts?page=2"
  },
  "meta": {
    "current_page": 1,
    "last_page": 132,
    "per_page": 20,
    "total": 2630
  }
}
Fields title_ru, title_en, prompt_ru, prompt_en may be null if the prompt only has one language version. Always check both fields on the client side.
403 - Access denied
{
  "success": false,
  "error": {
    "code": "deposit_required",
    "message": "Access to prompt library requires a minimum total deposit of $50.",
    "required": 50,
    "deposited": 12.50
  }
}
10. Error Format
Standard Error Response
{
  "success": false,
  "error": {
    "code": "validation_error",
    "message": "Invalid request data"
  }
}
Upload-related endpoints may return specific error codes such as upload_processing, file_expired, and file_not_found when a temporary upload is not ready or is no longer available.
Code Meaning
unauthorized API key missing or invalid.
model_not_found Selected model does not exist or is disabled.
order_not_found Order not found or does not belong to current API key owner.
cannot_cancel The order is already finished or otherwise cannot be cancelled.
not_ready Cancellation is not available at this stage. Check the order status before retrying.
cancel_pending Cancellation was requested but is not yet confirmed.
cancel_failed Cancellation is temporarily unavailable. Check the order status before retrying.
file_not_found Temporary uploaded file not found.
file_expired Temporary uploaded file expired.
upload_processing Temporary uploaded file is still processing and is not ready to be used in an order yet.
validation_error Request data is invalid or unsupported for the selected model.
prompt_required The selected model requires a prompt.
media_required The selected model requires uploaded media.
too_many_media Too many files were sent for the selected media input.
invalid_media_type Uploaded file type is not supported for the selected model or media input.
insufficient_balance Not enough balance to create the order.
too_many_active_orders You have too many active orders. Wait for some to complete before creating new ones.
server_busy Server is temporarily under high load. Try again shortly.
idempotency_conflict Same idempotency key was already used with different request data.
internal_error Unexpected internal error.
11. HTTP Status Codes
Status Meaning
200 Success.
201 Resource created.
400 Bad request body or invalid JSON.
401 Unauthorized.
404 Resource not found.
422 Validation or business rule error.
429 Too many requests or too many active orders.
500 Internal server error.
503 Service temporarily unavailable due to high load.
Get started