模型管理
查询模型
通过 UUID 查询已生成的模型。
POST
/
api
/
retrieveModel
查询模型
curl --request POST \
--url https://alb.neural4d.com:3000/api/retrieveModel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({uuid: 'f47ac10b-58cc-4372-a567-0e02b2c3d479'})
};
fetch('https://alb.neural4d.com:3000/api/retrieveModel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://alb.neural4d.com:3000/api/retrieveModel"
payload = { "uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const url = 'https://alb.neural4d.com:3000/api/retrieveModel';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({uuid: 'f47ac10b-58cc-4372-a567-0e02b2c3d479'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({uuid: 'f47ac10b-58cc-4372-a567-0e02b2c3d479'})
};
fetch('https://alb.neural4d.com:3000/api/retrieveModel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://alb.neural4d.com:3000/api/retrieveModel"
payload := strings.NewReader("{\n \"uuid\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://alb.neural4d.com:3000/api/retrieveModel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"uuid\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://alb.neural4d.com:3000/api/retrieveModel");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"uuid\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "https://alb.neural4d.com:3000/api/retrieveModel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'uuid' => 'f47ac10b-58cc-4372-a567-0e02b2c3d479'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"codeStatus": 0,
"message": "Generate model success",
"modelUrl": "https://cos.zmkj.com/afsafr24.glb?AWSAccessKeyId=AKIDodI2mK61Xsfasfsfsa",
"imageUrl": "https://cos.zmkj.com/afsafr24.jpg?AWSAccessKeyId=AKIDodI2mK61Xsfasfsfsa",
"prompts": "a cute bird",
"createdAt": "2024-11-07T05:59:40.000Z",
"sourcePage": "createModel"
}授权
使用 Neural4D 网站提供的 Bearer token。
请求体
application/json
由创建接口返回的任务或模型唯一标识。
示例:
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
响应
200 - application/json
模型查询结果
结果状态。0 表示已完成,1 表示生成中,-1 表示 token 无效或已过期,-2 表示 UUID 不存在,-3 表示生成失败。
可用选项:
-3, -2, -1, 0, 1 查询状态消息。
生成完成后可用的模型下载链接。
生成完成后可用的模型预览图链接。
与该模型关联的提示词内容。
模型创建时间。
服务返回的来源页面标记。
⌘I
查询模型
curl --request POST \
--url https://alb.neural4d.com:3000/api/retrieveModel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({uuid: 'f47ac10b-58cc-4372-a567-0e02b2c3d479'})
};
fetch('https://alb.neural4d.com:3000/api/retrieveModel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://alb.neural4d.com:3000/api/retrieveModel"
payload = { "uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const url = 'https://alb.neural4d.com:3000/api/retrieveModel';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({uuid: 'f47ac10b-58cc-4372-a567-0e02b2c3d479'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({uuid: 'f47ac10b-58cc-4372-a567-0e02b2c3d479'})
};
fetch('https://alb.neural4d.com:3000/api/retrieveModel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://alb.neural4d.com:3000/api/retrieveModel"
payload := strings.NewReader("{\n \"uuid\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://alb.neural4d.com:3000/api/retrieveModel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"uuid\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://alb.neural4d.com:3000/api/retrieveModel");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"uuid\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "https://alb.neural4d.com:3000/api/retrieveModel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'uuid' => 'f47ac10b-58cc-4372-a567-0e02b2c3d479'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"codeStatus": 0,
"message": "Generate model success",
"modelUrl": "https://cos.zmkj.com/afsafr24.glb?AWSAccessKeyId=AKIDodI2mK61Xsfasfsfsa",
"imageUrl": "https://cos.zmkj.com/afsafr24.jpg?AWSAccessKeyId=AKIDodI2mK61Xsfasfsfsa",
"prompts": "a cute bird",
"createdAt": "2024-11-07T05:59:40.000Z",
"sourcePage": "createModel"
}
