Ideal House
跳转到主要内容

AI 3D 渲染 API文档#

基础 URL: https://api.ideal.house
版本: v1
更新日期: 2026-03-06


📖 概述#

AI 3D 渲染 API允许您基于源图片提交 3D 渲染任务,可对渲染程度、渲染模式、可选文本提示词和参考风格图片进行细粒度控制。工作流程为异步,包含两个步骤:

  1. 创建任务 — 提交输入参数并获取 taskId
  2. 轮询结果 — 使用 taskId 查询任务状态并获取生成的输出。

🔐 认证#

所有 API 请求必须使用 API Key 进行认证。

在请求头中携带您的 API Key:

请求头
APIKEYyour_api_key_here

⚠️ 请妥善保管您的 API Key。 请勿将其暴露在前端代码或公开仓库中。


💰 积分 扣费说明#

[!WARNING] 🪙 积分 将在任务成功创建时根据所选的 modelType 扣除。如果任务最终失败,已扣除的 积分 将自动退还至您的账户。
积分不足时将返回错误码 9051。📄 详见 积分扣除参考

模型(modelType扣除积分
Flash1 个积分
Base3 个积分
Pro10 个积分

📌 API 端点#


1. 创建 3D 渲染任务#

创建一个新的 AI 3D 渲染任务,并返回用于轮询的唯一 taskId

端点

纯文本
POST /api/v1/ai3dRendering/generate

请求头

请求头必填说明
APIKEY✅ 是您的 API 认证密钥
Content-Type✅ 是application/json

请求体

字段类型必填说明
imageUrlstring✅ 是用于渲染的来源图像 URL
promptstring❌ 可选用于引导渲染风格或内容的附加文本提示
modelTypestring❌ 可选模型质量类型。枚举值:FlashBasePro。默认为 Flash
renderDegreeinteger❌ 可选渲染强度等级。取值范围:1(最轻)– 6(最强)。默认为 3仅在 modelTypeFlash 时生效
renderModestring❌ 可选渲染模式。枚举值:defaultcreativeMode。默认为 default
refImageUrlstring❌ 可选用于指导渲染输出的参考风格图像 URL

⚠️ 注意: renderDegree 仅在 modelType 设置为 Flash 时生效。若未指定 modelType,则默认使用 Flash

🖼️ 图片要求: 所有输入和参考图片须使用 JPG/JPEG、PNG 或 WebP 格式。每张图片大小不得超过 20 MB,尺寸从 128 × 128 px6,000 × 6,000 px(含)。超过最大像素尺寸的图片将自动等比缩放至 6,000 × 6,000 px 以内后再进行处理。图片 URLs 必须能被 API 服务器直接访问。


模型类型

说明
Flash**默认。**生成速度最快,质量标准。支持 renderDegree 控制
Base速度与质量均衡。renderDegree 将被忽略
Pro质量最高,生成较慢。renderDegree 将被忽略

渲染模式

说明
default**默认模式。**渲染过程中保留原图像纹理和结构
creativeMode创意模式 — 应用更具艺术性和风格化的渲染变换

渲染程度

说明
1最轻渲染 — 最小程度变换
25渐进式渲染强度
6最强渲染 — 最大程度变换

📥 请求示例#

cURL
bash
# Using Flash model with renderDegree (texture preservation mode)
curl -X POST "https://api.ideal.house/api/v1/ai3dRendering/generate" \
  -H "APIKEY: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "imageUrl": "https://example.com/room.jpg",
    "modelType": "Flash",
    "renderDegree": 4,
    "renderMode": "default"
  }'

# Using Flash model with creative mode, prompt and a reference image
curl -X POST "https://api.ideal.house/api/v1/ai3dRendering/generate" \
  -H "APIKEY: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "imageUrl": "https://example.com/room.jpg",
    "prompt": "A modern minimalist living room with wooden floor",
    "modelType": "Flash",
    "renderDegree": 5,
    "renderMode": "creativeMode",
    "refImageUrl": "https://example.com/style-reference.jpg"
  }'

# Using Pro model (renderDegree is ignored)
curl -X POST "https://api.ideal.house/api/v1/ai3dRendering/generate" \
  -H "APIKEY: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "imageUrl": "https://example.com/room.jpg",
    "modelType": "Pro",
    "renderMode": "default"
  }'
Java (OkHttp)
java
import okhttp3.*;
import java.io.IOException;

public class Ai3dRenderingApiExample {

    private static final String BASE_URL = "https://api.ideal.house";
    private static final String API_KEY  = "your_api_key_here";

    public static void main(String[] args) throws IOException {
        OkHttpClient client = new OkHttpClient();

        // Flash model with renderDegree (renderDegree only works with Flash)
        String requestBody = """
            {
                "imageUrl": "https://example.com/room.jpg",
                "modelType": "Flash",
                "renderDegree": 4,
                "renderMode": "default"
            }
            """;

        // Pro model example (renderDegree is ignored)
        // String requestBody = """
        //     {
        //         "imageUrl": "https://example.com/room.jpg",
        //         "modelType": "Pro",
        //         "renderMode": "default"
        //     }
        //     """;

        Request request = new Request.Builder()
            .url(BASE_URL + "/api/v1/ai3dRendering/generate")
            .addHeader("APIKEY", API_KEY)
            .addHeader("Content-Type", "application/json")
            .post(RequestBody.create(requestBody, MediaType.parse("application/json")))
            .build();

        try (Response response = client.newCall(request).execute()) {
            System.out.println("Response: " + response.body().string());
        }
    }
}
Python (requests)
python
import requests

BASE_URL = "https://api.ideal.house"
API_KEY  = "your_api_key_here"

headers = {
    "APIKEY": API_KEY,
    "Content-Type": "application/json"
}

# Flash model — renderDegree takes effect (default texture preservation mode)
payload = {
    "imageUrl": "https://example.com/room.jpg",
    "modelType": "Flash",
    "renderDegree": 4,
    "renderMode": "default"
}

# Flash model with creative mode, prompt and reference image
# payload = {
#     "imageUrl": "https://example.com/room.jpg",
#     "prompt": "A modern minimalist living room with wooden floor",
#     "modelType": "Flash",
#     "renderDegree": 5,
#     "renderMode": "creativeMode",
#     "refImageUrl": "https://example.com/style-reference.jpg"
# }

# Pro model — renderDegree is ignored
# payload = {
#     "imageUrl": "https://example.com/room.jpg",
#     "modelType": "Pro",
#     "renderMode": "default"
# }

response = requests.post(
    f"{BASE_URL}/api/v1/ai3dRendering/generate",
    headers=headers,
    json=payload
)

data = response.json()
task_id = data.get("data")
print(f"Task ID: {task_id}")
Node.js (axios)
javascript
const axios = require('axios');

const BASE_URL = 'https://api.ideal.house';
const API_KEY  = 'your_api_key_here';

async function createRenderingTask() {
  try {
    const response = await axios.post(
      `${BASE_URL}/api/v1/ai3dRendering/generate`,
      {
        // Flash model — renderDegree takes effect
        imageUrl: 'https://example.com/room.jpg',
        modelType: 'Flash',
        renderDegree: 4,
        renderMode: 'default'

        // Flash model with creative mode:
        // prompt: 'A modern minimalist living room with wooden floor',
        // modelType: 'Flash',
        // renderDegree: 5,
        // renderMode: 'creativeMode',
        // refImageUrl: 'https://example.com/style-reference.jpg'

        // Pro model — renderDegree is ignored:
        // imageUrl: 'https://example.com/room.jpg',
        // modelType: 'Pro',
        // renderMode: 'default'
      },
      {
        headers: {
          'APIKEY': API_KEY,
          'Content-Type': 'application/json'
        }
      }
    );

    const taskId = response.data.data;
    console.log('Task ID:', taskId);
    return taskId;
  } catch (error) {
    console.error('Error:', error.response?.data || error.message);
  }
}

createRenderingTask();

📤 响应#

成功响应

json
{
  "code": 0,
  "message": "success",
  "data": 1234567890123456789
}
字段类型说明
codeinteger0 表示成功
messagestring响应消息
datalong用于轮询结果的唯一任务 ID

2. 获取任务结果#

获取先前创建的渲染任务的当前状态和输出。

端点

纯文本
GET /api/v1/ai3dRendering/result

请求头

请求头必填说明
APIKEY✅ 是您的 API 认证密钥

查询参数

参数类型必填说明
taskIdlong✅ 是由创建任务端点 返回的任务 ID

📥 请求示例#

cURL
bash
curl -X GET "https://api.ideal.house/api/v1/ai3dRendering/result?taskId=1234567890123456789" \
  -H "APIKEY: your_api_key_here"
Java (OkHttp)
java
import okhttp3.*;
import java.io.IOException;

public class Ai3dRenderingResultExample {

    private static final String BASE_URL = "https://api.ideal.house";
    private static final String API_KEY  = "your_api_key_here";

    public static void main(String[] args) throws IOException {
        OkHttpClient client = new OkHttpClient();
        long taskId = 1234567890123456789L;

        Request request = new Request.Builder()
            .url(BASE_URL + "/api/v1/ai3dRendering/result?taskId=" + taskId)
            .addHeader("APIKEY", API_KEY)
            .get()
            .build();

        try (Response response = client.newCall(request).execute()) {
            System.out.println("Response: " + response.body().string());
        }
    }
}
Python (requests)
python
import requests
import time

BASE_URL = "https://api.ideal.house"
API_KEY  = "your_api_key_here"

headers = {
    "APIKEY": API_KEY
}

task_id = 1234567890123456789

# Poll until task is complete
while True:
    response = requests.get(
        f"{BASE_URL}/api/v1/ai3dRendering/result",
        headers=headers,
        params={"taskId": task_id}
    )

    data = response.json()
    result = data.get("data", {})
    status = result.get("status")

    print(f"Status: {status}, Progress: {result.get('percentage')}%, Queue: {result.get('waitNumber')}")

    if status in ("Success", "Failed"):
        break

    time.sleep(3)  # Poll every 3 seconds

if status == "Success":
    print("Result URL:", result["output"]["resultUrl"])
else:
    print("Task ended with status:", status)
Node.js (axios)
javascript
const axios = require('axios');

const BASE_URL = 'https://api.ideal.house';
const API_KEY  = 'your_api_key_here';

async function pollResult(taskId) {
  const headers = { 'APIKEY': API_KEY };

  while (true) {
    const response = await axios.get(
      `${BASE_URL}/api/v1/ai3dRendering/result`,
      {
        headers,
        params: { taskId }
      }
    );

    const result = response.data.data;
    const { status, percentage, waitNumber } = result;

    console.log(`Status: ${status} | Progress: ${percentage}% | Queue: ${waitNumber}`);

    if (['Success', 'Failed'].includes(status)) {
      if (status === 'Success') {
        console.log('Result URL:', result.output.resultUrl);
      } else {
        console.log('Task ended with status:', status);
      }
      break;
    }

    // Wait 3 seconds before next poll
    await new Promise(resolve => setTimeout(resolve, 3000));
  }
}

pollResult(1234567890123456789n);

📤 响应#

成功响应(任务完成)

json
{
  "code": 0,
  "message": "success",
  "data": {
    "id": 1234567890123456789,
    "status": "Success",
    "waitNumber": 0,
    "percentage": 100,
    "input": {
      "imageUrl": "https://example.com/room.jpg",
      "modelType": "Flash",
      "renderDegree": 4,
      "renderMode": "default"
    },
    "output": {
      "resultUrl": "https://cdn.ideal.house/output/rendered_result.jpg",
      "width": 1024,
      "height": 1024
    }
  }
}

响应(任务处理中/排队中)

json
{
  "code": 0,
  "message": "success",
  "data": {
    "id": 1234567890123456789,
    "status": "Processing",
    "waitNumber": 1,
    "percentage": 50,
    "input": {
      "imageUrl": "https://example.com/room.jpg",
      "modelType": "Flash",
      "renderDegree": 4,
      "renderMode": "default"
    },
    "output": null
  }
}

响应(任务失败)

json
{
  "code": 0,
  "message": "success",
  "data": {
    "id": 1234567890123456789,
    "status": "Failed",
    "waitNumber": 0,
    "percentage": 0,
    "input": {
      "imageUrl": "https://example.com/room.jpg",
      "modelType": "Flash",
      "renderDegree": 4,
      "renderMode": "default"
    },
    "output": null
  }
}

响应字段

字段类型说明
idlong任务唯一标识符
statusstring当前任务状态(参见任务状态
waitNumberinteger队列中排在任务前面的数量(0 表示正在处理中)
percentageinteger任务完成百分比(0–100
inputobject任务的原始输入参数
input.imageUrlstring来源图像 URL(如已提供)
input.promptstring来源文本提示(如已提供)
input.modelTypestring使用的模型类型
input.renderDegreeinteger使用的渲染强度等级(1–6
input.renderModestring使用的渲染模式(defaultcreativeMode
input.refImageUrlstring参考风格图像 URL(如已提供)
outputobject生成结果(仅在 statusSuccess 时可用)
output.resultUrlstring渲染输出图像的 URL
output.widthinteger输出宽度(像素)
output.heightinteger输出高度(像素)

📊 任务状态#

状态说明
Unprocessed任务已创建但尚未开始
Processing任务正在处理中
Success任务成功完成 — 输出已可用
Failed任务因错误而失败

建议每 3-5 秒 轮询一次。详见 API 任务限制


❌ 错误响应#

所有错误响应均共享相同的 JSON 结构:

json
{
  "code": 5002,
  "message": "Invalid API Key",
  "data": null
}

错误码参考#

代码名称说明建议操作
1001FAILED请求失败(通用错误)检查 message 字段以获取具体错误详情
1003INTERNAL_ERROR内部服务器错误短暂延迟后重试;如持续发生请联系支持团队
1011PARAM_ERROR请求参数错误验证所有必需参数均已提供且格式正确
5002API_KEY_INVALIDAPI Key 无效或缺失确保 APIKEY 请求头 存在且值正确
9010SCAN_TEXT_ERROR文本提示未能通过内容审核修改提示词,移除任何敏感或受限内容
9038PROHIBITED_CONTENT生成的输出图像包含受限内容调整提示词/风格/输入并重试
9051COINS_NOT_ENOUGH积分不足为您的账户充值积分并重试

📄 完整常见 API 错误码列表,请参阅 错误码参考