Pruna P Video 2 Pro Avatar API

Turn a portrait and speech into a lip-synced talking video, from an audio file or a typed script.

POST /v2/p-video-2-pro-avatar · submit + poll
 1# pip install "segmind>=1.1.0"
 2# export SEGMIND_API_KEY="YOUR_API_KEY"
 3from segmind import SegmindClient, InferenceFailed, InferenceTimeout
 4
 5# Async (v2) — recommended for long-running / video models.
 6# run() blocks up to 600s; submit_async + job.wait(timeout=...) sets a longer
 7# deadline and keeps the request_id so you can re-poll later.
 8client = SegmindClient()                      # reads SEGMIND_API_KEY
 9payload = {
10    "image": "https://segmind-resources.s3.amazonaws.com/input/p-video-avatar-input-portrait.jpg",
11    "voice_script": "Hi there! Welcome to Segmind, where a single photo becomes a lifelike, lip-synced talking avatar.",
12    "voice": "Zephyr (Female)",
13    "voice_language": "English (US)",
14    "resolution": "768p",
15    "prompt": "The person is talking.",
16    "prompt_upsampling": True,
17    "voice_prompt": "Say the following.",
18    "seed": -1,
19}
20job = client.submit_async("p-video-2-pro-avatar", **payload)
21print(job.request_id)                         # available immediately
22try:
23    result = job.wait(timeout=900, interval=2.0)
24    print(result["status"])                  # COMPLETED
25    print(result.get("output"))              # model output (e.g. video URL)
26except InferenceTimeout as e:
27    print("still running:", e.request_id)    # re-poll later with this id
28except InferenceFailed as e:
29    print("failed:", e.detail)
30
31# Fast models (<=600s) can use the one-liner instead:
32# result = segmind.run("p-video-2-pro-avatar", **payload)

API Endpoint

POSThttps://api.segmind.com/v1/p-video-2-pro-avatar

Parameters

imagerequired
string (uri)

First-frame portrait in jpg, jpeg, png or webp, up to 20 MiB. The portrait sets the aspect ratio; use a clean, front-facing headshot.

audiooptional
string (uri)

Speech to lip-sync, up to 64 MiB and 3 minutes; the video matches its length. Overrides voice_script when both are set. Audio under 1 second is rejected.

promptoptional
string

What the video should show besides the speech, such as gestures or expression.

Default: "The person is talking."
prompt_upsamplingoptional
boolean

Appends the portrait's own scene motion to your prompt; your words stay first. Set false to use the prompt exactly as written. No price change.

Default: true
resolutionoptional
string

Output resolution. 768p costs twice as much per second of video as 480p.

Default: "768p"
Allowed values :
"480p""768p"
seedoptional
integer

Fixed seed for reproducible output. Use -1 for a new random result each run.

Default: -1Range: -1 - 2147483647
voiceoptional
string

TTS voice for voice_script, 30 options; each name carries (Female) or (Male).

Default: "Zephyr (Female)"
Allowed values (30 total):
"Zephyr (Female)""Puck (Male)""Charon (Male)""Kore (Female)""Fenrir (Male)""Leda (Female)""Orus (Male)""Aoede (Female)""Callirrhoe (Female)""Autonoe (Female)"+20 more
voice_languageoptional
string

Speech language for voice_script. Set it to match the script.

Default: "English (US)"
Allowed values :
"English (US)""English (UK)""Spanish""French""German""Italian""Portuguese (Brazil)""Japanese""Korean""Hindi"
voice_promptoptional
string

Delivery instructions for the TTS voice: tone, pacing, accent, emotion. Not spoken.

Default: "Say the following."
voice_scriptoptional
string

Exact words to speak when no audio is uploaded. Either audio or voice_script is required.

Default: "Hi there! Welcome to Segmind, where a single photo becomes a lifelike, lip-synced talking avatar."

Response Type

Returns: Video

Asynchronous requests (v2)

Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.

  1. 1
    POST /v2/p-video-2-pro-avatar

    Submit — returns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Poll — until COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Result — final response body

Status states

QUEUED— Accepted, waiting for a worker
PROCESSING— Running on a worker
COMPLETED— Done — result body is ready
FAILED— Errored (incl. content/RAI blocks)
  • A FAILED request is served as HTTP 422 — the body still carries the error detail.
  • An unknown or expired request_id returns HTTP 404.
  • Results are retained for 1 hour, then expire.
  • Content / RAI blocks surface as FAILED, not a separate state.
  • Track completion by polling the status endpoint.

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out