Skip to main content
Vision-capable models like gpt-4o can analyze images you pass directly inside the messages array of a standard chat completions request. You send images the same way you send text — by including them as content objects within a user message — and the model returns a natural-language description, answer, or analysis. Both public web URLs and base64-encoded data URIs are supported, so you can reference hosted images or embed raw image data without any separate upload step.

Request

Endpoint: POST https://kiosapi.com/v1/chat/completions

Headers

Request Body

string
required
A vision-capable model ID, e.g. gpt-4o. Not all models support image input — check the model’s documentation before sending image content.
array
required
An array of message objects. For vision requests, include at least one user message whose content is an array of text and image objects.
number
The maximum number of tokens to generate in the response.
number
Sampling temperature between 0 and 2. Higher values produce more varied output.
boolean
When true, the response is streamed back as server-sent events. Defaults to false.

Content Part Types

Each object in the content array must specify a type. The supported types for vision requests are:
image_url.url accepts both public web URLs (e.g. https://example.com/image.png) and base64 data URIs. Base64 format: data:image/png;base64,iVBOR...

Examples

Response

A successful request returns a standard chat completion object. The model’s analysis or description of the image appears in choices[0].message.content.
Vision requests consume significantly more prompt_tokens than text-only requests because image content is tokenized as pixel patches. Monitor your usage.prompt_tokens accordingly when processing large or high-resolution images.