模型管理
转换模型格式
将已生成模型转换为目标格式,并返回下载链接。该操作消耗 10 点数。
POST
/
api
/
convertToFormat
curl --request POST \
--url https://alb.neural4d.com:3000/api/convertToFormat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
}
'
import requests
response = requests.request(
"POST",
"https://alb.neural4d.com:3000/api/convertToFormat",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
},
)
print(response.json())
const response = await fetch("https://alb.neural4d.com:3000/api/convertToFormat", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://alb.neural4d.com:3000/api/convertToFormat", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://alb.neural4d.com:3000/api/convertToFormat"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"uuid\": \"2dee04d4-f6e5-4fdf-b626-0f814e24db84\",\n \"modelType\": \"fbx\",\n \"modelSize\": 2\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"uuid\": \"2dee04d4-f6e5-4fdf-b626-0f814e24db84\",\n \"modelType\": \"fbx\",\n \"modelSize\": 2\n}")
req, _ := http.NewRequest("POST", "https://alb.neural4d.com:3000/api/convertToFormat", 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))
require "net/http"
require "json"
uri = URI("https://alb.neural4d.com:3000/api/convertToFormat")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://alb.neural4d.com:3000/api/convertToFormat");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"uuid\": \"2dee04d4-f6e5-4fdf-b626-0f814e24db84\",\n \"modelType\": \"fbx\",\n \"modelSize\": 2\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
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/convertToFormat");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"uuid\": \"2dee04d4-f6e5-4fdf-b626-0f814e24db84\",\n \"modelType\": \"fbx\",\n \"modelSize\": 2\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
{
"statusType": 1,
"modelSize": 2,
"message": "The specified model format does not exist, converting now..."
}
{
"statusType": 0,
"modelUrl": "https://s3.neural4d.com/fbx_54078587-7fdd-49c5-9fe6-317d22f27098.zip?sig=example",
"scaleNumber": 4,
"message": "Format conversion has been completed and is ready for download."
}
{
"statusType": -1,
"message": "Model not found for this UUID (0efc2b3-57e1-4813-90c6-419de96e785e). Please check if the UUID is correct."
}
授权
string
默认值:"Bearer ${YOUR_API_KEY}"
必填
使用 Neural4D 网站提供的 Bearer token。
请求体 application/json
string
必填
需要转换的生成模型 UUID。
enum<string>
默认值:"glb"
目标模型格式。可选值:
fbx、glb、obj、stl、blend、usdz。integer
默认值:2
目标模型尺寸,单位为毫米。该值必须大于 1。取值范围:
2 <= x <= infinity。curl --request POST \
--url https://alb.neural4d.com:3000/api/convertToFormat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
}
'
import requests
response = requests.request(
"POST",
"https://alb.neural4d.com:3000/api/convertToFormat",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
},
)
print(response.json())
const response = await fetch("https://alb.neural4d.com:3000/api/convertToFormat", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://alb.neural4d.com:3000/api/convertToFormat", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://alb.neural4d.com:3000/api/convertToFormat"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"uuid\": \"2dee04d4-f6e5-4fdf-b626-0f814e24db84\",\n \"modelType\": \"fbx\",\n \"modelSize\": 2\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"uuid\": \"2dee04d4-f6e5-4fdf-b626-0f814e24db84\",\n \"modelType\": \"fbx\",\n \"modelSize\": 2\n}")
req, _ := http.NewRequest("POST", "https://alb.neural4d.com:3000/api/convertToFormat", 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))
require "net/http"
require "json"
uri = URI("https://alb.neural4d.com:3000/api/convertToFormat")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://alb.neural4d.com:3000/api/convertToFormat");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"uuid\": \"2dee04d4-f6e5-4fdf-b626-0f814e24db84\",\n \"modelType\": \"fbx\",\n \"modelSize\": 2\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
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/convertToFormat");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"uuid\": \"2dee04d4-f6e5-4fdf-b626-0f814e24db84\",\n \"modelType\": \"fbx\",\n \"modelSize\": 2\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
响应
- 200
{
"statusType": 1,
"modelSize": 2,
"message": "The specified model format does not exist, converting now..."
}
{
"statusType": 0,
"modelUrl": "https://s3.neural4d.com/fbx_54078587-7fdd-49c5-9fe6-317d22f27098.zip?sig=example",
"scaleNumber": 4,
"message": "Format conversion has been completed and is ready for download."
}
{
"statusType": -1,
"message": "Model not found for this UUID (0efc2b3-57e1-4813-90c6-419de96e785e). Please check if the UUID is correct."
}
⌘I
curl --request POST \
--url https://alb.neural4d.com:3000/api/convertToFormat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
}
'
import requests
response = requests.request(
"POST",
"https://alb.neural4d.com:3000/api/convertToFormat",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
},
)
print(response.json())
const response = await fetch("https://alb.neural4d.com:3000/api/convertToFormat", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://alb.neural4d.com:3000/api/convertToFormat", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://alb.neural4d.com:3000/api/convertToFormat"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"uuid\": \"2dee04d4-f6e5-4fdf-b626-0f814e24db84\",\n \"modelType\": \"fbx\",\n \"modelSize\": 2\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"uuid\": \"2dee04d4-f6e5-4fdf-b626-0f814e24db84\",\n \"modelType\": \"fbx\",\n \"modelSize\": 2\n}")
req, _ := http.NewRequest("POST", "https://alb.neural4d.com:3000/api/convertToFormat", 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))
require "net/http"
require "json"
uri = URI("https://alb.neural4d.com:3000/api/convertToFormat")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"uuid": "2dee04d4-f6e5-4fdf-b626-0f814e24db84",
"modelType": "fbx",
"modelSize": 2
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://alb.neural4d.com:3000/api/convertToFormat");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"uuid\": \"2dee04d4-f6e5-4fdf-b626-0f814e24db84\",\n \"modelType\": \"fbx\",\n \"modelSize\": 2\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
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/convertToFormat");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"uuid\": \"2dee04d4-f6e5-4fdf-b626-0f814e24db84\",\n \"modelType\": \"fbx\",\n \"modelSize\": 2\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
{
"statusType": 1,
"modelSize": 2,
"message": "The specified model format does not exist, converting now..."
}
{
"statusType": 0,
"modelUrl": "https://s3.neural4d.com/fbx_54078587-7fdd-49c5-9fe6-317d22f27098.zip?sig=example",
"scaleNumber": 4,
"message": "Format conversion has been completed and is ready for download."
}
{
"statusType": -1,
"message": "Model not found for this UUID (0efc2b3-57e1-4813-90c6-419de96e785e). Please check if the UUID is correct."
}

