# API Reference

### Background Generation contract

Below, you can see all possible options for the request body. See the [AI Background Options](https://docs.claid.ai/ai-background-api/ai-background-options) and [Image generation I/O](https://docs.claid.ai/image-generation-api/image-generation-i-o) sections to learn more about Background Generation options.

```json
{
  "output": {
    "destination": "storage://storage-name/path/"
    "number_of_images": 4,
    "format": "png" | "jpeg" | "webp" | "avif"
  },
  "object": {
    "image_url": "storage://storage-name/path/image.png",
    "placement_type": "absolute" | "original",
    "rotation_degree": 0,
    "scale": 1,
    "position": {
      "x": 0.5,
      "y": 0.5
    }
  },
  "scene": {
    "model": "v1" | "v2",
    "template_url": "storage://storage-name/path/template.png",
    "template_mode": "transform" | "adjust" | "lock",
    "color": "#aece8c",
    "view": "top" | "front",
    "prompt": "on the wooden table in the dark room" | 
      {
        "generate": true
      } |
      {
        "generate": true,
        "guidelines": "real life setting"
      },
    "negative_prompt": "watermark, low quality",
    "steps": 25,
    "aspect_ratio": "4:7" | "7:9" | "4:5" | "1:1" | "9:7" | "19:13" | "7:4" | "16:9" | "12:5",
    "preference": "fast" | "optimal" | "best"
  }
}
```

## Create Scene Api

> Specifies: \
> \- object to place on the scene and its properties (\`object\`)\
> \- scene properties (\`scene\`)\
> \- how many images will be created and where they will be stored (\`output\`)

```json
{"openapi":"3.1.0","info":{"title":"Claid REST API","version":"v1"},"tags":[{"name":"Image","description":"Encompasses operations with images."}],"security":[{"OAuth2PasswordBearer":["image_generation"]},{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}},"description":"To work with the Claid API, send requests over HTTPS and authenticate using the `Authorization` header in the following format:`Authorization: Bearer <YOUR_API_KEY>`. You do not need to provide a password.\n\nTo get your API key, [sign in to your Claid account](https://claid.ai/login) and click ***Create API key*** button from the ***Overview*** or ***API keys*** pages.\n\nClaid API’s base URL is `https://api.claid.ai/v1/`. All available endpoints are listed in the [Storage](#tag/Storage) and [Image](#tag/Image) sections. \n\n## Bearer\n\nThis API uses OAuth 2.0 [bearer token](https://datatracker.ietf.org/doc/html/rfc6750) (API key) to authorize requests."}},"schemas":{"SceneCreateAPIIn":{"title":"scene creation options","required":["object","scene"],"type":"object","properties":{"output":{"title":"Output URL","anyOf":[{"$ref":"#/components/schemas/SceneCreateAPIOutputIn"},{"type":"string","minLength":1,"maxLength":4096,"format":"uri"}],"description":"URL of the output images. If `output` is not defined, we store the output image on our bucket and return the temporary URL. Images are stored for one day.","default":{"number_of_images":4,"format":"png"}},"object":{"title":"Object manipulation","anyOf":[{"$ref":"#/components/schemas/SceneCreateAPIObjectAbsoluteIn"},{"$ref":"#/components/schemas/SceneCreateAPIObjectOriginalIn"},{"$ref":"#/components/schemas/SceneCreateAPIObjectPaddingIn"}],"description":"Manipulate object on the scene so that the output images meet your requirements."},"scene":{"title":"Scene customization","anyOf":[{"$ref":"#/components/schemas/SceneCreateAPISceneBackgroundEffectIn"},{"$ref":"#/components/schemas/SceneCreateAPIScenePromptIn"},{"$ref":"#/components/schemas/SceneCreateAPISceneTemplateIn"}],"description":"Customize the scene so that the output images meet your requirements."}},"additionalProperties":false},"SceneCreateAPIOutputIn":{"title":"Output customization","type":"object","properties":{"number_of_images":{"title":"Number of images","maximum":4,"minimum":1,"type":"integer","description":"Number of images to create. By default 4 images will be created.","default":4},"destination":{"title":"Output URL","maxLength":4096,"minLength":1,"type":"string","description":"URL of the output images. If `output` is not defined, we store the output image on our bucket and return the temporary URL. Images are stored for one day.","format":"uri"},"format":{"title":"Format","anyOf":[{"$ref":"#/components/schemas/FormatEnum"},{"$ref":"#/components/schemas/FormatJpegOptions"},{"$ref":"#/components/schemas/FormatPngOptions"},{"$ref":"#/components/schemas/FormatWebpOptions"},{"$ref":"#/components/schemas/FormatAvifOptions"}],"description":"Converts images to one of the following formats: `\"jpeg\"`, `\"png\"`, `\"webp\"`, `\"avif\"`. Selecting *Jpeg Options* allows to specify quality.","default":"png"}},"additionalProperties":false},"FormatEnum":{"title":"Format","enum":["jpeg","png","webp","avif","tiff"],"type":"string","description":"Converts the image into specified format. Examples: `\"jpeg\"`, `\"png\"`."},"FormatJpegOptions":{"title":"jpeg options","required":["type"],"type":"object","properties":{"type":{"title":"Type","enum":["jpeg"],"type":"string","description":"Must have value `\"jpeg\"`"},"quality":{"title":"Quality","maximum":100,"minimum":1,"type":"integer","default":85},"progressive":{"title":"Progressive","type":"boolean","description":"Progressive JPEG loads in a browser in successive waves until a clear picture is formed. This improves image's loading speed.","default":true}},"additionalProperties":false},"FormatPngOptions":{"title":"png options","required":["type"],"type":"object","properties":{"type":{"title":"Type","enum":["png"],"type":"string","description":"Must have value `\"png\"`"},"compression":{"allOf":[{"$ref":"#/components/schemas/FormatCompressionLevelEnum"}],"description":"Specifies compression effort that will be applied during the PNG image encoding. Should have one of values: `\"fast\"`, `\"best\"`, or `\"optimal\"`. Defaults to `\"optimal\"`.","default":"optimal"}},"additionalProperties":false},"FormatCompressionLevelEnum":{"title":"Compression","enum":["fast","best","optimal"],"type":"string","description":"Indicates compression effort. \n\n| Value | Description |\n| --- | --- |\n| `\"fast\"` |  Used to apply minimum compression resulting in a bigger image size but less processing time.|\n| `\"best\"` | Used to apply maximum compression resulting in a smaller image size but more processing time.|\n| `\"optimal\"` | DEFAULT. Used to balance between compression effort and the processing time.|\n"},"FormatWebpOptions":{"title":"webp options","required":["type"],"type":"object","properties":{"type":{"title":"Type","enum":["webp"],"type":"string","description":"Must have value `\"webp\"`"},"compression":{"title":"Compression","anyOf":[{"$ref":"#/components/schemas/WebpCompressionEnum"},{"$ref":"#/components/schemas/WebpLossyCompressionOptions"},{"$ref":"#/components/schemas/WebpLosslessCompressionOptions"}],"description":"The WEBP codec supports both lossless and lossy modes of operation, so you can select the one that is appropriate for your goals. Lossy compression allows you to reduce the size of the image significantly in exchange for some loss of data, reducing the quality of an image. You can specify the amount of loss you are willing to accept. By default it's set to to 75. Lossless compression allows you to save maximum image details in exchange for a significantly increased file size.","default":{"type":"lossy","quality":75}}},"additionalProperties":false},"WebpCompressionEnum":{"title":"WEBP Compression","enum":["lossy","lossless"],"type":"string","description":"Selects the WEBP compression type: \n\n| Value | Description |\n| --- | --- |\n| `\"lossy\"` | Lossy compression allows you to reduce the size of the image significantly in exchange for some loss of data, reducing the quality of an image.|\n| `\"lossless\"` | Lossless compression allows you to save maximum image details in exchange for a significantly increased file size.|\n"},"WebpLossyCompressionOptions":{"title":"WebpLossyCompressionOptions","required":["type"],"type":"object","properties":{"type":{"title":"Type","enum":["lossy"],"type":"string","description":"Must have value `\"lossy\"`"},"quality":{"title":"Quality","maximum":100,"minimum":1,"type":"integer","default":75}},"additionalProperties":false},"WebpLosslessCompressionOptions":{"title":"WebpLosslessCompressionOptions","required":["type"],"type":"object","properties":{"type":{"title":"Type","enum":["lossless"],"type":"string","description":"Must have value `\"lossless\"`"}},"additionalProperties":false},"FormatAvifOptions":{"title":"avif options","required":["type"],"type":"object","properties":{"type":{"title":"Type","enum":["avif"],"type":"string","description":"Must have value `\"avif\"`"},"compression":{"title":"Compression","anyOf":[{"$ref":"#/components/schemas/AvifCompressionEnum"},{"$ref":"#/components/schemas/AvifLossyCompressionOptions"},{"$ref":"#/components/schemas/AvifLosslessCompressionOptions"}],"description":"The AVIF codec supports both lossless and lossy modes of operation, so you can select the one that is appropriate for your goals. Lossy compression allows you to reduce the size of the image significantly in exchange for some loss of data, reducing the quality of an image. You can specify the amount of loss you are willing to accept. Lossless compression allows you to save maximum image details in exchange for a significantly increased file size.","default":{"type":"lossy","quality":50}}},"additionalProperties":false},"AvifCompressionEnum":{"title":"AVIF Compression","enum":["lossy","lossless"],"type":"string","description":"Selects the AVIF compression type: \n\n| Value | Description |\n| --- | --- |\n| `\"lossy\"` | Lossy compression allows you to reduce the size of the image significantly in exchange for some loss of data, reducing the quality of an image.|\n| `\"lossless\"` | Lossless compression allows you to save maximum image details in exchange for a significantly increased file size.|\n"},"AvifLossyCompressionOptions":{"title":"AvifLossyCompressionOptions","required":["type"],"type":"object","properties":{"type":{"title":"Type","enum":["lossy"],"type":"string","description":"Must have value `\"lossy\"`"},"quality":{"title":"Quality","maximum":100,"minimum":1,"type":"integer","default":50}},"additionalProperties":false},"AvifLosslessCompressionOptions":{"title":"AvifLosslessCompressionOptions","required":["type"],"type":"object","properties":{"type":{"title":"Type","enum":["lossless"],"type":"string","description":"Must have value `\"lossless\"`"}},"additionalProperties":false},"SceneCreateAPIObjectAbsoluteIn":{"title":"SceneCreateAPIObjectAbsoluteIn","required":["image_url"],"type":"object","properties":{"image_url":{"title":"Object image file URL","maxLength":4096,"minLength":1,"type":"string","description":"URL of the input image. Should be from 1 to 4096 characters. Image must be accessible by our system. For better results, the background of the image should be transparent.","format":"uri"},"placement_type":{"title":"Placement Type","enum":["absolute"],"type":"string","description":"`\"absolute\"` placement type allows to manually specify the absolute position, scale, and rotation degree of the object on a scene.","default":"absolute"},"rotation_degree":{"title":"Degree of object rotation","anyOf":[{"type":"number","minimum":0,"maximum":360},{"type":"integer","minimum":0,"maximum":360}],"description":"Degree of object rotation on the scene. By default, the object is not rotated. (i.e. 0.0).","default":0},"scale":{"title":"Relative object scale","anyOf":[{"type":"integer","minimum":0,"maximum":1},{"type":"number","minimum":0.01,"maximum":1}],"description":"Relative object scale in relation to the scene. By default, the object is scaled to the scene edges. (i.e. 1.0).","default":1},"position":{"title":"Relative object position","allOf":[{"$ref":"#/components/schemas/ObjectPosition"}],"description":"Relative object position on the scene. By default, the object is positioned at the center of the scene (i.e. x=0.5, y=0.5).","default":{"x":0.5,"y":0.5}}},"additionalProperties":false},"ObjectPosition":{"title":"ObjectPosition","type":"object","properties":{"x":{"title":"Horizontal position","maximum":1,"minimum":0,"type":"number","description":"Relative position on the scene, where 0 is the left edge of the image and 1 is the right edge of the image.","default":0.5},"y":{"title":"Vertical position","maximum":1,"minimum":0,"type":"number","description":"Relative position on the scene, where 0 is the bottom edge of the image and 1 is the top edge of the image.","default":0.5}},"additionalProperties":false},"SceneCreateAPIObjectOriginalIn":{"title":"SceneCreateAPIObjectOriginalIn","required":["image_url","placement_type"],"type":"object","properties":{"image_url":{"title":"Object image file URL","maxLength":4096,"minLength":1,"type":"string","description":"URL of the input image. Should be from 1 to 4096 characters. Image must be accessible by our system. For better results, the background of the image should be transparent.","format":"uri"},"placement_type":{"title":"Placement Type","enum":["original"],"type":"string","description":"`\"original\"` placement type instructs to use an object position and scale from the input image, meaning this placement method is fully automated and does not require any additional parameters."}},"additionalProperties":false},"SceneCreateAPIObjectPaddingIn":{"title":"SceneCreateAPIObjectPaddingIn","required":["image_url","placement_type","padding"],"type":"object","properties":{"image_url":{"title":"Object image file URL","maxLength":4096,"minLength":1,"type":"string","description":"URL of the input image. Should be from 1 to 4096 characters. Image must be accessible by our system. For better results, the background of the image should be transparent.","format":"uri"},"placement_type":{"title":"Placement Type","enum":["padding"],"type":"string","description":"`\"padding\"` placement type allows to add a space around the object equally to each of 4 sides, or for height&width separately."},"padding":{"title":"Padding around the object","type":"string","description":"Add a space around the object equally to each of 4 sides, or for height&width separately. Can not be bigger than half of image width/height."}},"additionalProperties":false},"SceneCreateAPISceneBackgroundEffectIn":{"title":"Scene background effect","required":["effect"],"type":"object","properties":{"model":{"title":"Scene creation model","allOf":[{"$ref":"#/components/schemas/SceneCreateModelEnum"}],"description":"Selects the scene creation model. By default, the model is 'v1'.","default":"v1"},"effect":{"$ref":"#/components/schemas/SceneEffectEnum"},"color":{"title":"Product background coloring","anyOf":[{"type":"string","title":"Color","description":"Color as a hexadecimal. Examples: `\"#ffffff\"`, `\"#000000\"`."},{"$ref":"#/components/schemas/ColorEnum"}],"description":"Color as a hexadecimal."},"view":{"title":"Product viewpoint","allOf":[{"$ref":"#/components/schemas/TemplateViewAutoEnum"}],"description":"The position of the viewpoint relative to the scene\n\n| Value | Description |\n| --- | --- |\n| `\"top\"` | The view is top-down, looking down on the scene from above.|\n| `\"front\"` | The view is horizontal, looking directly on the scene.|\n| `\"auto\"` | The view is automatically selected.|","default":"auto"},"aspect_ratio":{"title":"Scene aspect ratio","allOf":[{"$ref":"#/components/schemas/SceneAspectRatioEnum"}],"description":"Aspect ratio of the scene. By default, the aspect ratio is 1:1.","default":"1:1"}},"additionalProperties":false},"SceneCreateModelEnum":{"title":"SceneCreateModelEnum","enum":["v1","v2-beta","v2"],"type":"string","description":"An enumeration."},"SceneEffectEnum":{"title":"Additional scene effect","enum":["shadows"],"type":"string","description":"Selects the scene effect.\n\n| Value | Description |\n| --- | --- |\n| `\"shadows\"` | Apply shadow generation on the image.|\n"},"ColorEnum":{"title":"Transparent","enum":["transparent"],"type":"string","description":"Makes the background of the image transparent, only works for `\"png\"` output format."},"TemplateViewAutoEnum":{"title":"Template view direction","enum":["auto","top","front"],"type":"string","description":"Selects the template view direction.\n\n| Value | Description |\n| --- | --- |\n| `\"top\"` | The view is top-down, looking down on the scene from above.|\n| `\"front\"` | The view is horizontal, looking directly on the scene.|\n| `\"auto\"` | The view is automatically selected.|"},"SceneAspectRatioEnum":{"title":"SceneAspectRatioEnum","enum":["21:9","1:1","4:3","3:2","2:3","5:4","4:5","3:4","16:9","9:16"],"type":"string","description":"Aspect ratios supported by scene generation (both creative and high-precision modes)"},"SceneCreateAPIScenePromptIn":{"title":"Template-free scene","required":["prompt"],"type":"object","properties":{"model":{"title":"Scene creation model","allOf":[{"$ref":"#/components/schemas/SceneCreateModelEnum"}],"description":"Selects the scene creation model. By default, the model is 'v1'.","default":"v1"},"prompt":{"title":"Text prompt for scene creation","anyOf":[{"type":"string","minLength":3,"maxLength":2048},{"$ref":"#/components/schemas/ScenePromptAdvancedIn"}],"description":"Text prompt that will be used to create the scene. Should be from 3 to 2048 characters."},"negative_prompt":{"title":"Negative text prompt for scene creation","maxLength":2048,"minLength":3,"type":"string","description":"Text prompt that will exclude things from the scene. Should be from 3 to 2048 characters. "},"steps":{"title":"Number of inference steps","exclusiveMaximum":50,"minimum":1,"type":"integer","description":"The more inference steps you use, the better the results, but the more steps, the longer it takes to generate. If you want faster results, you can use fewer steps. If you want higher-quality results, you can use more steps. By default each `template_mode` has an optimal `steps` value."},"color":{"title":"Color","type":"string","description":"Color as a hexadecimal. Examples: `\"#ffffff\"`, `\"#000000\"`."},"aspect_ratio":{"title":"Scene aspect ratio","allOf":[{"$ref":"#/components/schemas/SceneAspectRatioEnum"}],"description":"Aspect ratio of the scene. By default, the aspect ratio is 1:1.","default":"1:1"},"preference":{"title":"Preference control","allOf":[{"$ref":"#/components/schemas/PreferenceEnum"}],"description":"Preference control allows you to balance between generation speed and output image quality. Higher speed decreases image quality but enables quicker experimentation to find the best parameters for your background.\n\n| Value | Description |\n| --- | --- |\n| `\"fast\"` | Faster generation, lower quality.|\n| `\"optimal\"` | Balance between speed and quality.|| `\"best\"` | Highest quality, slower generation.|","default":"optimal"}},"additionalProperties":false},"ScenePromptAdvancedIn":{"title":"ScenePromptAdvancedIn","type":"object","properties":{"text":{"title":"Text prompt for scene creation","maxLength":2048,"minLength":3,"type":"string","description":"Text prompt that will be used to create the scene. Should be from 3 to 2048 characters."},"generate":{"title":"Auto-generate prompt","type":"boolean","description":"If `true`, the prompt will be generated automatically based on the input image.By default, the prompt is not auto-generated. If `true`, the `text` is not allowed.","default":false},"guidelines":{"title":"Guidelines","maxLength":1000,"minLength":3,"type":"string","description":"Guidelines for prompt generation. Only available when `generate` is `true`."}},"additionalProperties":false},"PreferenceEnum":{"title":"Preference control","enum":["fast","optimal","best"],"type":"string","description":"Preference control allows you to balance between generation speed and output image quality. Higher speed decreases image quality but enables quicker experimentation to find the best parameters for your background.\n\n| Value | Description |\n| --- | --- |\n| `\"fast\"` | Faster generation, lower quality.|\n| `\"optimal\"` | Balance between speed and quality.|| `\"best\"` | Highest quality, slower generation.|"},"SceneCreateAPISceneTemplateIn":{"title":"Template-based scene","required":["template_url","view"],"type":"object","properties":{"model":{"title":"Scene creation model","allOf":[{"$ref":"#/components/schemas/SceneCreateModelEnum"}],"description":"Selects the scene creation model. By default, the model is 'v1'.","default":"v1"},"template_mode":{"title":"Template mode","allOf":[{"$ref":"#/components/schemas/TemplateModeEnum"}],"description":"Selects how closely the result should match the template.\n\n| Value | Description |\n| --- | --- |\n| `\"transform\"` | Template is transformed according to the prompt and color.|\n| `\"adjust\"` | Template is slightly adjusted to the product and prompt.|| `\"lock\"` | Template is preserved with maximum detail.|","default":"transform"},"template_url":{"title":"Template image file URL","maxLength":4096,"minLength":1,"type":"string","description":"URL of the input image. Should be from 1 to 4096 characters. Image must be accessible by our system. Is optional, if `prompt` is specified.","format":"uri"},"color":{"title":"Color","type":"string","description":"Color as a hexadecimal. Examples: `\"#ffffff\"`, `\"#000000\"`."},"view":{"title":"Template viewpoint","allOf":[{"$ref":"#/components/schemas/TemplateViewEnum"}],"description":"The position of the viewpoint relative to the scene\n\n| Value | Description |\n| --- | --- |\n| `\"top\"` | The view is top-down, looking down on the scene from above.|\n| `\"front\"` | The view is horizontal, looking directly on the scene.|"},"prompt":{"title":"Text prompt for scene creation","anyOf":[{"type":"string","minLength":3,"maxLength":2048},{"$ref":"#/components/schemas/ScenePromptAdvancedIn"}],"description":"Text prompt that will be used to create the scene. Should be from 3 to 2048 characters. "},"negative_prompt":{"title":"Negative text prompt for scene creation","maxLength":2048,"minLength":3,"type":"string","description":"Text prompt that will exclude things from the scene. Should be from 3 to 2048 characters. "},"steps":{"title":"Number of inference steps","exclusiveMaximum":50,"minimum":1,"type":"integer","description":"The more inference steps you use, the better the results, but the more steps, the longer it takes to generate. If you want faster results, you can use fewer steps. If you want higher-quality results, you can use more steps. By default each `template_mode` has an optimal `steps` value."}},"additionalProperties":false},"TemplateModeEnum":{"title":"Template mode","enum":["transform","lock","adjust"],"type":"string","description":"Selects how closely the result should match the template.\n\n| Value | Description |\n| --- | --- |\n| `\"transform\"` | Template is transformed according to the prompt and color.|\n| `\"adjust\"` | Template is slightly adjusted to the product and prompt.|| `\"lock\"` | Template is preserved with maximum detail.|"},"TemplateViewEnum":{"title":"Template view direction","enum":["top","front"],"type":"string","description":"Selects the template view direction.\n\n| Value | Description |\n| --- | --- |\n| `\"top\"` | The view is top-down, looking down on the scene from above.|\n| `\"front\"` | The view is horizontal, looking directly on the scene.|"},"Response_ScenePipelineResponseOut_":{"title":"Response[ScenePipelineResponseOut]","type":"object","properties":{"data":{"$ref":"#/components/schemas/ScenePipelineResponseOut"}},"description":"Wrapper for responses"},"ScenePipelineResponseOut":{"title":"ScenePipelineResponseOut","required":["input","output"],"type":"object","properties":{"input":{"$ref":"#/components/schemas/PipelineInputObject"},"output":{"title":"Output","type":"array","items":{"$ref":"#/components/schemas/PipelineOutputObject"}},"profiling":{"title":"Profiling","type":"object"}}},"PipelineInputObject":{"title":"PipelineInputObject","required":["ext","mps","mime","format","width","height"],"type":"object","properties":{"ext":{"title":"Ext","type":"string","description":"File extension. Can have values: `\"jpg\"`, `\"png\"`, `\"avif\"`"},"mps":{"title":"Mps","type":"number","description":"Megapixel count"},"mime":{"title":"Mime","type":"string","description":"MIME type (also known as ‘media type’)"},"format":{"title":"Format","type":"string","description":"File format. Can have values: `\"jpeg\"`, `\"png\"`, `\"avif\"`"},"width":{"title":"Width","type":"integer","description":"Image width in pixels"},"height":{"title":"Height","type":"integer","description":"Image height in pixels"}}},"PipelineOutputObject":{"title":"PipelineOutputObject","required":["ext","mps","mime","format","width","height"],"type":"object","properties":{"ext":{"title":"Ext","type":"string","description":"File extension. Can have values: `\"jpg\"`, `\"png\"`, `\"avif\"`"},"mps":{"title":"Mps","type":"number","description":"Megapixel count"},"mime":{"title":"Mime","type":"string","description":"MIME type (also known as ‘media type’)"},"format":{"title":"Format","type":"string","description":"File format. Can have values: `\"jpeg\"`, `\"png\"`, `\"avif\"`"},"width":{"title":"Width","type":"integer","description":"Image width in pixels"},"height":{"title":"Height","type":"integer","description":"Image height in pixels"},"tmp_url":{"title":"Tmp Url","type":"string","description":"Temporal URL of a processed image"},"object_key":{"title":"Object Key","type":"string","description":"Path to a processed image in a bucket"},"object_bucket":{"title":"Object Bucket","type":"string","description":"Bucket name"},"object_uri":{"title":"Object Uri","type":"string","description":"URI of a processed image in a bucket"},"claid_storage_uri":{"title":"Claid Storage Uri","type":"string","description":"URI of a processed image in a storage"}}},"HttpErrorDetails":{"title":"HttpErrorDetails","required":["error_code","error_type","error_message"],"type":"object","properties":{"error_code":{"title":"Error Code","type":"string"},"error_type":{"$ref":"#/components/schemas/ErrorType"},"error_message":{"title":"Error Message","type":"string"},"error_details":{"title":"Error Details","type":"object","default":{}}}},"ErrorType":{"title":"ErrorType","enum":["auth","dlvr","general","le","survey","storage","image","user_settings","user","validation","analytics","scene","billing","web","runtime_settings","animation","custom_models"],"type":"string","description":"An enumeration."}}},"paths":{"/v1/scene/create":{"post":{"tags":["Image"],"summary":"Create Scene Api","description":"Specifies: \n- object to place on the scene and its properties (`object`)\n- scene properties (`scene`)\n- how many images will be created and where they will be stored (`output`)","operationId":"create_scene_api_v1_scene_create_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SceneCreateAPIIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response_ScenePipelineResponseOut_"}}}},"401":{"description":"Authorization is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpErrorDetails"}}}},"402":{"description":"No API calls left.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpErrorDetails"}}}},"403":{"description":"Not enough permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpErrorDetails"}}}},"422":{"description":"Unprocessable Entity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpErrorDetails"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpErrorDetails"}}}}}}}}}
```

**Request**

{% tabs %}
{% tab title="HTTP" %}

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

{
  "object": {
    "image_url": "https://images.claid.ai/photoshoot-templates/docs/product.png",
    "rotation_degree": 0.0,
    "scale": 0.55,
    "position": {
      "x": 0.35,
      "y": 0.5
    }
  },
  "scene": {
    "template_url": "https://images.claid.ai/photoshoot-templates/docs/scene.png",
    "template_mode": "transform",
    "view": "front",
    "prompt": "marble countertop, marble wall background, monochromatic, bokeh, closeup, professional product photography"
  },
  "output": {
    "number_of_images": 1,
    "format": "png"
  }
}
```

{% endtab %}

{% tab title="cURL" %}

```shell
curl -X POST --location "https://api.claid.ai/v1/scene/create" --http1.1 \
    -H "Host: api.claid.ai" \
    -H "Authorization: Bearer {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -d "{
      \"object\": {
        \"image_url\": \"https://images.claid.ai/photoshoot-templates/docs/product.png\",
        \"rotation_degree\": 0.0,
        \"scale\": 0.55,
        \"position\": {
          \"x\": 0.35,
          \"y\": 0.5
        }
      },
      \"scene\": {
        \"template_url\": \"https://images.claid.ai/photoshoot-templates/docs/scene.png\",
        \"template_mode\": \"transform\",
        \"view\": \"front\",
        \"prompt\": \"marble countertop, marble wall background, monochromatic, bokeh, closeup, professional product photography\"
      },
      \"output\": {
        \"number_of_images\": 1,
        \"format\": \"png\"
      }
    }"
```

{% endtab %}
{% endtabs %}

#### **Read a response**

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

Image information is shown in the response:

| Parameter | Type    | Description                                                                |
| --------- | ------- | -------------------------------------------------------------------------- |
| 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**

```json
{
    "data": {
        "input": {
                "ext": "png",
		"mps": 1.817323,
		"mime": "image/png",
		"format": "PNG",
		"width": 773,
		"height": 2351
        },
        "output": [
            {
                "ext": "png",
                "mps": 1.048576,
                "mime": "image/png",
                "format": "PNG",
                "width": 1024,
                "height": 1024,
                "tmp_url": "https://dl.claid.ai/efca3eae-2eb5-4952-ae83-b300ce41ab90/4bede5530f994346a3ca52d4ae6631a0.png"
            },
            {
               "ext": "png",
                "mps": 1.048576,
                "mime": "image/png",
                "format": "PNG",
                "width": 1024,
                "height": 1024,
                "tmp_url": "https://dl.claid.ai/72226dad-8311-4927-9879-8bb4f3ca38c4/55ccc333e60e463d820e908c899348df.png"
            },
        ]
    }
}
```

#### Headers:

See the [Request Headers](https://docs.claid.ai/image-editing-api/api-reference#request-headers) and [Response Headers](https://docs.claid.ai/image-editing-api/api-reference#response-headers) to learn about headers.
