3D图片生成接口
curl --request POST \
--url https://geekai.co/api/v1/image3ds/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "hunyuan-3d",
"prompt": "画一只可爱的小猫",
"image": "<string>",
"multi_view_images": [
{
"view_type": "left",
"view_image_url": "<string>"
}
],
"result_format": "OBJ",
"enable_pbr": false,
"face_count": 500000,
"extra_body": {
"generate_type": "Normal",
"polygon_type": "triangle"
},
"async": false,
"retries": 0
}
'import requests
url = "https://geekai.co/api/v1/image3ds/generations"
payload = {
"model": "hunyuan-3d",
"prompt": "画一只可爱的小猫",
"image": "<string>",
"multi_view_images": [
{
"view_type": "left",
"view_image_url": "<string>"
}
],
"result_format": "OBJ",
"enable_pbr": False,
"face_count": 500000,
"extra_body": {
"generate_type": "Normal",
"polygon_type": "triangle"
},
"async": False,
"retries": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'hunyuan-3d',
prompt: '画一只可爱的小猫',
image: '<string>',
multi_view_images: [{view_type: 'left', view_image_url: '<string>'}],
result_format: 'OBJ',
enable_pbr: false,
face_count: 500000,
extra_body: {generate_type: 'Normal', polygon_type: 'triangle'},
async: false,
retries: 0
})
};
fetch('https://geekai.co/api/v1/image3ds/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://geekai.co/api/v1/image3ds/generations",
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([
'model' => 'hunyuan-3d',
'prompt' => '画一只可爱的小猫',
'image' => '<string>',
'multi_view_images' => [
[
'view_type' => 'left',
'view_image_url' => '<string>'
]
],
'result_format' => 'OBJ',
'enable_pbr' => false,
'face_count' => 500000,
'extra_body' => [
'generate_type' => 'Normal',
'polygon_type' => 'triangle'
],
'async' => false,
'retries' => 0
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://geekai.co/api/v1/image3ds/generations"
payload := strings.NewReader("{\n \"model\": \"hunyuan-3d\",\n \"prompt\": \"画一只可爱的小猫\",\n \"image\": \"<string>\",\n \"multi_view_images\": [\n {\n \"view_type\": \"left\",\n \"view_image_url\": \"<string>\"\n }\n ],\n \"result_format\": \"OBJ\",\n \"enable_pbr\": false,\n \"face_count\": 500000,\n \"extra_body\": {\n \"generate_type\": \"Normal\",\n \"polygon_type\": \"triangle\"\n },\n \"async\": false,\n \"retries\": 0\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://geekai.co/api/v1/image3ds/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"hunyuan-3d\",\n \"prompt\": \"画一只可爱的小猫\",\n \"image\": \"<string>\",\n \"multi_view_images\": [\n {\n \"view_type\": \"left\",\n \"view_image_url\": \"<string>\"\n }\n ],\n \"result_format\": \"OBJ\",\n \"enable_pbr\": false,\n \"face_count\": 500000,\n \"extra_body\": {\n \"generate_type\": \"Normal\",\n \"polygon_type\": \"triangle\"\n },\n \"async\": false,\n \"retries\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geekai.co/api/v1/image3ds/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"hunyuan-3d\",\n \"prompt\": \"画一只可爱的小猫\",\n \"image\": \"<string>\",\n \"multi_view_images\": [\n {\n \"view_type\": \"left\",\n \"view_image_url\": \"<string>\"\n }\n ],\n \"result_format\": \"OBJ\",\n \"enable_pbr\": false,\n \"face_count\": 500000,\n \"extra_body\": {\n \"generate_type\": \"Normal\",\n \"polygon_type\": \"triangle\"\n },\n \"async\": false,\n \"retries\": 0\n}"
response = http.request(request)
puts response.read_body{
"created": 123,
"data": [
{
"type": "OBJ,GLB,STL,USDZ,FBX,MP4",
"url": "<string>",
"preview_url": "<string>"
}
],
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_status": "running"
}{
"code": "validation_error",
"message": "参数验证失败",
"details": {
"field": "错误描述"
}
}{
"code": "unauthorized",
"message": "Invalid API key or token"
}{
"code": "invalid_request",
"message": "请求参数不合法"
}{
"code": "invalid_request",
"message": "请求参数不合法"
}3D模型
3D生成
POST
/
image3ds
/
generations
3D图片生成接口
curl --request POST \
--url https://geekai.co/api/v1/image3ds/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "hunyuan-3d",
"prompt": "画一只可爱的小猫",
"image": "<string>",
"multi_view_images": [
{
"view_type": "left",
"view_image_url": "<string>"
}
],
"result_format": "OBJ",
"enable_pbr": false,
"face_count": 500000,
"extra_body": {
"generate_type": "Normal",
"polygon_type": "triangle"
},
"async": false,
"retries": 0
}
'import requests
url = "https://geekai.co/api/v1/image3ds/generations"
payload = {
"model": "hunyuan-3d",
"prompt": "画一只可爱的小猫",
"image": "<string>",
"multi_view_images": [
{
"view_type": "left",
"view_image_url": "<string>"
}
],
"result_format": "OBJ",
"enable_pbr": False,
"face_count": 500000,
"extra_body": {
"generate_type": "Normal",
"polygon_type": "triangle"
},
"async": False,
"retries": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'hunyuan-3d',
prompt: '画一只可爱的小猫',
image: '<string>',
multi_view_images: [{view_type: 'left', view_image_url: '<string>'}],
result_format: 'OBJ',
enable_pbr: false,
face_count: 500000,
extra_body: {generate_type: 'Normal', polygon_type: 'triangle'},
async: false,
retries: 0
})
};
fetch('https://geekai.co/api/v1/image3ds/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://geekai.co/api/v1/image3ds/generations",
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([
'model' => 'hunyuan-3d',
'prompt' => '画一只可爱的小猫',
'image' => '<string>',
'multi_view_images' => [
[
'view_type' => 'left',
'view_image_url' => '<string>'
]
],
'result_format' => 'OBJ',
'enable_pbr' => false,
'face_count' => 500000,
'extra_body' => [
'generate_type' => 'Normal',
'polygon_type' => 'triangle'
],
'async' => false,
'retries' => 0
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://geekai.co/api/v1/image3ds/generations"
payload := strings.NewReader("{\n \"model\": \"hunyuan-3d\",\n \"prompt\": \"画一只可爱的小猫\",\n \"image\": \"<string>\",\n \"multi_view_images\": [\n {\n \"view_type\": \"left\",\n \"view_image_url\": \"<string>\"\n }\n ],\n \"result_format\": \"OBJ\",\n \"enable_pbr\": false,\n \"face_count\": 500000,\n \"extra_body\": {\n \"generate_type\": \"Normal\",\n \"polygon_type\": \"triangle\"\n },\n \"async\": false,\n \"retries\": 0\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://geekai.co/api/v1/image3ds/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"hunyuan-3d\",\n \"prompt\": \"画一只可爱的小猫\",\n \"image\": \"<string>\",\n \"multi_view_images\": [\n {\n \"view_type\": \"left\",\n \"view_image_url\": \"<string>\"\n }\n ],\n \"result_format\": \"OBJ\",\n \"enable_pbr\": false,\n \"face_count\": 500000,\n \"extra_body\": {\n \"generate_type\": \"Normal\",\n \"polygon_type\": \"triangle\"\n },\n \"async\": false,\n \"retries\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geekai.co/api/v1/image3ds/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"hunyuan-3d\",\n \"prompt\": \"画一只可爱的小猫\",\n \"image\": \"<string>\",\n \"multi_view_images\": [\n {\n \"view_type\": \"left\",\n \"view_image_url\": \"<string>\"\n }\n ],\n \"result_format\": \"OBJ\",\n \"enable_pbr\": false,\n \"face_count\": 500000,\n \"extra_body\": {\n \"generate_type\": \"Normal\",\n \"polygon_type\": \"triangle\"\n },\n \"async\": false,\n \"retries\": 0\n}"
response = http.request(request)
puts response.read_body{
"created": 123,
"data": [
{
"type": "OBJ,GLB,STL,USDZ,FBX,MP4",
"url": "<string>",
"preview_url": "<string>"
}
],
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_status": "running"
}{
"code": "validation_error",
"message": "参数验证失败",
"details": {
"field": "错误描述"
}
}{
"code": "unauthorized",
"message": "Invalid API key or token"
}{
"code": "invalid_request",
"message": "请求参数不合法"
}{
"code": "invalid_request",
"message": "请求参数不合法"
}注意:目前仅
hunyuan-3d、hunyuan-3d-pro、hunyuan-3d-pro-fast、doubao-seed3d-1.0 模型支持3D生成,其他模型不支持。请求/响应参数明细
授权
bearerAuthapiKeyAuth
API认证token
请求体
application/json
3D模型
示例:
"hunyuan-3d"
文本提示
示例:
"画一只可爱的小猫"
基于图片生成3D,支持图片URL/Base64编码,如果包含多视角则该参数值为前视图,大小不超过8M
多视角图片列表,仅混元3D和混元3D专业版支持该参数,支持图片URL/Base64编码。
Show child attributes
Show child attributes
3D输出格式设置,仅混元3D支持该参数,豆包3D通过文本提示指令设置。
可用选项:
OBJ,GLB,STL,USDZ,FBX,MP4 是否开启PBR材质,默认false,仅混元3D支持该参数。
3D模型面数,仅混元3D专业版支持该参数,默认500000,取值范围[40000,1500000]
额外参数配置项,以适配不同3D模型的多样化配置,仅混元3D专业版支持该参数。
Show child attributes
Show child attributes
是否异步生成,默认false,即同步等待图片生成成功后返回生成结果,如果异步需要通过调用图片获取接口获取生成结果
自动重试次数,默认0,表示失败不重试
此页面对您有帮助吗?
⌘I
