uuid, and then query the result or download the generated asset.
Prerequisites
- You already have a valid
Bearer tokenfrom the Neural4D website. - You can send HTTP requests with
curl, Postman, or your own client. - For upload endpoints, you already have image files that meet the documented limits.
Request flow
1
Set the auth header
Every endpoint uses
Authorization: Bearer <token>.curl --header "Authorization: Bearer YOUR_TOKEN"
2
Submit a create request
Call
POST /api/generateModelWithText to generate a 3D model with PBR materials. Set disablePbr: 0 to enable PBR; 1 generates ordinary textures only.curl --request POST \
--url 'https://alb.neural4d.com:3000/api/generateModelWithText' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "a cute bird",
"modelCount": 1,
"disablePbr": 0
}'
import requests
response = requests.post(
"https://alb.neural4d.com:3000/api/generateModelWithText",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"prompt": "a cute bird",
"modelCount": 1,
"disablePbr": 0
}
)
print(response.json())
const response = await fetch(
"https://alb.neural4d.com:3000/api/generateModelWithText",
{
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"prompt": "a cute bird",
"modelCount": 1,
"disablePbr": 0
})
}
);
console.log(await response.json());
const response: Response = await fetch(
"https://alb.neural4d.com:3000/api/generateModelWithText",
{
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"prompt": "a cute bird",
"modelCount": 1,
"disablePbr": 0
})
}
);
console.log(await response.json());
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
class Main {
public static void main(String[] args) throws Exception {
String payload = String.join("\n",
"{",
" \"prompt\": \"a cute bird\",",
" \"modelCount\": 1,",
" \"disablePbr\": 0",
"}"
);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://alb.neural4d.com:3000/api/generateModelWithText"))
.header("Authorization", "Bearer YOUR_TOKEN")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
}
}
package main
import (
"fmt"
"io"
"log"
"net/http"
"strings"
)
func main() {
if err := run(); err != nil {
log.Fatal(err)
}
}
func run() error {
payload := strings.NewReader(`{
"prompt": "a cute bird",
"modelCount": 1,
"disablePbr": 0
}`)
request, err := http.NewRequest(
"POST",
"https://alb.neural4d.com:3000/api/generateModelWithText",
payload,
)
if err != nil {
return err
}
request.Header.Set("Authorization", "Bearer YOUR_TOKEN")
request.Header.Set("Content-Type", "application/json")
response, err := http.DefaultClient.Do(request)
if err != nil {
return err
}
defer response.Body.Close()
result, err := io.ReadAll(response.Body)
if err != nil {
return err
}
fmt.Println(string(result))
return nil
}
require "net/http"
require "json"
uri = URI("https://alb.neural4d.com:3000/api/generateModelWithText")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer YOUR_TOKEN"
request["Content-Type"] = "application/json"
request.body = {
"prompt": "a cute bird",
"modelCount": 1,
"disablePbr": 0
}.to_json
response = Net::HTTP.start(
uri.hostname,
uri.port,
use_ssl: uri.scheme == "https"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'JSON'
{
"prompt": "a cute bird",
"modelCount": 1,
"disablePbr": 0
}
JSON;
$ch = curl_init("https://alb.neural4d.com:3000/api/generateModelWithText");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_TOKEN",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System;
using System.Net.Http;
using System.Text;
var payload = @"{
""prompt"": ""a cute bird"",
""modelCount"": 1,
""disablePbr"": 0
}";
using var client = new HttpClient();
using var request = new HttpRequestMessage(
HttpMethod.Post,
"https://alb.neural4d.com:3000/api/generateModelWithText"
);
request.Headers.TryAddWithoutValidation(
"Authorization",
"Bearer YOUR_TOKEN"
);
request.Content = new StringContent(
payload,
Encoding.UTF8,
"application/json"
);
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
3
Store the uuid
Create endpoints usually return
uuid or uuids. Keep them for later result queries and downloads.4
Query the result or progress
For 3D model tasks, call
POST /api/retrieveModel. For picture or video tasks, call POST /api/queryGenerationResult. You can also call POST /api/queryJobProgress for progress polling.curl --request POST \
--url 'https://alb.neural4d.com:3000/api/retrieveModel' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}'
import requests
response = requests.post(
"https://alb.neural4d.com:3000/api/retrieveModel",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
)
print(response.json())
const response = await fetch(
"https://alb.neural4d.com:3000/api/retrieveModel",
{
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
})
}
);
console.log(await response.json());
const response: Response = await fetch(
"https://alb.neural4d.com:3000/api/retrieveModel",
{
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
})
}
);
console.log(await response.json());
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
class Main {
public static void main(String[] args) throws Exception {
String payload = String.join("\n",
"{",
" \"uuid\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"",
"}"
);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://alb.neural4d.com:3000/api/retrieveModel"))
.header("Authorization", "Bearer YOUR_TOKEN")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
}
}
package main
import (
"fmt"
"io"
"log"
"net/http"
"strings"
)
func main() {
if err := run(); err != nil {
log.Fatal(err)
}
}
func run() error {
payload := strings.NewReader(`{
"uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}`)
request, err := http.NewRequest(
"POST",
"https://alb.neural4d.com:3000/api/retrieveModel",
payload,
)
if err != nil {
return err
}
request.Header.Set("Authorization", "Bearer YOUR_TOKEN")
request.Header.Set("Content-Type", "application/json")
response, err := http.DefaultClient.Do(request)
if err != nil {
return err
}
defer response.Body.Close()
result, err := io.ReadAll(response.Body)
if err != nil {
return err
}
fmt.Println(string(result))
return nil
}
require "net/http"
require "json"
uri = URI("https://alb.neural4d.com:3000/api/retrieveModel")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer YOUR_TOKEN"
request["Content-Type"] = "application/json"
request.body = {
"uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}.to_json
response = Net::HTTP.start(
uri.hostname,
uri.port,
use_ssl: uri.scheme == "https"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'JSON'
{
"uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
JSON;
$ch = curl_init("https://alb.neural4d.com:3000/api/retrieveModel");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_TOKEN",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System;
using System.Net.Http;
using System.Text;
var payload = @"{
""uuid"": ""f47ac10b-58cc-4372-a567-0e02b2c3d479""
}";
using var client = new HttpClient();
using var request = new HttpRequestMessage(
HttpMethod.Post,
"https://alb.neural4d.com:3000/api/retrieveModel"
);
request.Headers.TryAddWithoutValidation(
"Authorization",
"Bearer YOUR_TOKEN"
);
request.Content = new StringContent(
payload,
Encoding.UTF8,
"application/json"
);
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
5
Download or convert the asset
After the model is ready, download it from
modelUrl. If you need fbx, obj, stl, blend, or usdz, call POST /api/convertToFormat.Upload limits
- Upload endpoints support
JPG,JPEG,PNG, andWEBP - Recommended resolution range:
256x256to6048x8064 - Recommended file size: under
10 MB - Picture and video generation endpoints accept up to
6reference images