Ideal House
コンテンツにスキップ

外観リフォーム API ドキュメント#

ベース URL: https://api.ideal.house
バージョン: v1
更新日: 2026-05-20


📖 概要#

外観リフォーム API は、入力画像から建物の外観を改修したりスタイルを変更したりします。元画像を指定し、任意でテキストの指示、参照画像、建物のスタイル、周囲の環境の希望を追加して改修結果を指定できます。

処理は非同期で、次の二つの手順で行います。

  1. タスクを作成する — 外観画像と任意の指示を送信し、taskId を受け取ります。
  2. 結果をポーリングするtaskId でタスクの状態を照会し、生成画像を取得します。

🔐 認証#

すべての API リクエストは API キー で認証する必要があります。

リクエストヘッダーに API キーを含めます。

ヘッダー
APIKEYyour_api_key_here

⚠️ API キーは安全に保管してください。 クライアント側のコードや公開リポジトリに公開しないでください。


💰 クレジットの消費#

[!WARNING] 🪙 タスクが正常に作成されると 1 クレジット が差し引かれます。タスクが最終的に 失敗 した場合、差し引かれたクレジットはアカウントに 自動的に返還 されます。
クレジット不足の場合、エラーコード 9051 が返ります。📄 クレジット消費リファレンスを参照してください。

操作消費クレジット
外観リフォームタスク1 クレジット

クレジットの詳しい規則は、クレジット消費リファレンスを参照してください。


📌 API エンドポイント#


1. 外観リフォームタスクの作成#

新しい外観リフォームタスクを作成し、ポーリング用の一意の taskId を返します。

エンドポイント

プレーンテキスト
POST /api/v1/exteriorRenovator/generate

リクエストヘッダー

ヘッダー必須説明
APIKEY✅ はいAPI の認証キー
Content-Type✅ はいapplication/json

リクエストボディ

フィールド必須説明
imageUrlstring✅ はい改修する元の外観画像の URL
promptstring❌ 任意改修結果を指定する任意のテキスト
referenceUrlstring❌ 任意見た目のスタイルを指定する任意の参照画像の URL
buildingStyleIdstring❌ 任意任意の建物スタイルの ID
environmentIdstring❌ 任意任意の環境またはシーンのスタイルの 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 サーバーから直接アクセスできる必要があります。


🎨 スタイルの選択肢#

buildingStyleIdenvironmentId は、API スタイル設定エンドポイントから選択できます。

使用するエンドポイント:

プレーンテキスト
GET /api/v1/style/exterior_renovator/getStyles
スタイルグループリクエストフィールド説明
buildingStylebuildingStyleId建物スタイルの選択肢
environmentenvironmentId環境またはシーンの選択肢。id1,id2 のように複数の選択肢の ID をカンマで連結できます

各選択肢には nameidurl が含まれます。対応するリクエストフィールドに選択肢の id を渡します。


📥 リクエスト例#

cURL
bash
# 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)
java
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)
python
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)
javascript
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();

📤 レスポンス#

成功時のレスポンス

json
{
  "code": 0,
  "message": "success",
  "data": 1234567890123456789
}
フィールド説明
codeinteger0 は成功を示します
messagestringレスポンスのメッセージ
datalong結果をポーリングするための一意のタスク ID

2. タスク結果の取得#

作成済みの外観リフォームタスクの現在の状態と出力を取得します。

エンドポイント

プレーンテキスト
GET /api/v1/exteriorRenovator/result

リクエストヘッダー

ヘッダー必須説明
APIKEY✅ はいAPI の認証キー

クエリパラメーター

パラメーター必須説明
taskIdlong✅ はいタスク作成エンドポイントから返されたタスク ID

📥 リクエスト例#

cURL
bash
curl -X GET "https://api.ideal.house/api/v1/exteriorRenovator/result?taskId=1234567890123456789" \
  -H "APIKEY: your_api_key_here"
Java (OkHttp)
java
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)
python
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)
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/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);

📤 レスポンス#

成功時のレスポンス(タスク完了)

json
{
  "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
    }
  }
}

レスポンス(タスク処理中または待機中)

json
{
  "code": 0,
  "message": "success",
  "data": {
    "id": 1234567890123456789,
    "status": "Processing",
    "waitNumber": 1,
    "percentage": 50,
    "input": {
      "imageUrl": "https://example.com/exterior.jpg"
    },
    "output": null
  }
}

レスポンス(タスク失敗)

json
{
  "code": 0,
  "message": "success",
  "data": {
    "id": 1234567890123456789,
    "status": "Failed",
    "waitNumber": 0,
    "percentage": 0,
    "input": {
      "imageUrl": "https://example.com/exterior.jpg"
    },
    "output": null
  }
}

レスポンスのフィールド

フィールド説明
idlongタスクの一意の識別子
statusstring現在のタスクの状態(タスクの状態を参照)
waitNumberintegerキュー内で前に並んでいるタスクの数(0 は現在処理中であることを示します)
percentageintegerタスクの完了率(0–100
inputobjectタスクに指定した元の入力パラメーター
input.imageUrlstring元の外観画像の URL
input.promptstring任意のテキスト指示(指定した場合)
input.refImageUrlstring任意の参照画像の URL(指定した場合)
input.buildingStyleIdstring任意の建物スタイルの ID(指定した場合)
input.environmentIdstring任意の環境またはシーンのスタイルの ID(指定した場合)。複数の ID がカンマで連結されている場合があります
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 キーが無効または未指定APIKEY ヘッダーが存在し、その値が正しいことを確認する
9010SCAN_TEXT_ERRORテキストプロンプトがコンテンツ審査に通りませんでしたプロンプトを修正し、機微な内容や禁止された内容を除く
9038PROHIBITED_CONTENT生成された出力画像に禁止された内容が含まれていますプロンプト、スタイル、入力を調整して再試行する
9051COINS_NOT_ENOUGHコインまたはクレジットの不足アカウントにクレジットを追加して再試行する。クレジット消費リファレンスを参照

📄 共通の API エラーコードの全一覧は、エラーコードリファレンスを参照してください。