Request and Response Formats

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.

Request Format

Our API requests use POST method with multipart/form-data content to accommodate image file uploads and additional data.

curl --location --request POST 'https://api.vyro.ai/v2/image/generations' \
--header 'Authorization: Bearer vk-ad08a8e86d1a84404e5837be47d39ab44474f982671c0a' \
--form 'prompt="A futuristic cityscape at night with neon lights"' \
--form 'style="realistic"' \
--form 'aspect_ratio="1:1"'

Response Status Codes

When a request is successful, you will receive an image as output. Below are the status codes that you might encounter:

Status Code
Type
Description

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.

For comprehensive API reference details, please visit our API References.

Last updated