AI 3D 渲染 API文档#
基础 URL:
https://api.ideal.house
版本: v1
更新日期: 2026-03-06
📖 概述#
AI 3D 渲染 API允许您基于源图片提交 3D 渲染任务,可对渲染程度、渲染模式、可选文本提示词和参考风格图片进行细粒度控制。工作流程为异步,包含两个步骤:
- 创建任务 — 提交输入参数并获取
taskId。 - 轮询结果 — 使用
taskId查询任务状态并获取生成的输出。
🔐 认证#
所有 API 请求必须使用 API Key 进行认证。
在请求头中携带您的 API Key:
| 请求头 | 值 |
|---|---|
APIKEY | your_api_key_here |
⚠️ 请妥善保管您的 API Key。 请勿将其暴露在前端代码或公开仓库中。
💰 积分 扣费说明#
[!WARNING] 🪙 积分 将在任务成功创建时根据所选的
modelType扣除。如果任务最终失败,已扣除的 积分 将自动退还至您的账户。
积分不足时将返回错误码9051。📄 详见 积分扣除参考。
模型(modelType) | 扣除积分 |
|---|---|
Flash | 1 个积分 |
Base | 3 个积分 |
Pro | 10 个积分 |
📌 API 端点#
1. 创建 3D 渲染任务#
创建一个新的 AI 3D 渲染任务,并返回用于轮询的唯一 taskId。
端点
POST /api/v1/ai3dRendering/generate
请求头
| 请求头 | 必填 | 说明 |
|---|---|---|
APIKEY | ✅ 是 | 您的 API 认证密钥 |
Content-Type | ✅ 是 | application/json |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
imageUrl | string | ✅ 是 | 用于渲染的来源图像 URL |
prompt | string | ❌ 可选 | 用于引导渲染风格或内容的附加文本提示 |
modelType | string | ❌ 可选 | 模型质量类型。枚举值:Flash、Base、Pro。默认为 Flash |
renderDegree | integer | ❌ 可选 | 渲染强度等级。取值范围:1(最轻)– 6(最强)。默认为 3。仅在 modelType 为 Flash 时生效 |
renderMode | string | ❌ 可选 | 渲染模式。枚举值:default、creativeMode。默认为 default |
refImageUrl | string | ❌ 可选 | 用于指导渲染输出的参考风格图像 URL |
⚠️ 注意:
renderDegree仅在modelType设置为Flash时生效。若未指定modelType,则默认使用Flash。
🖼️ 图片要求: 所有输入和参考图片须使用 JPG/JPEG、PNG 或 WebP 格式。每张图片大小不得超过 20 MB,尺寸从 128 × 128 px 到 6,000 × 6,000 px(含)。超过最大像素尺寸的图片将自动等比缩放至 6,000 × 6,000 px 以内后再进行处理。图片 URLs 必须能被 API 服务器直接访问。
模型类型
| 值 | 说明 |
|---|---|
Flash | **默认。**生成速度最快,质量标准。支持 renderDegree 控制 |
Base | 速度与质量均衡。renderDegree 将被忽略 |
Pro | 质量最高,生成较慢。renderDegree 将被忽略 |
渲染模式
| 值 | 说明 |
|---|---|
default | **默认模式。**渲染过程中保留原图像纹理和结构 |
creativeMode | 创意模式 — 应用更具艺术性和风格化的渲染变换 |
渲染程度
| 值 | 说明 |
|---|---|
1 | 最轻渲染 — 最小程度变换 |
2 – 5 | 渐进式渲染强度 |
6 | 最强渲染 — 最大程度变换 |
📥 请求示例#
cURL
# 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)
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)
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)
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();
📤 响应#
成功响应
{
"code": 0,
"message": "success",
"data": 1234567890123456789
}
| 字段 | 类型 | 说明 |
|---|---|---|
code | integer | 0 表示成功 |
message | string | 响应消息 |
data | long | 用于轮询结果的唯一任务 ID |
2. 获取任务结果#
获取先前创建的渲染任务的当前状态和输出。
端点
GET /api/v1/ai3dRendering/result
请求头
| 请求头 | 必填 | 说明 |
|---|---|---|
APIKEY | ✅ 是 | 您的 API 认证密钥 |
查询参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
taskId | long | ✅ 是 | 由创建任务端点 返回的任务 ID |
📥 请求示例#
cURL
curl -X GET "https://api.ideal.house/api/v1/ai3dRendering/result?taskId=1234567890123456789" \
-H "APIKEY: your_api_key_here"
Java (OkHttp)
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)
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)
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);
📤 响应#
成功响应(任务完成)
{
"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
}
}
}
响应(任务处理中/排队中)
{
"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
}
}
响应(任务失败)
{
"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
}
}
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | long | 任务唯一标识符 |
status | string | 当前任务状态(参见任务状态) |
waitNumber | integer | 队列中排在任务前面的数量(0 表示正在处理中) |
percentage | integer | 任务完成百分比(0–100) |
input | object | 任务的原始输入参数 |
input.imageUrl | string | 来源图像 URL(如已提供) |
input.prompt | string | 来源文本提示(如已提供) |
input.modelType | string | 使用的模型类型 |
input.renderDegree | integer | 使用的渲染强度等级(1–6) |
input.renderMode | string | 使用的渲染模式(default 或 creativeMode) |
input.refImageUrl | string | 参考风格图像 URL(如已提供) |
output | object | 生成结果(仅在 status 为 Success 时可用) |
output.resultUrl | string | 渲染输出图像的 URL |
output.width | integer | 输出宽度(像素) |
output.height | integer | 输出高度(像素) |
📊 任务状态#
| 状态 | 说明 |
|---|---|
Unprocessed | 任务已创建但尚未开始 |
Processing | 任务正在处理中 |
Success | 任务成功完成 — 输出已可用 |
Failed | 任务因错误而失败 |
建议每 3-5 秒 轮询一次。详见 API 任务限制。
❌ 错误响应#
所有错误响应均共享相同的 JSON 结构:
{
"code": 5002,
"message": "Invalid API Key",
"data": null
}
错误码参考#
| 代码 | 名称 | 说明 | 建议操作 |
|---|---|---|---|
1001 | FAILED | 请求失败(通用错误) | 检查 message 字段以获取具体错误详情 |
1003 | INTERNAL_ERROR | 内部服务器错误 | 短暂延迟后重试;如持续发生请联系支持团队 |
1011 | PARAM_ERROR | 请求参数错误 | 验证所有必需参数均已提供且格式正确 |
5002 | API_KEY_INVALID | API Key 无效或缺失 | 确保 APIKEY 请求头 存在且值正确 |
9010 | SCAN_TEXT_ERROR | 文本提示未能通过内容审核 | 修改提示词,移除任何敏感或受限内容 |
9038 | PROHIBITED_CONTENT | 生成的输出图像包含受限内容 | 调整提示词/风格/输入并重试 |
9051 | COINS_NOT_ENOUGH | 积分不足 | 为您的账户充值积分并重试 |
📄 完整常见 API 错误码列表,请参阅 错误码参考。