Skip to navigation

View an image or image region

View as Markdown

Look at an uploaded image file so you can describe, compare, or answer questions about its content. Only works on image files the platform has finished processing, which list_files reports with an image_processing_status of completed. Select the user’s Frame N with frame_index=N-1. The default index 0 selects Frame 1.

With no region it shows the whole image, downscaled to fit. To zoom in, pass a region in the original image’s pixel coordinates: x and y are its top-left corner, and width and height default to the rest of the image. Smaller regions are shown at higher resolution, up to the original pixels.

Returns the view as a webp, which the X-Image-View response header describes.

Requires an API key with the read scope.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

file_idstringRequired

Query parameters

xintegerOptionalDefaults to 0
yintegerOptionalDefaults to 0
widthinteger or nullOptional
heightinteger or nullOptional
frame_indexintegerOptional>=0Defaults to 0

Response headers

X-Image-ViewstringOptional

A JSON object describing the view. image_size is the original image’s width and height, region is the part shown in those pixel coordinates, and size is the width and height of the webp.

Response

The view as a webp

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
500
Internal Server Error
502
Bad Gateway Error