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

# Upload Images

> Upload images to be used in presentation generation. Returns image IDs that can be referenced in subsequent requests.

**Limits:** Max 10 images per request, 10MB per file. Supported formats: PNG, JPEG, WebP, GIF, AVIF, SVG.

Upload images for use in presentation generation. This is a synchronous operation that returns image IDs (UUIDs) immediately. These can be passed via `image_ids` in subsequent generation requests.

## Limits

* **Max file size:** 10MB per image
* **Max images:** 10 per request
* **Supported formats:** PNG, JPEG, WebP, GIF, AVIF, SVG

***

## Request

Send images as `multipart/form-data` with field name `files`.

### curl

```bash theme={null}
curl -X POST "https://slides-api.getalai.com/api/v1/upload-images" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "files=@/path/to/image1.png" \
  -F "files=@/path/to/image2.jpg"
```

### Python

```python theme={null}
import requests

url = "https://slides-api.getalai.com/api/v1/upload-images"
headers = {"Authorization": "Bearer YOUR_API_KEY"}

files = [
    ("files", ("image1.png", open("image1.png", "rb"), "image/png")),
    ("files", ("image2.jpg", open("image2.jpg", "rb"), "image/jpeg")),
]

response = requests.post(url, headers=headers, files=files)
print(response.json())
```

### JavaScript

```javascript theme={null}
const formData = new FormData();
formData.append('files', file1);
formData.append('files', file2);

const response = await fetch('https://slides-api.getalai.com/api/v1/upload-images', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
  body: formData
});

const data = await response.json();
console.log(data.image_ids);
```

***

## Response

```json theme={null}
{
  "image_ids": [
    "123e4567-e89b-12d3-a456-426614174000",
    "987fcdeb-51a2-3c4d-e5f6-789012345678"
  ]
}
```

***

## Error Responses

| Status | Description                       |
| ------ | --------------------------------- |
| 400    | File too large or too many images |
| 401    | Invalid or missing API key        |
| 415    | Unsupported file type             |


## OpenAPI

````yaml POST /api/v1/upload-images
openapi: 3.1.0
info:
  title: Alai API
  description: API endpoints for programmatic access to Alai presentation generation
  version: 1.0.0
servers:
  - url: https://slides-api.getalai.com
security:
  - BearerAuth: []
paths:
  /api/v1/upload-images:
    post:
      tags:
        - External API
      summary: Upload images for use in presentations
      description: >-
        Upload images to be used in presentation generation. Returns image IDs
        that can be referenced in subsequent requests.


        **Limits:** Max 10 images per request, 10MB per file. Supported formats:
        PNG, JPEG, WebP, GIF, AVIF, SVG.
      operationId: upload_images_api_v1_upload_images_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_upload_images_api_v1_upload_images_post
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Body_upload_images_api_v1_upload_images_post:
      properties:
        files:
          items:
            type: string
            format: binary
          type: array
          title: Files
      type: object
      required:
        - files
      title: Body_upload_images_api_v1_upload_images_post
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Your Alai API key. Get one from your account settings at app.getalai.com

````