外観リフォーム API ドキュメント#
ベース URL:
https://api.ideal.house
バージョン: v1
更新日: 2026-05-20
📖 概要#
外観リフォーム API は、入力画像から建物の外観を改修したりスタイルを変更したりします。元画像を指定し、任意でテキストの指示、参照画像、建物のスタイル、周囲の環境の希望を追加して改修結果を指定できます。
処理は非同期で、次の二つの手順で行います。
- タスクを作成する — 外観画像と任意の指示を送信し、
taskIdを受け取ります。 - 結果をポーリングする —
taskIdでタスクの状態を照会し、生成画像を取得します。
🔐 認証#
すべての API リクエストは API キー で認証する必要があります。
リクエストヘッダーに API キーを含めます。
| ヘッダー | 値 |
|---|---|
APIKEY | your_api_key_here |
⚠️ API キーは安全に保管してください。 クライアント側のコードや公開リポジトリに公開しないでください。
💰 クレジットの消費#
[!WARNING] 🪙 タスクが正常に作成されると 1 クレジット が差し引かれます。タスクが最終的に 失敗 した場合、差し引かれたクレジットはアカウントに 自動的に返還 されます。
クレジット不足の場合、エラーコード9051が返ります。📄 クレジット消費リファレンスを参照してください。
| 操作 | 消費クレジット |
|---|---|
| 外観リフォームタスク | 1 クレジット |
クレジットの詳しい規則は、クレジット消費リファレンスを参照してください。
📌 API エンドポイント#
1. 外観リフォームタスクの作成#
新しい外観リフォームタスクを作成し、ポーリング用の一意の taskId を返します。
エンドポイント
POST /api/v1/exteriorRenovator/generate
リクエストヘッダー
| ヘッダー | 必須 | 説明 |
|---|---|---|
APIKEY | ✅ はい | API の認証キー |
Content-Type | ✅ はい | application/json |
リクエストボディ
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
imageUrl | string | ✅ はい | 改修する元の外観画像の URL |
prompt | string | ❌ 任意 | 改修結果を指定する任意のテキスト |
referenceUrl | string | ❌ 任意 | 見た目のスタイルを指定する任意の参照画像の URL |
buildingStyleId | string | ❌ 任意 | 任意の建物スタイルの ID |
environmentId | string | ❌ 任意 | 任意の環境またはシーンのスタイルの ID。id1,id2 のように複数の ID をカンマで連結できます |
⚠️ 必須なのは
imageUrlだけです。 それ以外のリクエストボディのフィールドはすべて任意です。
🖼️ 画像の要件: すべての元画像と参照画像は JPG/JPEG、PNG、WebP のいずれかを使用する必要があります。各画像は 20 MB 以下で、寸法は 128 × 128 px 以上 6,000 × 6,000 px 以下です。最大ピクセル寸法を超える画像は、処理前に 6,000 × 6,000 px 以内に収まるよう縦横比を保って自動縮小されます。画像の URLs は API サーバーから直接アクセスできる必要があります。
🎨 スタイルの選択肢#
buildingStyleId と environmentId は、API スタイル設定エンドポイントから選択できます。
使用するエンドポイント:
GET /api/v1/style/exterior_renovator/getStyles
| スタイルグループ | リクエストフィールド | 説明 |
|---|---|---|
buildingStyle | buildingStyleId | 建物スタイルの選択肢 |
environment | environmentId | 環境またはシーンの選択肢。id1,id2 のように複数の選択肢の ID をカンマで連結できます |
各選択肢には name、id、url が含まれます。対応するリクエストフィールドに選択肢の id を渡します。
📥 リクエスト例#
cURL
# Minimal request
curl -X POST "https://api.ideal.house/api/v1/exteriorRenovator/generate" \
-H "APIKEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "https://example.com/exterior.jpg"
}'
# Request with optional guidance
curl -X POST "https://api.ideal.house/api/v1/exteriorRenovator/generate" \
-H "APIKEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "https://example.com/exterior.jpg",
"prompt": "Modern farmhouse exterior with warm wood accents, black window frames, and clean landscaping",
"referenceUrl": "https://example.com/reference-house.jpg",
"buildingStyleId": "modern-farmhouse",
"environmentId": "Architecture_Enviroment_Time_Night,Architecture_Enviroment_Time_Day"
}'
Java (OkHttp)
import okhttp3.*;
import java.io.IOException;
public class ExteriorRenovatorApiExample {
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 = """
{
"imageUrl": "https://example.com/exterior.jpg",
"prompt": "Modern farmhouse exterior with warm wood accents, black window frames, and clean landscaping",
"referenceUrl": "https://example.com/reference-house.jpg",
"buildingStyleId": "modern-farmhouse",
"environmentId": "Architecture_Enviroment_Time_Night,Architecture_Enviroment_Time_Day"
}
""";
Request request = new Request.Builder()
.url(BASE_URL + "/api/v1/exteriorRenovator/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 = {
"imageUrl": "https://example.com/exterior.jpg",
"prompt": "Modern farmhouse exterior with warm wood accents, black window frames, and clean landscaping",
"referenceUrl": "https://example.com/reference-house.jpg",
"buildingStyleId": "modern-farmhouse",
"environmentId": "Architecture_Enviroment_Time_Night,Architecture_Enviroment_Time_Day"
}
response = requests.post(
f"{BASE_URL}/api/v1/exteriorRenovator/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 createExteriorRenovatorTask() {
try {
const response = await axios.post(
`${BASE_URL}/api/v1/exteriorRenovator/generate`,
{
imageUrl: 'https://example.com/exterior.jpg',
prompt: 'Modern farmhouse exterior with warm wood accents, black window frames, and clean landscaping',
referenceUrl: 'https://example.com/reference-house.jpg',
buildingStyleId: 'modern-farmhouse',
environmentId: 'Architecture_Enviroment_Time_Night,Architecture_Enviroment_Time_Day'
},
{
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);
}
}
createExteriorRenovatorTask();
📤 レスポンス#
成功時のレスポンス
{
"code": 0,
"message": "success",
"data": 1234567890123456789
}
| フィールド | 型 | 説明 |
|---|---|---|
code | integer | 0 は成功を示します |
message | string | レスポンスのメッセージ |
data | long | 結果をポーリングするための一意のタスク ID |
2. タスク結果の取得#
作成済みの外観リフォームタスクの現在の状態と出力を取得します。
エンドポイント
GET /api/v1/exteriorRenovator/result
リクエストヘッダー
| ヘッダー | 必須 | 説明 |
|---|---|---|
APIKEY | ✅ はい | API の認証キー |
クエリパラメーター
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
taskId | long | ✅ はい | タスク作成エンドポイントから返されたタスク ID |
📥 リクエスト例#
cURL
curl -X GET "https://api.ideal.house/api/v1/exteriorRenovator/result?taskId=1234567890123456789" \
-H "APIKEY: your_api_key_here"
Java (OkHttp)
import okhttp3.*;
import java.io.IOException;
public class ExteriorRenovatorResultExample {
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/exteriorRenovator/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
while True:
response = requests.get(
f"{BASE_URL}/api/v1/exteriorRenovator/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)
if status == "Success":
print("Result URL:", result["output"]["resultUrl"])
else:
print("Task failed")
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/exteriorRenovator/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);
console.log('Size:', result.output.width, 'x', result.output.height);
} else {
console.log('Task failed');
}
break;
}
await new Promise(resolve => setTimeout(resolve, 3000));
}
}
pollResult(1234567890123456789);
📤 レスポンス#
成功時のレスポンス(タスク完了)
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Success",
"waitNumber": 0,
"percentage": 100,
"input": {
"imageUrl": "https://example.com/exterior.jpg",
"prompt": "Modern farmhouse exterior with warm wood accents, black window frames, and clean landscaping",
"refImageUrl": "https://example.com/reference-house.jpg",
"buildingStyleId": "modern-farmhouse",
"environmentId": "Architecture_Enviroment_Time_Night,Architecture_Enviroment_Time_Day"
},
"output": {
"resultUrl": "https://cdn.ideal.house/output/exterior_renovator_result.jpg",
"width": 1024,
"height": 1024
}
}
}
レスポンス(タスク処理中または待機中)
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Processing",
"waitNumber": 1,
"percentage": 50,
"input": {
"imageUrl": "https://example.com/exterior.jpg"
},
"output": null
}
}
レスポンス(タスク失敗)
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Failed",
"waitNumber": 0,
"percentage": 0,
"input": {
"imageUrl": "https://example.com/exterior.jpg"
},
"output": null
}
}
レスポンスのフィールド
| フィールド | 型 | 説明 |
|---|---|---|
id | long | タスクの一意の識別子 |
status | string | 現在のタスクの状態(タスクの状態を参照) |
waitNumber | integer | キュー内で前に並んでいるタスクの数(0 は現在処理中であることを示します) |
percentage | integer | タスクの完了率(0–100) |
input | object | タスクに指定した元の入力パラメーター |
input.imageUrl | string | 元の外観画像の URL |
input.prompt | string | 任意のテキスト指示(指定した場合) |
input.refImageUrl | string | 任意の参照画像の URL(指定した場合) |
input.buildingStyleId | string | 任意の建物スタイルの ID(指定した場合) |
input.environmentId | string | 任意の環境またはシーンのスタイルの ID(指定した場合)。複数の ID がカンマで連結されている場合があります |
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 キーが無効または未指定 | APIKEY ヘッダーが存在し、その値が正しいことを確認する |
9010 | SCAN_TEXT_ERROR | テキストプロンプトがコンテンツ審査に通りませんでした | プロンプトを修正し、機微な内容や禁止された内容を除く |
9038 | PROHIBITED_CONTENT | 生成された出力画像に禁止された内容が含まれています | プロンプト、スタイル、入力を調整して再試行する |
9051 | COINS_NOT_ENOUGH | コインまたはクレジットの不足 | アカウントにクレジットを追加して再試行する。クレジット消費リファレンスを参照 |
📄 共通の API エラーコードの全一覧は、エラーコードリファレンスを参照してください。