Ideal House
Skip to content

Landscaping API Documentation#

Base URL: https://api.ideal.house
Version: v1
Updated: 2026-05-21


πŸ“– Overview#

The Landscaping API improves or redesigns outdoor landscape areas from a source image. It supports optional text guidance, garden style options, landscape elements, and model modes.

The workflow is asynchronous:

  1. Create a task β€” Submit imageUrl and optional parameters, then receive a taskId.
  2. Poll for results β€” Use taskId to retrieve task status and the generated image.

πŸ” Authentication#

HeaderValue
APIKEYyour_api_key_here

πŸ’° Credits Deduction#

[!WARNING] Credits are deducted when a task is successfully created. If the task ultimately fails, deducted credits will be automatically refunded.
Insufficient credits will return error code 9051. See Credits Deduction Reference.

Model (modelType)Credits Deducted
Flash1 credit
Base3 credits
Pro10 credits

If modelType is not provided, Base is used by default.


🎨 Style Options#

This API supports optional style parameters returned by the API Style Config endpoint.

Use:

Plain text
GET /api/v1/style/landscaping/getStyles
Style GroupRequest FieldDescription
gardenStylesceneIdGarden or landscape style option
elementssceneElementIdLandscape element option. Supports multiple option IDs joined by comma, for example id1,id2

Each option contains name, id, and url. Pass the option id into the corresponding request field.


πŸ“Œ API Endpoints#

1. Create Landscaping Task#

Endpoint

Plain text
POST /api/v1/landscaping/generate

Request Headers

HeaderRequiredDescription
APIKEYβœ… YesYour API authentication key
Content-Typeβœ… Yesapplication/json

Request Body

FieldTypeRequiredDescription
imageUrlstringβœ… YesURL of the source landscape image
promptstring❌ OptionalText guidance for the desired result
sceneIdstring❌ OptionalGarden style ID from gardenStyle style options
sceneElementIdstring❌ OptionalLandscape element ID from elements style options. Supports multiple IDs joined by comma, for example id1,id2
modelTypestring❌ OptionalEnum: Flash, Base, Pro. Defaults to Base

Only imageUrl is required. All other fields are optional.

πŸ–ΌοΈ Image requirements: All source and reference images must use JPG/JPEG, PNG, or WebP. Each image must be no larger than 20 MB, with dimensions from 128 Γ— 128 px up to 6,000 Γ— 6,000 px (inclusive). Images exceeding the maximum pixel dimensions are automatically scaled down proportionally to fit within 6,000 Γ— 6,000 px before processing. Image URLs must be directly accessible by the API server.

πŸ“₯ Request Examples#

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

πŸ“€ Response#

json
{
  "code": 0,
  "message": "success",
  "data": 1234567890123456789
}

2. Get Task Result#

Endpoint

Plain text
GET /api/v1/landscaping/result

Request Headers

HeaderRequiredDescription
APIKEYβœ… YesYour API authentication key

Query Parameters

ParameterTypeRequiredDescription
taskIdlongβœ… YesTask ID returned by the create endpoint

πŸ“₯ Request Examples#

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

πŸ“€ Response Example#

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

Response (Task Processing / In Queue)

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

Response (Task Failed)

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

πŸ“Š Task Status#

StatusDescription
UnprocessedTask has been created and is waiting in queue
ProcessingTask is currently running
SuccessTask completed successfully
FailedTask failed and no output was produced

Poll every 3-5 seconds. See API Task Limit.


❌ Error Responses#

CodeNameDescription
1011PARAM_ERRORRequest parameter error
5002API_KEY_INVALIDInvalid or missing API key
9010SCAN_TEXT_ERRORPrompt failed content review
9038PROHIBITED_CONTENTGenerated image contains prohibited content
9051COINS_NOT_ENOUGHInsufficient credits

For full common error definitions, see Error Code Reference.