Browse documentationGet Generation Result

GET /api/v1/inference/result/{request_id}

API version: v1.2.4

Retrieve a completed MiniMax H3 Standard or Turbo video using its request_id. H3 text-to-video, image-to-video and reference-to-video share this result format. Other Model API requests can return image or audio results.

Start with MiniMax H3, Standard text-to-video or Turbo text-to-video. First confirm completed through Request Status, then fetch the result.

Endpoint

Plain text
GET /api/v1/inference/result/{request_id}

Include X-API-Key in the header and use the account that owns the request. Keep API keys on your application backend, not in browser code or URL parameters.

ParameterLocationTypeDescription
request_idPathstringRequired. The identifier returned by Submit Request.

Response

Result available (200 OK)

An illustrative H3 video response; the example media URL is a placeholder:

JSON
{
  "data": {
    "video": {
      "url": "https://example.com/generated-video.mp4"
    },
    "seed": null
  },
  "request_id": "550e8400-e29b-41d4-a716-446655440000"
}
FieldTypeDescription
request_idstringThe submitted request's identifier.
data.video.urlstringVideo result URL, including H3 outputs.
data.image.urlstringImage result URL for image-generation requests.
data.audio.urlstringAudio result URL for audio-generation requests.
data.seedinteger or nullSeed metadata when available. It is not a guarantee of identical future output.

The media key depends on the request; do not assume every result contains video. Only the applicable media key is returned. The filename, codec and file size are not additional fields guaranteed by this response.

Result not available (202 Accepted)

JSON
{
  "message": "Request is still processing, result not available yet",
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "processing"
}

There is no data result to download. Check /api/v1/inference/status/{request_id} again before deciding what to do next. A result202 alone does not establish that generation is still running: use the status endpoint to identify a terminal failed request. If status says completed but the result remains unavailable, retain the ID for a later lookup or support request.

Examples

cURL

Set PHOSOR_API_KEY to your API key and REQUEST_ID to an existing completed request ID.

cURL
curl --fail-with-body --connect-timeout 10 --max-time 40 \
  "https://phosor.ai/api/v1/inference/result/${REQUEST_ID}" \
  -H "X-API-Key: ${PHOSOR_API_KEY}"

Python: one result lookup

Python
import requests


def get_result(api_key, request_id):
    response = requests.get(
        f"https://phosor.ai/api/v1/inference/result/{request_id}",
        headers={"X-API-Key": api_key},
        timeout=(10, 40),
    )
    response.raise_for_status()
    if response.status_code == 202:
        return None  # No media yet; check the same request's status.
    return response.json()

JavaScript: one result lookup

Run on your backend. Pass the returned media URL to your frontend; keep the API key private.

JavaScript
async function getResult(apiKey, requestId) {
  const response = await fetch(
    `https://phosor.ai/api/v1/inference/result/${encodeURIComponent(requestId)}`,
    {
      headers: { 'X-API-Key': apiKey },
      signal: AbortSignal.timeout(40000),
    },
  );
  if (!response.ok) throw new Error(`Result lookup HTTP ${response.status}`);
  if (response.status === 202) return null;
  return response.json();
}

Complete workflow: submit, resume and download

These functions are for a backend using Python and requests. Defining them does not submit a generation. When you intentionally call submit_h3, save its returned ID. Call resume_h3 with that same ID for a status/result update; it never submits another job. When video_url is present, pass it to download_video.

The example uses H3 Standard text-to-video. Pass model="minimax/h3/text-to-video/turbo" for Turbo. For image/reference inputs, use the corresponding H3 model page and submission reference. Current limits and prices are linked below.

Python
import requests


def submit_h3(api_key, prompt, model="minimax/h3/text-to-video"):
    response = requests.post(
        "https://phosor.ai/api/v1/inference/submit",
        headers={"X-API-Key": api_key},
        json={
            "model": model,
            "prompt": prompt,
            "duration": 5,
            "resolution_tier": "480p",
            "aspect_ratio": "16:9",
        },
        timeout=(10, 40),
    )
    response.raise_for_status()
    return response.json()["request_id"]


def resume_h3(api_key, request_id):
    headers = {"X-API-Key": api_key}
    status_response = requests.get(
        f"https://phosor.ai/api/v1/inference/status/{request_id}",
        headers=headers,
        params={"logs": False},
        timeout=(10, 40),
    )
    status_response.raise_for_status()
    status = status_response.json()
    if status.get("status") == "failed":
        raise RuntimeError(status.get("error") or "Generation failed")
    if status.get("status") != "completed":
        return {"request_id": request_id, "status": status.get("status")}

    result_response = requests.get(
        f"https://phosor.ai/api/v1/inference/result/{request_id}",
        headers=headers,
        timeout=(10, 40),
    )
    result_response.raise_for_status()
    if result_response.status_code == 202:
        return {"request_id": request_id, "status": "result_unavailable"}
    data = result_response.json()["data"]
    return {
        "request_id": request_id,
        "status": "completed",
        "video_url": data["video"]["url"],
        "seed": data.get("seed"),
    }


def download_video(video_url, output_filename):
    # Separate media request: never forward your Phosor API key to this URL.
    with requests.get(video_url, stream=True, timeout=(10, 60)) as response:
        response.raise_for_status()
        with open(output_filename, "wb") as output:
            for chunk in response.iter_content(chunk_size=65536):
                if chunk:
                    output.write(chunk)

Each call has a connection/read timeout; there is no unbounded waiting loop. HTTP errors and network exceptions propagate to your caller. For lookup/download errors, retain the existing ID and retry that read later. If a download is interrupted, discard the partial file before using it. If a submission times out before you receive an ID, its outcome is unknown: reconcile it in your request history or with support before deciding to submit again. Automatic submission retries can create a second generation.

HTTP errors and recovery

HTTP responseMeaning and action
401Authentication is required or invalid. Check the API key.
403Access is forbidden. Use the account that owns the request.
404The request cannot be found. Verify its ID and account; no fixed retention period is implied.
500Result retrieval failed. This does not establish that generation failed. Query /api/v1/inference/status/{request_id} before deciding whether a new submission is needed.
Network timeoutThe read outcome is unknown. Keep the request ID and resume that lookup.

Error bodies may vary. Read HTTP status before indexing data; an error response or202 may have no media object.

Downloading and displaying results

Returned media URLs may expire. Retrieve a current authorized result when needed, and download important outputs to your own storage. This reference does not guarantee a fixed URL lifetime or file-retention duration. Do not forward X-API-Key to a media host. Treat result URLs as private links when sharing them.

Your frontend can use a video result URL in a normal video element. The URL below is illustrative; replace it with your backend's returned H3 video URL.

HTML
<video controls playsinline preload="metadata" src="https://example.com/generated-video.mp4">
  Your browser does not support video playback.
</video>