创建 3D 生成项目
通过文本提示词或图片,AI 生成 3D 模型。
基本信息
| 项目 | 值 |
|---|---|
| 方法 | POST |
| 路径 | /v2/aholo/project/create-3d-gen |
| 认证 | API Key |
| Content-Type | application/json |
Request
Query Param
| 参数 | 必须 | 类型 | 说明 |
|---|---|---|---|
appuid | ✅ | string | 第三方用户 ID |
Request Body
json
{
"projectName": "我的客厅",
"cover": "https://cdn.aholo.ai/path/to/cover.jpg",
"accessLevel": 0,
"prompt": "生成客厅空间",
"resources": [
{
"name": "客厅.jpg",
"type": 0,
"url": "https://cdn.aholo.ai/path/to/image.jpg",
"meta": {
"width": 1920,
"height": 1080,
"duration": null
}
}
]
}Body 参数说明
| 参数 | 必须 | 类型 | 说明 |
|---|---|---|---|
projectName | ✅ | string | 项目名称 |
cover | ❌ | string | 封面图 URL |
accessLevel | ❌ | int | 访问级别:0 公开,1 私有 |
prompt | ❌ | string | 文本提示词 |
resources | ❌ | array | 资源列表 |
resources[].url | ✅ | string | 资源 URL(来自上传接口) |
resources[].name | ✅ | string | 资源名称 |
resources[].type | ✅ | int | 资源类型:0 图片 |
resources[].meta | ✅ | object | 资源元信息 |
resources[].meta.width | ✅ | int | 宽度 |
resources[].meta.height | ✅ | int | 高度 |
Example
bash
curl -X POST 'https://openapi.kujiale.com/v2/aholo/project/create-3d-gen?appuid=user123' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"projectName": "我的客厅",
"prompt": "生成客厅空间",
"resources": [{
"name": "客厅.jpg",
"type": 0,
"url": "https://cdn.aholo.ai/path/to/image.jpg",
"meta": { "width": 1920, "height": 1080 }
}]
}'python
import requests
url = "https://openapi.kujiale.com/v2/aholo/project/create-3d-gen"
params = {"appuid": "user123"}
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"projectName": "我的客厅",
"prompt": "生成客厅空间",
"resources": [{
"name": "客厅.jpg",
"type": 0,
"url": uploaded_url,
"meta": {"width": 1920, "height": 1080}
}]
}
response = requests.post(url, params=params, headers=headers, json=payload)
project_id = response.json()["d"]javascript
const response = await fetch(
'https://openapi.kujiale.com/v2/aholo/project/create-3d-gen?appuid=user123',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
projectName: '我的客厅',
prompt: '生成客厅空间',
resources: [{
name: '客厅.jpg',
type: 0,
url: uploadedUrl,
meta: { width: 1920, height: 1080 }
}]
})
}
);
const { d: projectId } = await response.json();Response
json
{
"c": "0",
"d": "3FO4K4WF1A22"
}d 字段返回项目 ID。
下一步
创建项目后,轮询 获取项目信息 接口查询任务状态,直到 task.status 为 3 表示完成。