Request and Response Formats
Last updated
Last updated
Imagine API primarily uses JSON for data interchange to maximize compatibility with various programming languages. This guide focuses on the Generations service, which generates images from text prompts, and these principles apply to other API services as well.
Our API requests use method with multipart/form-data content to accommodate image file uploads and additional data.
When a request is successful, you will receive an image as output. Below are the status codes that you might encounter:
200
Success
The request completed successfully, and the image was generated as expected.
400
Bad Request
The request is malformed or incomplete.
401
Unauthorized
Authentication is required or failed.
429
Too Many Requests
Too many requests have been sent within a given timeframe.
500
Internal Server Error
An unexpected issue occurred.