Docs

API Documentation

API Error Code Reference

Base URL: https://api.ideal.house
Version: v1
Updated: 2026-03-06


๐Ÿ“– Overview

All API responses follow a unified JSON structure. When an error occurs, the code field will contain a non-zero error code, and the message field will provide a human-readable description of the error.

Unified Response Format

{
  "code": 1001,
  "message": "Request failed",
  "data": null
}
FieldTypeDescription
codeinteger0 = success; any other value indicates an error
messagestringHuman-readable error description
dataanyResponse payload; null on error

โœ… Success Code

CodeNameDescription
0SUCCESSRequest succeeded

Example

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

โŒ Error Codes

๐Ÿ”ง General Errors

CodeNameDescriptionSuggested Action
1001FAILEDRequest failed (generic error)Check the message field for specific details
1003INTERNAL_ERRORInternal server errorRetry the request after a short delay; contact support if it persists
1011PARAM_ERRORRequest parameter errorVerify all required parameters are provided and correctly formatted

๐Ÿ” Authentication Errors

CodeNameDescriptionSuggested Action
5002API_KEY_INVALIDInvalid or missing API KeyEnsure the APIKEY header is included and the value is correct

๐Ÿ›ก๏ธ Content Moderation Errors

CodeNameDescriptionSuggested Action
9010SCAN_TEXT_ERRORText prompt failed content review โ€” contains prohibited contentModify the prompt to remove any sensitive or illegal content
9038PROHIBITED_CONTENTGenerated output image contains prohibited contentAdjust prompt/style/inputs and retry

๐Ÿ’ฐ Credits Errors

CodeNameDescriptionSuggested Action
9051COINS_NOT_ENOUGHInsufficient coins / creditsTop up your account credits and retry

๐Ÿ“‹ Complete Error Code Summary

CodeNameDescription
0SUCCESSRequest succeeded
1001FAILEDRequest failed (generic)
1003INTERNAL_ERRORInternal server error
1011PARAM_ERRORRequest parameter error
5002API_KEY_INVALIDInvalid API Key
9010SCAN_TEXT_ERRORText prompt contains prohibited content
9038PROHIBITED_CONTENTGenerated output image contains prohibited content
9051COINS_NOT_ENOUGHInsufficient coins / credits

๐Ÿ“ฆ Error Response Examples

1001 โ€” Request Failed

{
  "code": 1001,
  "message": "Request failed",
  "data": null
}

1003 โ€” Internal Server Error

{
  "code": 1003,
  "message": "Internal server error",
  "data": null
}

1011 โ€” Parameter Error

{
  "code": 1011,
  "message": "Request parameter error: imageUrl is required",
  "data": null
}

5002 โ€” Invalid API Key

{
  "code": 5002,
  "message": "Invalid API Key",
  "data": null
}

9010 โ€” Text Content Moderation Failed

{
  "code": 9010,
  "message": "Text prompt failed content review, contains prohibited content",
  "data": null
}

9038 โ€” Output Prohibited Content

{
  "code": 9038,
  "message": "Prohibited content",
  "data": null
}

9051 โ€” Insufficient Credits

{
  "code": 9051,
  "message": "Insufficient coins",
  "data": null
}

๐Ÿ’ก Best Practices for Error Handling

  1. Always check code โ€” Do not rely solely on HTTP status codes; always inspect the code field in the response body.
  2. Handle 1001 dynamically โ€” This is a generic error code; the message field will contain the specific reason.
  3. Retry on 1003 โ€” Server-side errors are usually transient; implement exponential backoff retry logic.
  4. Validate inputs before sending โ€” Avoid 1011 errors by validating required fields client-side before making the API call.
  5. Content moderation โ€” If you receive 9010 or 9038, review your content against the platform's Content Policy before resubmitting.

ยฉ Ideal House AI โ€” All rights reserved.