房屋平面图生成 API 文档#
基础 URL:
https://api.ideal.house
版本: v1
更新时间: 2026-06-12
📖 概述#
房屋平面图生成 API 允许您根据建筑风格、面积、结构配置和室内布局偏好,创建 AI 生成的户型排版展示图。生成成功后,该 API 将为每个任务恰好生成 1 张合成结果图。该图像在一个排版板中整合了协调的 2D 平面布置图、立面图和写实外观效果图。结果存储在 output.resultUrl 中,并作为唯一项包含在 output.resultList 里。工作流程是异步的,分为两个步骤:
- 创建任务 — 提交您的房屋平面图参数并获取
taskId。 - 轮询结果 — 使用
taskId查询任务状态并检索生成的图像。
🔐 身份验证#
所有 API 请求都必须使用 API 密钥进行身份验证。
在请求头中包含您的 API 密钥:
| 头字段 | 值 |
|---|---|
APIKEY | your_api_key_here |
⚠️ 妥善保管您的 API 密钥。 请勿在客户端代码或公共仓库中暴露它。
💰 积分扣除#
[!WARNING] 🪙 成功创建任务后,将根据所选的
modelType扣除积分。如果任务最终 失败,扣除的积分将 自动退还 到您的账户。
积分不足将返回错误代码9051。📄 参见 积分扣除说明。
模型(modelType) | 扣除积分 |
|---|---|
Base | 10 积分 |
Pro | 20 积分 |
📌 API 端点#
1. 创建房屋平面图任务#
创建一个新的 AI 房屋平面图生成任务,并返回一个唯一的 taskId 用于轮询。
端点
POST /api/v1/housePlan/generate
请求头
| 头字段 | 必填 | 说明 |
|---|---|---|
APIKEY | ✅ 是 | 您的 API 认证密钥 |
Content-Type | ✅ 是 | application/json |
请求体
| 字段 | 类型 | 必填 | 说明 | 默认值 |
|---|---|---|---|---|
style | string / null | ✅ 是 | 建筑风格英文名称。参见 风格选项 | Barndominium |
stories | string | ✅ 是 | 层数。枚举:1、2、3+ | 2 |
bedrooms | string | ✅ 是 | 卧室数量。枚举:1、2、3、4、5+ | 2 |
bathrooms | string | ✅ 是 | 卫生间数量。枚举:1、1.5、2、2.5、3、3.5、4+ | 1 |
totalArea | string | ✅ 是 | 总面积范围,格式为 min-max unit。参见 总面积选项 | 150-200 m² |
garageEnabled | boolean | ✅ 是 | 是否包含车库 | false |
garageType | string / null | ⚠️ 条件必填 | garageEnabled=true 时必填。参见 车库类型选项 | null |
garageCapacity | string / null | ⚠️ 条件必填 | garageEnabled=true 时必填。参见 车库容量 | null |
basement | string | ✅ 是 | 地下室类型。参见 地下室选项 | None |
roofType | string / null | ❌ 否 | 屋顶结构类型。参见 屋顶类型选项 | null |
outdoorSpaces | array<string> | ❌ 否 | 室外区域。参见 室外空间选项 | [] |
layoutConcept | string / null | ❌ 否 | 整体室内布局概念。参见 布局概念选项 | null |
bedroomAreaRanges | array<object> | ✅ 是 | 卧室面积范围。数组长度必须与卧室数量匹配。参见 卧室面积范围 | 参见示例 |
bathroomLayouts | array<object> | ✅ 是 | 卫生间布局选项。数组长度应为 Math.floor(bathrooms)。参见 卫生间布局 | 参见示例 |
kitchenLayout | string / null | ❌ 否 | 厨房布局。参见 厨房选项 | null |
kitchenFeatureOptions | array<string> | ❌ 否 | 可选厨房特色功能。参见 厨房选项 | [] |
keyRooms | string / null | ❌ 否 | 特色房间,多个用逗号和空格分隔。参见 关键房间选项 | null |
prompt | string | ❌ 否 | 自定义文本提示,用于进一步引导生成 | "" |
refImageUrl | string | ❌ 否 | 参考房屋图像的 URL,用于指导风格 | "" |
modelType | string | ✅ 是 | 模型质量类型。枚举:Base、Pro。⚠️ Flash 模式不支持 | Base |
🖼️ 图片要求: 可选参考图片须使用 JPG/JPEG、PNG 或 WebP 格式,大小不得超过 20 MB,尺寸须在 128 × 128 px 至 6,000 × 6,000 px(含边界)之间。超出最大像素尺寸的图片会自动按比例缩小,以适配 6,000 × 6,000 px 后再进行处理。其 URL 必须能被 API 服务器直接访问。
🎨 风格选项#
| 值 | 说明 |
|---|---|
Barndominium | 默认。 金属谷仓风格混合住宅 |
Cabin | 乡村木屋风格 |
Cape Cod | 经典新英格兰对称风格 |
Coastal | 轻盈通透的海滨风格 |
Colonial | 传统对称殖民风格建筑 |
Contemporary | 线条简洁的现代材质 |
Craftsman | 手工细节与自然材质 |
Farmhouse | 乡村农舍风格 |
French Country | 优雅的法国乡村风格 |
Mediterranean | 暖色灰泥搭配赤陶元素 |
Mid-Century Modern | 1950年代–70年代简约几何现代主义 |
Modern | 极简主义平顶/几何现代设计 |
Ranch | 单层延展布局 |
Shingle Style | 连续木质瓦片外立面 |
Southwestern | 受土坯启发的沙漠风格 |
Transitional | 传统与现代融合 |
Tudor | 半木结构的英格兰中世纪风格 |
Victorian | 繁复的 19世纪装饰风格 |
📐 总面积选项#
totalArea 字段采用 min-max unit 格式。公制值使用 m²;英制值使用 ft²。最小值必须比最大值低至少一个步长。
| 单位 | 最小值 | 最大值 | 步长 | 示例 |
|---|---|---|---|---|
m² | 50 | 500 | 10 | 150-200 m² |
ft² | 500 | 5000 | 100 | 1500-2000 ft² |
🏠 屋顶类型选项#
| 值 | 说明 |
|---|---|
Gable roof | 经典三角形坡屋顶 |
Hip roof | 四面坡屋顶 |
Flat roof | 微坡度平顶 |
Pitched roof | 通用陡坡屋顶 |
🏗️ 地下室选项#
| 值 | 说明 |
|---|---|
None | 无地下室 |
Partial | 局部地下室 |
Full | 全地下室 |
🚗 车库类型选项#
仅在 garageEnabled=true 时必填 garageType;否则发送 null。
| 值 | 说明 |
|---|---|
Detached | 独立车库 |
Front Entry | 车库入口朝前 |
Side Entry | 车库入口朝侧 |
Rear Entry | 车库入口朝后 |
🚗 车库容量#
仅在 garageEnabled=true 时必填 garageCapacity;否则发送 null。
| 值 | 说明 |
|---|---|
1 | 单车位车库 |
2 | 双车位车库 |
3+ | 三个或以上车位 |
🌿 室外空间选项#
outdoorSpaces 字段接受以下值的数组。
| 值 | 说明 |
|---|---|
Front porch | 正面带顶门廊 |
Covered patio | 带顶户外露台 |
Deck | 木质或复合材料露台 |
Balcony | 抬高的户外平台 |
Courtyard | 封闭式或半封闭户外庭院 |
Breezeway | 连接建筑的带顶通道 |
Outdoor Kitchen | 户外烹饪与用餐区 |
示例
"outdoorSpaces": ["Front porch", "Deck", "Balcony"]
🏛️ 布局概念选项#
| 值 | 说明 |
|---|---|
Open Concept | 开放式连通起居空间 |
Traditional | 分隔房间与明确边界 |
Split-Level | 区域间错层楼板 |
🛏️ 卧室面积范围#
bedroomAreaRanges 字段必须是一个数组,其长度须与 bedrooms 数量匹配。每项采用如下结构:
| 字段 | 类型 | 说明 |
|---|---|---|
name | string | 卧室显示名称,例如 Room 1 (Master) |
minArea | string | 最小卧室面积,必须为非负数字字符串 |
maxArea | string | 最大卧室面积,必须大于等于 minArea |
unit | string | 面积单位。枚举:m²、ft² |
bedrooms="2" 的默认示例
[
{ "name": "Room 1 (Master)", "minArea": "12", "maxArea": "18", "unit": "m²" },
{ "name": "Room 2", "minArea": "10", "maxArea": "14", "unit": "m²" }
]
🛁 卫生间布局#
bathroomLayouts 字段必须是一个数组,其长度应为 Math.floor(bathrooms)。例如,bathrooms="2.5" 需要 2 个卫生间布局对象。
| 字段 | 类型 | 说明 |
|---|---|---|
name | string | 卫生间显示名称,例如 Bathroom 1 |
layout | string / null | 枚举:With Wet & Dry Separation、Without Separation 或 null |
bathrooms="1" 的默认示例
[
{ "name": "Bathroom 1", "layout": null }
]
🍳 厨房选项#
厨房布局
| 值 | 说明 |
|---|---|
Open Kitchen | 与起居/用餐区相连的开敞厨房 |
Closed Kitchen | 封闭独立厨房空间 |
厨房特色功能选项
| 值 | 说明 |
|---|---|
Eating Bar | 餐吧台 / 柜台座椅 |
Kitchen Island | 厨房中岛 |
Breakfast Nook | 早餐角 |
🚪 关键房间选项#
keyRooms 字段接受以下一个或多个值。选择多个选项时,用 逗号(,) 连接。
| 值 | 说明 |
|---|---|
Home Office | 专用家庭办公室或书房 |
Bonus Room | 灵活多功能附加室 |
Media Room | 家庭影院或媒体中心 |
Mudroom | 户外装备入户间 |
Laundry Room | 专用洗衣房 |
Guest Suite | 独立客人卧室套房 |
示例
"keyRooms": "Home Office, Media Room, Guest Suite"
模型类型
| 值 | 说明 |
|---|---|
Base | 默认。 速度与质量平衡。生成高分辨率合成排版展示图 |
Pro | 更高质量和更高分辨率输出,速度较慢 |
⚠️ 注意: 此 API 不提供
Flash模式。仅支持Base和Pro。
📥 请求示例#
cURL
# Basic request with default values
curl -X POST "https://api.ideal.house/api/v1/housePlan/generate" \
-H "APIKEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"style": "Barndominium",
"stories": "2",
"bedrooms": "2",
"bathrooms": "1",
"totalArea": "150-200 m²",
"garageEnabled": false,
"garageType": null,
"garageCapacity": null,
"basement": "None",
"roofType": null,
"outdoorSpaces": [],
"layoutConcept": null,
"bedroomAreaRanges": [
{ "name": "Room 1 (Master)", "minArea": "12", "maxArea": "18", "unit": "m²" },
{ "name": "Room 2", "minArea": "10", "maxArea": "14", "unit": "m²" }
],
"bathroomLayouts": [
{ "name": "Bathroom 1", "layout": null }
],
"kitchenLayout": null,
"kitchenFeatureOptions": [],
"keyRooms": null,
"prompt": "",
"refImageUrl": "",
"modelType": "Base"
}'
# Pro model with reference image and custom prompt
curl -X POST "https://api.ideal.house/api/v1/housePlan/generate" \
-H "APIKEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"style": "Victorian",
"stories": "3+",
"bedrooms": "5+",
"bathrooms": "4+",
"totalArea": "300-380 m²",
"garageEnabled": true,
"garageType": "Front Entry",
"garageCapacity": "3+",
"basement": "Full",
"roofType": "Gable roof",
"outdoorSpaces": ["Front porch", "Balcony", "Courtyard", "Outdoor Kitchen"],
"layoutConcept": "Traditional",
"bedroomAreaRanges": [
{ "name": "Room 1 (Master)", "minArea": "18", "maxArea": "28", "unit": "m²" },
{ "name": "Room 2", "minArea": "12", "maxArea": "16", "unit": "m²" },
{ "name": "Room 3", "minArea": "12", "maxArea": "16", "unit": "m²" },
{ "name": "Room 4", "minArea": "10", "maxArea": "14", "unit": "m²" },
{ "name": "Room 5", "minArea": "10", "maxArea": "14", "unit": "m²" }
],
"bathroomLayouts": [
{ "name": "Bathroom 1", "layout": "With Wet & Dry Separation" },
{ "name": "Bathroom 2", "layout": "With Wet & Dry Separation" },
{ "name": "Bathroom 3", "layout": "Without Separation" },
{ "name": "Bathroom 4", "layout": null }
],
"kitchenLayout": "Closed Kitchen",
"kitchenFeatureOptions": ["Kitchen Island", "Breakfast Nook"],
"keyRooms": "Home Office, Bonus Room, Media Room, Guest Suite",
"prompt": "Grand Victorian mansion with ornate details and wraparound porch",
"refImageUrl": "https://example.com/reference-house.jpg",
"modelType": "Pro"
}'
Java (OkHttp)
import okhttp3.*;
import java.io.IOException;
public class HousePlanApiExample {
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();
String requestBody = """
{
"style": "Barndominium",
"stories": "2",
"bedrooms": "2",
"bathrooms": "1",
"totalArea": "150-200 m²",
"garageEnabled": false,
"garageType": null,
"garageCapacity": null,
"basement": "None",
"roofType": null,
"outdoorSpaces": [],
"layoutConcept": null,
"bedroomAreaRanges": [
{ "name": "Room 1 (Master)", "minArea": "12", "maxArea": "18", "unit": "m²" },
{ "name": "Room 2", "minArea": "10", "maxArea": "14", "unit": "m²" }
],
"bathroomLayouts": [
{ "name": "Bathroom 1", "layout": null }
],
"kitchenLayout": null,
"kitchenFeatureOptions": [],
"keyRooms": null,
"prompt": "",
"refImageUrl": "",
"modelType": "Base"
}
""";
Request request = new Request.Builder()
.url(BASE_URL + "/api/v1/housePlan/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"
}
payload = {
"style": "Barndominium",
"stories": "2",
"bedrooms": "2",
"bathrooms": "1",
"totalArea": "150-200 m²",
"garageEnabled": False,
"garageType": None,
"garageCapacity": None,
"basement": "None",
"roofType": None,
"outdoorSpaces": [],
"layoutConcept": None,
"bedroomAreaRanges": [
{ "name": "Room 1 (Master)", "minArea": "12", "maxArea": "18", "unit": "m²" },
{ "name": "Room 2", "minArea": "10", "maxArea": "14", "unit": "m²" }
],
"bathroomLayouts": [
{ "name": "Bathroom 1", "layout": None }
],
"kitchenLayout": None,
"kitchenFeatureOptions": [],
"keyRooms": None,
"prompt": "",
"refImageUrl": "",
"modelType": "Base"
}
response = requests.post(
f"{BASE_URL}/api/v1/housePlan/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 createHousePlanTask() {
try {
const response = await axios.post(
`${BASE_URL}/api/v1/housePlan/generate`,
{
style: 'Barndominium',
stories: '2',
bedrooms: '2',
bathrooms: '1',
totalArea: '150-200 m²',
garageEnabled: false,
garageType: null,
garageCapacity: null,
basement: 'None',
roofType: null,
outdoorSpaces: [],
layoutConcept: null,
bedroomAreaRanges: [
{ name: 'Room 1 (Master)', minArea: '12', maxArea: '18', unit: 'm²' },
{ name: 'Room 2', minArea: '10', maxArea: '14', unit: 'm²' }
],
bathroomLayouts: [
{ name: 'Bathroom 1', layout: null }
],
kitchenLayout: null,
kitchenFeatureOptions: [],
keyRooms: null,
prompt: '',
refImageUrl: '',
modelType: 'Base'
},
{
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);
}
}
createHousePlanTask();
📤 响应#
成功响应
{
"code": 0,
"message": "success",
"data": 1234567890123456789
}
| 字段 | 类型 | 说明 |
|---|---|---|
code | integer | 0 表示成功 |
message | string | 响应消息 |
data | long | 用于轮询结果的唯一任务 ID |
2. 获取任务结果#
检索之前创建的房屋平面图任务的当前状态和输出。
端点
GET /api/v1/housePlan/result
请求头
| 头字段 | 必填 | 说明 |
|---|---|---|
APIKEY | ✅ 是 | 您的 API 认证密钥 |
查询参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
taskId | long | ✅ 是 | 创建任务端点返回的任务 ID |
📥 请求示例#
cURL
curl -X GET "https://api.ideal.house/api/v1/housePlan/result?taskId=1234567890123456789" \
-H "APIKEY: your_api_key_here"
Java (OkHttp)
import okhttp3.*;
import java.io.IOException;
public class HousePlanResultExample {
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/housePlan/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/housePlan/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", "Termination"):
break
time.sleep(3) # Poll every 3 seconds
if status == "Success":
output = result["output"]
print("Composite Result URL:", output["resultUrl"])
print("Result List:", output.get("resultList", []))
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/housePlan/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', 'Termination'].includes(status)) {
if (status === 'Success') {
console.log('Composite Result URL:', result.output.resultUrl);
console.log('Result List:', result.output.resultList);
} else {
console.log('Task ended with status:', status);
}
break;
}
// Wait 3 seconds before next poll
await new Promise(resolve => setTimeout(resolve, 3000));
}
}
pollResult(1234567890123456789n);
📤 响应#
📸 注意: 此 API 将为每个成功任务恰好生成 1 张合成结果图。该图像在一个排版板中整合了 2D 平面布置图、立面图和写实外观效果图。
output.resultUrl包含合成图像 URL,output.resultList则为兼容起见包含同一个 URL 的单元素数组。
成功响应(任务完成)
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Success",
"waitNumber": 0,
"percentage": 100,
"input": {
"style": "Barndominium",
"stories": "2",
"bedrooms": "2",
"bathrooms": "1",
"totalArea": "150-200 m²",
"garageEnabled": false,
"garageType": null,
"garageCapacity": null,
"basement": "None",
"roofType": null,
"outdoorSpaces": [],
"layoutConcept": null,
"bedroomAreaRanges": [
{ "name": "Room 1 (Master)", "minArea": "12", "maxArea": "18", "unit": "m²" },
{ "name": "Room 2", "minArea": "10", "maxArea": "14", "unit": "m²" }
],
"bathroomLayouts": [
{ "name": "Bathroom 1", "layout": null }
],
"kitchenLayout": null,
"kitchenFeatureOptions": [],
"keyRooms": null,
"prompt": "",
"refImageUrl": "",
"modelType": "Base"
},
"output": {
"resultUrl": "https://cdn.ideal.house/output/house_plan_composite.jpg",
"resultList": [
"https://cdn.ideal.house/output/house_plan_composite.jpg"
],
"width": 2560,
"height": 1440
}
}
}
响应(任务处理中 / 队列中)
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Processing",
"waitNumber": 1,
"percentage": 45,
"input": {
"style": "Barndominium",
"stories": "2",
"bedrooms": "2",
"bathrooms": "1",
"totalArea": "150-200 m²",
"garageEnabled": false,
"garageType": null,
"garageCapacity": null,
"basement": "None",
"roofType": null,
"outdoorSpaces": [],
"layoutConcept": null,
"bedroomAreaRanges": [
{ "name": "Room 1 (Master)", "minArea": "12", "maxArea": "18", "unit": "m²" },
{ "name": "Room 2", "minArea": "10", "maxArea": "14", "unit": "m²" }
],
"bathroomLayouts": [
{ "name": "Bathroom 1", "layout": null }
],
"kitchenLayout": null,
"kitchenFeatureOptions": [],
"keyRooms": null,
"prompt": "",
"refImageUrl": "",
"modelType": "Base"
},
"output": null
}
}
响应(任务失败)
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Failed",
"waitNumber": 0,
"percentage": 0,
"input": {
"style": "Barndominium",
"stories": "2",
"bedrooms": "2",
"bathrooms": "1",
"totalArea": "150-200 m²",
"garageEnabled": false,
"basement": "None",
"modelType": "Base"
},
"output": null
}
}
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | long | 任务唯一标识符 |
status | string | 当前任务状态(参见 任务状态) |
waitNumber | integer | 队列中排在任务前面的数量(0 表示正在处理) |
percentage | integer | 任务完成百分比(0–100) |
input | object | 任务的原始输入参数 |
input.style | string | 建筑风格 |
input.totalArea | string | 总面积范围 |
input.stories | string | 楼层数 |
input.bedrooms | string | 卧室数量 |
input.bathrooms | string | 卫生间数量 |
input.garageEnabled | boolean | 是否请求了车库 |
input.garageType | string / null | 车库类型 |
input.garageCapacity | string / null | 车库泊位数 |
input.basement | string | 地下室类型 |
input.roofType | string | 屋顶类型 |
input.outdoorSpaces | array<string> | 室外空间 |
input.layoutConcept | string | 整体布局概念 |
input.bedroomAreaRanges | array<object> | 卧室面积范围 |
input.bathroomLayouts | array<object> | 卫生间布局选项 |
input.kitchenLayout | string | 厨房布局风格 |
input.kitchenFeatureOptions | array<string> | 可选厨房特色功能 |
input.keyRooms | string | 关键特色房间(逗号分隔) |
input.prompt | string | 自定义文本提示(如有提供) |
input.refImageUrl | string | 参考图像 URL(如有提供) |
input.modelType | string | 使用的模型类型 |
output | object | 生成结果(仅当 status 为 Success 时可获取) |
output.resultUrl | string | 指向生成合成房屋平面图排版展示板的 URL |
output.resultList | array<string> | 指向生成结果图像的 URLs。对于房屋平面图,通常是一个单元素数组,包含与 output.resultUrl 相同的 URL |
output.width | integer | 输出宽度(像素) |
output.height | integer | 输出高度(像素) |
📊 任务状态#
| 状态 | 说明 |
|---|---|
Unprocessed | 任务已创建但尚未开始 |
Processing | 任务正在处理中 |
Success | 任务成功完成 — 输出可用 |
Failed | 任务因错误而失败 |
Termination | 任务被中断或终止 |
每 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 密钥无效或缺失 | 确保 APIKEY 头字段存在且值正确 |
9010 | SCAN_TEXT_ERROR | 文本提示内容审核失败 | 修改提示词以去除任何敏感或禁止内容 |
9038 | PROHIBITED_CONTENT | 生成的输出图像包含禁止内容 | 调整提示词/风格/输入后重试 |
9051 | COINS_NOT_ENOUGH | 积分不足 | 充值账户积分后重试 |
📄 完整的常见 API 错误代码列表,请参阅 错误代码说明。