造園 API ドキュメント#
ベース URL:
https://api.ideal.house
バージョン: v1
更新日: 2026-05-21
📖 概要#
造園 API は、元画像の屋外の庭や景観を改善または再設計します。任意のテキスト指示、庭のスタイル、景観要素、モデルのモードに対応しています。
処理は非同期で行います。
- タスクを作成する —
imageUrlと任意のパラメーターを送信し、taskIdを受け取ります。 - 結果をポーリングする —
taskIdでタスクの状態と生成画像を取得します。
🔐 認証#
| ヘッダー | 値 |
|---|---|
APIKEY | your_api_key_here |
💰 クレジットの消費#
[!WARNING] タスクが正常に作成されるとクレジットが差し引かれます。タスクが最終的に 失敗 した場合、差し引かれたクレジットは 自動的に返還 されます。
クレジット不足の場合、エラーコード9051が返ります。クレジット消費リファレンスを参照してください。
モデル(modelType) | 消費クレジット |
|---|---|
Flash | 1 クレジット |
Base | 3 クレジット |
Pro | 10 クレジット |
modelType が未指定の場合は、既定値の Base を使用します。
🎨 スタイルの選択肢#
この API は、API スタイル設定エンドポイントが返す任意のスタイルパラメーターに対応しています。
使用するエンドポイント:
GET /api/v1/style/landscaping/getStyles
| スタイルグループ | リクエストフィールド | 説明 |
|---|---|---|
gardenStyle | sceneId | 庭または景観のスタイルの選択肢 |
elements | sceneElementId | 景観要素の選択肢。id1,id2 のように複数の選択肢の ID をカンマで連結できます |
各選択肢には name、id、url が含まれます。対応するリクエストフィールドに選択肢の id を渡します。
📌 API エンドポイント#
1. 造園タスクの作成#
エンドポイント
POST /api/v1/landscaping/generate
リクエストヘッダー
| ヘッダー | 必須 | 説明 |
|---|---|---|
APIKEY | ✅ はい | API の認証キー |
Content-Type | ✅ はい | application/json |
リクエストボディ
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
imageUrl | string | ✅ はい | 元の庭や景観の画像の URL |
prompt | string | ❌ 任意 | 希望する結果を指定するテキスト |
sceneId | string | ❌ 任意 | gardenStyle のスタイル選択肢から取得した庭のスタイルの ID |
sceneElementId | string | ❌ 任意 | elements のスタイル選択肢から取得した景観要素の ID。id1,id2 のように複数の ID をカンマで連結できます |
modelType | string | ❌ 任意 | 列挙値: Flash、Base、Pro。既定値は Base |
必須なのは
imageUrlだけです。それ以外のフィールドはすべて任意です。
🖼️ 画像の要件: すべての元画像と参照画像は JPG/JPEG、PNG、WebP のいずれかを使用する必要があります。各画像は 20 MB 以下で、寸法は 128 × 128 px 以上 6,000 × 6,000 px 以下です。最大ピクセル寸法を超える画像は、処理前に 6,000 × 6,000 px 以内に収まるよう縦横比を保って自動縮小されます。画像の URLs は API サーバーから直接アクセスできる必要があります。
📥 リクエスト例#
cURL
curl -X POST "https://api.ideal.house/api/v1/landscaping/generate" \
-H "APIKEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "https://example.com/backyard.jpg",
"prompt": "lush modern garden with clean stone paths",
"sceneId": "Landscape Design_Landscape Style_Mid-Century Modern Pool",
"sceneElementId": "Landscape Design_Scene Elements_Natural Elements_Flower,Landscape Design_Scene Elements_Natural Elements_Ground Cover",
"modelType": "Base"
}'
Java (OkHttp)
import okhttp3.*;
import java.io.IOException;
public class LandscapingApiExample {
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/backyard.jpg",
"prompt": "lush modern garden with clean stone paths",
"sceneId": "Landscape Design_Landscape Style_Mid-Century Modern Pool",
"sceneElementId": "Landscape Design_Scene Elements_Natural Elements_Flower,Landscape Design_Scene Elements_Natural Elements_Ground Cover",
"modelType": "Base"
}
""";
Request request = new Request.Builder()
.url(BASE_URL + "/api/v1/landscaping/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/backyard.jpg",
"prompt": "lush modern garden with clean stone paths",
"sceneId": "Landscape Design_Landscape Style_Mid-Century Modern Pool",
"sceneElementId": "Landscape Design_Scene Elements_Natural Elements_Flower,Landscape Design_Scene Elements_Natural Elements_Ground Cover",
"modelType": "Base"
}
response = requests.post(
f"{BASE_URL}/api/v1/landscaping/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 createLandscapingTask() {
try {
const response = await axios.post(
`${BASE_URL}/api/v1/landscaping/generate`,
{
imageUrl: 'https://example.com/backyard.jpg',
prompt: 'lush modern garden with clean stone paths',
sceneId: 'Landscape Design_Landscape Style_Mid-Century Modern Pool',
sceneElementId: 'Landscape Design_Scene Elements_Natural Elements_Flower,Landscape Design_Scene Elements_Natural Elements_Ground Cover',
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);
}
}
createLandscapingTask();
📤 レスポンス#
{
"code": 0,
"message": "success",
"data": 1234567890123456789
}
2. タスク結果の取得#
エンドポイント
GET /api/v1/landscaping/result
リクエストヘッダー
| ヘッダー | 必須 | 説明 |
|---|---|---|
APIKEY | ✅ はい | API の認証キー |
クエリパラメーター
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
taskId | long | ✅ はい | 作成エンドポイントから返されたタスク ID |
📥 リクエスト例#
cURL
curl -X GET "https://api.ideal.house/api/v1/landscaping/result?taskId=1234567890123456789" \
-H "APIKEY: your_api_key_here"
Java (OkHttp)
import okhttp3.*;
import java.io.IOException;
public class LandscapingResultExample {
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/landscaping/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/landscaping/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 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 pollLandscapingResult(taskId) {
const headers = { APIKEY: API_KEY };
while (true) {
const response = await axios.get(
`${BASE_URL}/api/v1/landscaping/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 ended with status:', status);
}
break;
}
await new Promise(resolve => setTimeout(resolve, 3000));
}
}
pollLandscapingResult(1234567890123456789n);
📤 レスポンス例#
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Success",
"waitNumber": 0,
"percentage": 100,
"input": {
"imageUrl": "https://example.com/backyard.jpg",
"prompt": "lush modern garden with clean stone paths",
"sceneId": "Landscape Design_Landscape Style_Mid-Century Modern Pool",
"sceneElementId": "Landscape Design_Scene Elements_Natural Elements_Flower,Landscape Design_Scene Elements_Natural Elements_Ground Cover",
"modelType": "Base"
},
"output": {
"resultUrl": "https://cdn.ideal.house/output/landscaping_result.jpg",
"width": 1024,
"height": 1024
}
}
}
レスポンス(タスク処理中または待機中)
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Processing",
"waitNumber": 1,
"percentage": 45,
"input": {
"imageUrl": "https://example.com/backyard.jpg",
"modelType": "Base"
},
"output": null
}
}
レスポンス(タスク失敗)
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Failed",
"waitNumber": 0,
"percentage": 0,
"input": {
"imageUrl": "https://example.com/backyard.jpg",
"modelType": "Base"
},
"output": null
}
}
📊 タスクの状態#
| 状態 | 説明 |
|---|---|
Unprocessed | タスクが作成され、キューで待機しています |
Processing | タスクは現在実行中です |
Success | タスクが正常に完了しました |
Failed | タスクが失敗し、出力は生成されませんでした |
3-5 秒 ごとにポーリングしてください。API タスク制限を参照してください。
❌ エラーレスポンス#
| コード | 名前 | 説明 |
|---|---|---|
1011 | PARAM_ERROR | リクエストパラメーターのエラー |
5002 | API_KEY_INVALID | API キーが無効または未指定 |
9010 | SCAN_TEXT_ERROR | プロンプトがコンテンツ審査に通りませんでした |
9038 | PROHIBITED_CONTENT | 生成画像に禁止された内容が含まれています |
9051 | COINS_NOT_ENOUGH | クレジット不足 |
共通エラーの完全な定義は、エラーコードリファレンスを参照してください。