---
title: "Preview URL (Direct Image)"
method: GET
path: "/api/v1/thumbnails/preview"
tags: ["thumbnails"]
---

# Preview URL (Direct Image)

`GET /api/v1/thumbnails/preview`

## Request

- Base URL: `https://docs.thedrive.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.thedrive.ai/api/v1/thumbnails/preview`
- Auth: none declared

Generate and return a thumbnail image directly from a URL.

**Usage**: Perfect for embedding in `<img>` tags or direct browser access.

```html
<img src="https://dev.thedrive.ai/api/v1/thumbnails/preview?url=https://example.com/doc.pdf" />
```

**Parameters**:
- `url`: The URL of the file to generate a thumbnail from (required)
- `width`, `height`: Max dimensions (default 600x400)
- `quality`: JPEG quality 1-100 (default 95)

**Returns**: Raw JPEG image bytes with `Content-Type: image/jpeg`

## Query parameters

- `url` string, required
- `width` integer
- `height` integer
- `quality` integer
- `nocache` boolean

## Headers

- `X-API-Key` string

## Response `200`

Thumbnail image

- unknown

## Other responses

- `400`: Invalid request
- `413`: File too large
- `415`: Unsupported file type
- `422`: Validation Error

---

[API](https://skmtc.dev/thedrive/apis/the-drive-ai-api.md) · [All operations](https://skmtc.dev/thedrive/apis/the-drive-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/thedrive/apis/the-drive-ai-api/revisions/ee4e32647ebf?raw)
