Imagine API Reference
  1. E-Commerce
Imagine API Reference
  • Imagine API References
  • Image Generation
    • Text to Image API
      POST
    • Text to PNG API
      POST
  • Image Editing
    • Background Remover API
      POST
    • Image Upscale API
      POST
    • Generative Fill API
      POST
    • AI Resize API
      POST
    • Retouch API
      POST
  • E-Commerce
    • AI Backgrounds API
      POST
  • Video Generation
    • Text to Video API
      POST
    • Image to Video API
      POST
    • Status by ID
      GET
    • (Deprecated) Status by ID
      GET
    • Delete by ID
      DELETE
    • (Deprecated) Delete by ID
      DELETE
  1. E-Commerce

AI Backgrounds API

POST
/image/generations/ai-background
The AI Background API allows users to add AI-generated backgrounds to transparent images. By providing a descriptive prompt and style preferences, the API generates a contextually appropriate background, making it ideal for product photos, marketing materials, and creative projects.

Request

Header Params
Authorization
string 
required
A bearer token that authenticates the user for making the request.
Example:
Bearer {{API Token}}
Body Params multipart/form-data
prompt
string 
required
A descriptive text that guides the AI in generating the desired background.
Example:
A lush green forest with sunlight filtering through the trees
image
file 
required
The transparent image file to which the background will be added.
style
enum<string> 
optional
Specifies the style of the background.
Allowed value:
product-shoot
Default:
product-shoot
Example:
product-shoot
seed
integer 
optional
The seed parameter serves as the initial value for the random number generator. By setting a specific seed value, you can ensure that the AI generates the same image or outcome each time you use that exact seed.
>= 1
Example:
12

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.vyro.ai/v2/image/generations/ai-background' \
--header 'Authorization: Bearer vk-ad08a8e86d1a84404e5837be47d39ab44474f982671c0a' \
--form 'prompt="A lush green forest with sunlight filtering through the trees"' \
--form 'image=@""' \
--form 'style="product-shoot"' \
--form 'seed="12"'

Responses

🟢200Success
application/octet-stream
Body
object {0}
Example
The response for 200 code is bytes.
🟠400Bad Request
🔴500Internal Server Error
🔴503Service Unavailable
Modified at 2024-12-18 11:59:28
Previous
Retouch API
Next
Text to Video API