> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neural4d.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve generation result

> Query the generation result by UUID. This is a query-only operation and does not consume points.

## Authorizations

<ParamField header="Authorization" type="string" required default={'Bearer ${YOUR_API_KEY}'}>
  Use the bearer token provided through the Neural4D website.
</ParamField>

## Body <span className="api-content-type">application/json</span>

<ParamField body="uuid" type="string" required>
  Unique job or model identifier returned by a previous create endpoint.

  Example: `"f47ac10b-58cc-4372-a567-0e02b2c3d479"`.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://alb.neural4d.com:3000/api/queryGenerationResult \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '
  {
    "uuid": "16be86d7-210a-4d22-a00b-62935c1900d2"
  }
  '
  ```

  ```python Python theme={null}
  import requests

  response = requests.request(
      "POST",
      "https://alb.neural4d.com:3000/api/queryGenerationResult",
      headers={
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json",
      },
      json={
        "uuid": "16be86d7-210a-4d22-a00b-62935c1900d2"
      },
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://alb.neural4d.com:3000/api/queryGenerationResult", {
    method: "POST",
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "uuid": "16be86d7-210a-4d22-a00b-62935c1900d2"
    }),
  });
  const data = await response.json();
  console.log(data);
  ```

  ```typescript TypeScript theme={null}
  const response: Response = await fetch("https://alb.neural4d.com:3000/api/queryGenerationResult", {
    method: "POST",
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "uuid": "16be86d7-210a-4d22-a00b-62935c1900d2"
    }),
  });
  const data = await response.json();
  console.log(data);
  ```

  ```java Java theme={null}
  import java.net.URI;
  import java.net.http.*;

  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://alb.neural4d.com:3000/api/queryGenerationResult"))
      .header("Authorization", "Bearer <token>")
      .header("Content-Type", "application/json")
      .method("POST", HttpRequest.BodyPublishers.ofString("{\n      \"uuid\": \"16be86d7-210a-4d22-a00b-62935c1900d2\"\n    }"))
      .build();
  HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```go Go theme={null}
  package main

  import (
    "fmt"
    "io"
    "net/http"
    "strings"
  )

  payload := strings.NewReader("{\n  \"uuid\": \"16be86d7-210a-4d22-a00b-62935c1900d2\"\n}")
  req, _ := http.NewRequest("POST", "https://alb.neural4d.com:3000/api/queryGenerationResult", payload)
  req.Header.Set("Authorization", "Bearer <token>")
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  bodyBytes, _ := io.ReadAll(resp.Body)
  fmt.Println(string(bodyBytes))
  ```

  ```ruby Ruby theme={null}
  require "net/http"
  require "json"

  uri = URI("https://alb.neural4d.com:3000/api/queryGenerationResult")
  request = Net::HTTP::Post.new(uri)
  request["Authorization"] = "Bearer <token>"
  request["Content-Type"] = "application/json"
  request.body = {
    "uuid": "16be86d7-210a-4d22-a00b-62935c1900d2"
  }.to_json

  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
  puts response.body
  ```

  ```php PHP theme={null}
  <?php

  $ch = curl_init("https://alb.neural4d.com:3000/api/queryGenerationResult");
  curl_setopt_array($ch, [
      CURLOPT_CUSTOMREQUEST => "POST",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
      CURLOPT_POSTFIELDS => "{\n  \"uuid\": \"16be86d7-210a-4d22-a00b-62935c1900d2\"\n}",
  ]);
  $response = curl_exec($ch);
  curl_close($ch);
  echo $response;
  ```

  ```csharp C# theme={null}
  using System.Net.Http;
  using System.Text;

  using var client = new HttpClient();
  using var request = new HttpRequestMessage(HttpMethod.Post, "https://alb.neural4d.com:3000/api/queryGenerationResult");
  request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
  request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
  request.Content = new StringContent("{\n  \"uuid\": \"16be86d7-210a-4d22-a00b-62935c1900d2\"\n}", Encoding.UTF8, "application/json");
  using var response = await client.SendAsync(request);
  Console.WriteLine(await response.Content.ReadAsStringAsync());
  ```
</RequestExample>

## Response

<Tabs sync={false}>
  <Tab title="200">
    Generation result

    <ResponseField name="success" type="boolean" required>
      Whether the generation result query succeeded.
    </ResponseField>

    <ResponseField name="data" type="object" required>
      Current status and result data for the requested generation UUID.

      <Expandable title="child attributes">
        <ResponseField name="uuid" pre={["data."]} type="string" required>
          Generation UUID supplied in the query.
        </ResponseField>

        <ResponseField name="status" pre={["data."]} type="string" required>
          Current generation state such as `completed`, `queued`, `processing`, or `failed`.
        </ResponseField>

        <ResponseField name="resultType" pre={["data."]} type="string | null" required>
          Result type when the generation has completed, usually `image` or `video`.
        </ResponseField>

        <ResponseField name="resultUrl" pre={["data."]} type="string<uri> | null" required>
          Download URL for the generated asset when available.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>
</Tabs>

<ResponseExample>
  ```json 200 completedVideo theme={null}
  {
    "success": true,
    "data": {
      "uuid": "4d0f8188-3fdd-4596-9d31-ceb6eab831655",
      "status": "completed",
      "resultType": "video",
      "resultUrl": "https://example.mp4"
    }
  }
  ```
</ResponseExample>
