> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Claid.ai API reference

> API reference for the Claid.ai plugin in Corsair: every `claidai.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Background Generate

### backgroundGenerate

`backgroundGenerate`

Generate an AI background for an image.

**Risk:** `write`

```ts theme={null}
await corsair.claidai.api.backgroundGenerate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `object` | `object` | Yes | Product object to place on the scene |
| `scene` | `object` | Yes | Scene settings |
| `output` | `object` | No | Output settings |

> [accordion] object full type
>
> ```ts theme={null}
> {
>   image_url: string,
>   placement_type?: absolute | original,
>   rotation_degree?: number,
>   scale?: number,
>   position?: {
>     x: number,
>     y: number
>   }
> }
> ```

> [accordion] scene full type
>
> ```ts theme={null}
> {
>   prompt?: string | {
>     generate: boolean,
>     guidelines?: string
>   },
>   negative_prompt?: string,
>   model?: v1 | v2,
>   template_url?: string,
>   template_mode?: transform | adjust | lock,
>   color?: string,
>   view?: top | front,
>   aspect_ratio?: string,
>   preference?: fast | optimal | best
> }
> ```

> [accordion] output full type
>
> ```ts theme={null}
> {
>   destination?: string,
>   number_of_images?: number,
>   format?: png | jpeg | webp | avif
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   input?: Record<string, JsonValue>,
>   output?: {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   }[]
> }
> ```

***

## Background Remove

### backgroundRemove

`backgroundRemove`

Remove the background from an image using Claid.ai.

**Risk:** `write`

```ts theme={null}
await corsair.claidai.api.backgroundRemove({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `input` | `string` | Yes | Image URL or storage URI of the input image |
| `color` | `string` | No | Background color, for example "#ffffff" or "transparent" |
| `output` | `string \| object` | No | Output destination: a storage URI or an output settings object |

> [accordion] output full type
>
> ```ts theme={null}
> string | {
>   destination?: string,
>   format?: jpeg | png | webp | avif | tiff
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   input?: {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   },
>   output?: {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   } | {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   }[]
> }
> ```

***

## Create Storage

### createStorage

`createStorage`

Create a Claid.ai storage connection.

**Risk:** `write`

```ts theme={null}
await corsair.claidai.api.createStorage({});
```

**Input:** `object`

> [accordion] Input full type
>
> ```ts theme={null}
> {
>   name: string,
>   type: s3,
>   parameters: {
>     path?: string,
>     bucket: string,
>     credentials: {
>       access_key: string,
>       secret_access_key: string
>     }
>   }
> } | {
>   name: string,
>   type: gcs,
>   parameters: {
>     path?: string,
>     bucket: string,
>     credentials: {
>       access_key: string,
>       secret_access_key: string
>     }
>   }
> } | {
>   name: string,
>   type: web_folder,
>   parameters: {
>     base_url: string
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: number,
>   name: string,
>   type: web_folder | s3 | gcs,
>   parameters: {
>     path?: string,
>     bucket: string,
>     credentials?: {
>       access_key: string
>     }
>   } | {
>     base_url: string
>   },
>   created_at: string
> }
> ```

***

## Delete Storage

### deleteStorage

`deleteStorage`

Delete a Claid.ai storage connection.

**Risk:** `write`

```ts theme={null}
await corsair.claidai.api.deleteStorage({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `storage_id` | `number` | Yes | Storage ID |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `JsonValue` | No | Deletion result |

***

## Generative Resize

### generativeResize

`generativeResize`

Resize an image using generative expansion.

**Risk:** `write`

```ts theme={null}
await corsair.claidai.api.generativeResize({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `input` | `string` | Yes | Image URL or storage URI of the input image |
| `width` | `number \| string` | Yes | Target width |
| `height` | `number \| string` | Yes | Target height |
| `feathering` | `string` | No | Transition smoothness, for example "20%" |
| `output` | `string \| object` | No | Output destination: a storage URI or an output settings object |

> [accordion] output full type
>
> ```ts theme={null}
> string | {
>   destination?: string,
>   format?: jpeg | png | webp | avif | tiff
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   input?: {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   },
>   output?: {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   } | {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   }[]
> }
> ```

***

## Image Ai Edit

### imageAiEdit

`imageAiEdit`

Submit an AI image editing task.

**Risk:** `write`

```ts theme={null}
await corsair.claidai.api.imageAiEdit({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `input` | `string` | Yes | Image URL or storage URI of the input image |
| `options` | `object` | Yes | AI edit options |
| `output` | `object` | No | Output settings |

> [accordion] options full type
>
> ```ts theme={null}
> {
>   prompt: string,
>   model?: v1 | v2,
>   inference_steps?: number,
>   guidance_scale?: number,
>   aspect_ratio?: string
> }
> ```

> [accordion] output full type
>
> ```ts theme={null}
> {
>   destination?: string,
>   format?: png | jpeg,
>   number_of_images?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: number,
>   status: string,
>   result_url?: string,
>   created_at?: string,
>   request?: Record<string, JsonValue>,
>   errors?: {
>     error: string,
>     created_at?: string | number
>   }[],
>   result?: {
>     input_object?: {
>       ext?: string | null,
>       mps?: number | null,
>       mime?: string | null,
>       format?: string | null,
>       width?: number | null,
>       height?: number | null,
>       tmp_url?: string | null,
>       object_key?: string | null,
>       object_bucket?: string | null,
>       object_uri?: string | null,
>       claid_storage_uri?: string | null
>     },
>     output_object?: {
>       ext?: string | null,
>       mps?: number | null,
>       mime?: string | null,
>       format?: string | null,
>       width?: number | null,
>       height?: number | null,
>       tmp_url?: string | null,
>       object_key?: string | null,
>       object_bucket?: string | null,
>       object_uri?: string | null,
>       claid_storage_uri?: string | null
>     },
>     output_objects?: {
>       ext?: string | null,
>       mps?: number | null,
>       mime?: string | null,
>       format?: string | null,
>       width?: number | null,
>       height?: number | null,
>       tmp_url?: string | null,
>       object_key?: string | null,
>       object_bucket?: string | null,
>       object_uri?: string | null,
>       claid_storage_uri?: string | null
>     }[]
>   },
>   results?: {
>     input_object?: {
>       ext?: string | null,
>       mps?: number | null,
>       mime?: string | null,
>       format?: string | null,
>       width?: number | null,
>       height?: number | null,
>       tmp_url?: string | null,
>       object_key?: string | null,
>       object_bucket?: string | null,
>       object_uri?: string | null,
>       claid_storage_uri?: string | null
>     },
>     output_object?: {
>       ext?: string | null,
>       mps?: number | null,
>       mime?: string | null,
>       format?: string | null,
>       width?: number | null,
>       height?: number | null,
>       tmp_url?: string | null,
>       object_key?: string | null,
>       object_bucket?: string | null,
>       object_uri?: string | null,
>       claid_storage_uri?: string | null
>     },
>     output_objects?: {
>       ext?: string | null,
>       mps?: number | null,
>       mime?: string | null,
>       format?: string | null,
>       width?: number | null,
>       height?: number | null,
>       tmp_url?: string | null,
>       object_key?: string | null,
>       object_bucket?: string | null,
>       object_uri?: string | null,
>       claid_storage_uri?: string | null
>     }[]
>   }[]
> }
> ```

***

## Image Edit Batch

### imageEditBatch

`imageEditBatch`

Process multiple images using Claid.ai.

**Risk:** `write`

```ts theme={null}
await corsair.claidai.api.imageEditBatch({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `input` | `string \| string[] \| object` | Yes | Storage folder URI, list of image URLs, or a source object |
| `operations` | `Record<string, JsonValue>` | Yes | Image editing operations, for example \{ resizing: \{ width: 1000 } } |
| `output` | `string \| object` | No | Output destination: a storage URI or an output settings object |

> [accordion] input full type
>
> ```ts theme={null}
> string | string[] | {
>   source: string,
>   recursive?: boolean
> }
> ```

> [accordion] output full type
>
> ```ts theme={null}
> string | {
>   destination?: string,
>   format?: jpeg | png | webp | avif | tiff
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: number,
>   status: string,
>   result_url?: string,
>   created_at?: string,
>   request?: Record<string, JsonValue>,
>   errors?: {
>     error: string,
>     created_at?: string | number
>   }[],
>   result?: {
>     input_object?: {
>       ext?: string | null,
>       mps?: number | null,
>       mime?: string | null,
>       format?: string | null,
>       width?: number | null,
>       height?: number | null,
>       tmp_url?: string | null,
>       object_key?: string | null,
>       object_bucket?: string | null,
>       object_uri?: string | null,
>       claid_storage_uri?: string | null
>     },
>     output_object?: {
>       ext?: string | null,
>       mps?: number | null,
>       mime?: string | null,
>       format?: string | null,
>       width?: number | null,
>       height?: number | null,
>       tmp_url?: string | null,
>       object_key?: string | null,
>       object_bucket?: string | null,
>       object_uri?: string | null,
>       claid_storage_uri?: string | null
>     },
>     output_objects?: {
>       ext?: string | null,
>       mps?: number | null,
>       mime?: string | null,
>       format?: string | null,
>       width?: number | null,
>       height?: number | null,
>       tmp_url?: string | null,
>       object_key?: string | null,
>       object_bucket?: string | null,
>       object_uri?: string | null,
>       claid_storage_uri?: string | null
>     }[]
>   },
>   results?: {
>     input_object?: {
>       ext?: string | null,
>       mps?: number | null,
>       mime?: string | null,
>       format?: string | null,
>       width?: number | null,
>       height?: number | null,
>       tmp_url?: string | null,
>       object_key?: string | null,
>       object_bucket?: string | null,
>       object_uri?: string | null,
>       claid_storage_uri?: string | null
>     },
>     output_object?: {
>       ext?: string | null,
>       mps?: number | null,
>       mime?: string | null,
>       format?: string | null,
>       width?: number | null,
>       height?: number | null,
>       tmp_url?: string | null,
>       object_key?: string | null,
>       object_bucket?: string | null,
>       object_uri?: string | null,
>       claid_storage_uri?: string | null
>     },
>     output_objects?: {
>       ext?: string | null,
>       mps?: number | null,
>       mime?: string | null,
>       format?: string | null,
>       width?: number | null,
>       height?: number | null,
>       tmp_url?: string | null,
>       object_key?: string | null,
>       object_bucket?: string | null,
>       object_uri?: string | null,
>       claid_storage_uri?: string | null
>     }[]
>   }[]
> }
> ```

***

## Image Generate

### imageGenerate

`imageGenerate`

Generate an image using Claid.ai.

**Risk:** `write`

```ts theme={null}
await corsair.claidai.api.imageGenerate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `input` | `string` | Yes | Text prompt |
| `options` | `object` | No | Generation options |
| `output` | `string` | No | Storage folder URI for results |

> [accordion] options full type
>
> ```ts theme={null}
> {
>   number_of_images?: number,
>   guidance_scale?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   input?: Record<string, JsonValue>,
>   output?: {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   }[]
> }
> ```

***

## License Plate Blur

### licensePlateBlur

`licensePlateBlur`

Detect and blur license plates in an image.

**Risk:** `write`

```ts theme={null}
await corsair.claidai.api.licensePlateBlur({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `input` | `string` | Yes | Image URL or storage URI of the input image |
| `output` | `string \| object` | No | Output destination: a storage URI or an output settings object |

> [accordion] output full type
>
> ```ts theme={null}
> string | {
>   destination?: string,
>   format?: jpeg | png | webp | avif | tiff
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   input?: {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   },
>   output?: {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   } | {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   }[]
> }
> ```

***

## Patch Storage

### patchStorage

`patchStorage`

Update a Claid.ai storage connection.

**Risk:** `write`

```ts theme={null}
await corsair.claidai.api.patchStorage({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `storage_id` | `number` | Yes | Storage ID |
| `name` | `string` | No | Storage name |
| `type` | `web_folder \| s3 \| gcs` | No | Storage connector type |
| `parameters` | `object` | No | Storage connection parameters to update |

> [accordion] parameters full type
>
> ```ts theme={null}
> {
>   base_url: string
> } | {
>   path?: string,
>   bucket?: string,
>   credentials?: {
>     access_key?: string,
>     secret_access_key?: string
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: number,
>   name: string,
>   type: web_folder | s3 | gcs,
>   parameters: {
>     path?: string,
>     bucket: string,
>     credentials?: {
>       access_key: string
>     }
>   } | {
>     base_url: string
>   },
>   created_at: string
> }
> ```

***

## Polish Image

### polishImage

`polishImage`

Polish and restore an image.

**Risk:** `write`

```ts theme={null}
await corsair.claidai.api.polishImage({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `input` | `string` | Yes | Image URL or storage URI of the input image |
| `output` | `string \| object` | No | Output destination: a storage URI or an output settings object |

> [accordion] output full type
>
> ```ts theme={null}
> string | {
>   destination?: string,
>   format?: jpeg | png | webp | avif | tiff
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   input?: {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   },
>   output?: {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   } | {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   }[]
> }
> ```

***

## Smart Frame

### smartFrame

`smartFrame`

Place an image inside a smart frame.

**Risk:** `write`

```ts theme={null}
await corsair.claidai.api.smartFrame({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `input` | `string` | Yes | Image URL or storage URI of the input image |
| `width` | `number \| string` | Yes | Canvas width |
| `height` | `number \| string` | Yes | Canvas height |
| `padding` | `string` | No | Space around the object, for example "10%" or "30px" |
| `background_color` | `string` | No | Canvas color, for example "#ffffff" |
| `output` | `string \| object` | No | Output destination: a storage URI or an output settings object |

> [accordion] output full type
>
> ```ts theme={null}
> string | {
>   destination?: string,
>   format?: jpeg | png | webp | avif | tiff
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   input?: {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   },
>   output?: {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   } | {
>     ext?: string | null,
>     mps?: number | null,
>     mime?: string | null,
>     format?: string | null,
>     width?: number | null,
>     height?: number | null,
>     tmp_url?: string | null,
>     object_key?: string | null,
>     object_bucket?: string | null,
>     object_uri?: string | null,
>     claid_storage_uri?: string | null
>   }[]
> }
> ```

***

## Storage Details

### storageDetails

`storageDetails`

Get details of a Claid.ai storage connection.

**Risk:** `read`

```ts theme={null}
await corsair.claidai.api.storageDetails({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `storage_id` | `number` | Yes | Storage ID |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: number,
>   name: string,
>   type: web_folder | s3 | gcs,
>   parameters: {
>     path?: string,
>     bucket: string,
>     credentials?: {
>       access_key: string
>     }
>   } | {
>     base_url: string
>   },
>   created_at: string
> }
> ```

***

## Storage List

### storageList

`storageList`

List Claid.ai storage connections.

**Risk:** `read`

```ts theme={null}
await corsair.claidai.api.storageList({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: number,
>   name: string,
>   type: web_folder | s3 | gcs,
>   parameters: {
>     path?: string,
>     bucket: string,
>     credentials?: {
>       access_key: string
>     }
>   } | {
>     base_url: string
>   },
>   created_at: string
> }[]
> ```

***

## Storage Types

### storageTypes

`storageTypes`

List supported Claid.ai storage types.

**Risk:** `read`

```ts theme={null}
await corsair.claidai.api.storageTypes({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `(web_folder \| s3 \| gcs)[]` | Yes | — |

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.