API Reference

request and response description

AI Photoshoot contract

Below, you can see all possible options for the request body. See the AI Photoshoot Options and AI Photoshoot I/O sections to learn more about AI Photoshoot options.

{
  "output": {
    "destination": "storage://storage-name/path/"
    "number_of_images": 4,
    "format": "png"
  },
  "object": {
    "image_url": "storage://storage-name/path/image.jpg",
    "placement_type": "absolute" | "original",
    "rotation_degree": 0,
    "scale": 1,
    "position": {
      "x": 0.5,
      "y": 0.5
    }
  },
  "scene": {
    "template_url": "storage://storage-name/path/template.jpeg",
    "template_mode": "transform",
    "color": "#aece8c",
    "view": "top",
    "prompt": "on the wooden table in the dark room",
    "negative_prompt": "watermark, low quality"
  }
}

Request

POST /v1-ea/scene/create HTTP/1.1
Host: api.claid.ai
Authorization: Bearer {YOUR_API_KEY}
Content-Type: application/json

{
  "output": "storage://storage-name/path/",
  "object": {
    "image_url": "storage://storage-name/path/image.jpg",
    "placement_type": "absolute",
    "scale": 0.4
  },
  "scene": {
    "prompt": "on the wooden table in the dark room"
  }
}

Read a response

Once you have made the request to https://api.claid.ai/v1-ea/scene/create you will get a response with information about input text and output images.

Image information is shown in the response:

ParameterTypeDescription

ext

string

File extension. Will have png value

mps

integer

Megapixel count

mime

string

MIME type (also known as ‘media type’)

width

integer

Image width in pixels

height

integer

Image height in pixels

format

string

File format. Will have png value

tmp_url

string

Temporary URL of a processed image. Will be empty if output is specified

Response body

{
    "data": {
        "input": {
            "ext": "png",
            "mps": 0.375,
            "mime": "image/png",
            "format": "PNG",
            "width": 500,
            "height": 750
        },
        "output": [
            {
                "ext": "png",
                "mps": 1.048576,
                "mime": "image/png",
                "format": "PNG",
                "width": 1024,
                "height": 1024,
                "tmp_url": "https://storage.googleapis.com/production-leapi-tmp-public/733a7c8f-1fea-4097-8fd4-17f54c94d998/eyXNp9_1.png"
            },
            {
               "ext": "png",
                "mps": 1.048576,
                "mime": "image/png",
                "format": "PNG",
                "width": 1024,
                "height": 1024,
                "tmp_url": "https://storage.googleapis.com/production-leapi-tmp-public/733a7c8f-1fea-4097-8fd4-17f54c94d998/eyXNp9_2.png"
            },
        ]
    }
}

Headers:

See the Request Headers and Response Headers to learn about headers.

Last updated