Skip to content

创建 3D 生成项目 ​

通过文本提示词或图片,AI 生成 3D 模型。

基本信息 ​

项目值
方法POST
路径/v2/aholo/project/create-3d-gen
认证API Key
Content-Typeapplication/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 表示完成。