Skip to main content
Serverless Inference accepts images and text together in the same request. You can ask a model to describe a photo, extract information from a screenshot, or interpret a chart. Some models also accept MP4 clips. The model returns a text response. To see the available Serverless Inference models, go to Models in the Forge UI and add a filter for vision features (image or video). Requests use the OpenAI-compatible Chat Completions API. Use the API model ID in the model field.

Models that accept images

The following models accept PNG, JPG, and WebP images. Each model accepts an image through an HTTPS URL or a Base64 data URL:

Prerequisites

Install the openai Python package and set your Forge API key as an environment variable. Replace [API-KEY] with your API key:
The examples on this page use Python and the openai package, but neither is required. Any HTTP client works, such as curl. To send the same requests from the command line, convert the examples to curl requests to the Chat Completions endpoint.

Send an image

To ask a question about an image, send a text part with your question and an image_url part in the same user message.
  • For a hosted image, use a directly reachable HTTPS URL.
  • For a local image, Base64-encode the file and include the MIME type in the data URL, as in data:image/png;base64,[ENCODED-IMAGE].
The following example sends a hosted PNG. To send a local PNG instead, uncomment the two lines that encode the file and set the file path. Change the question to suit your image.
The script prints the model’s text answer about the image.

Try an image in the Playground

To ask a question about an image without writing code, open the Playground and do the following:
  1. Select a model that accepts image input.
  2. In the attachment menu, choose Add image or Add image URL.
For more information about using the Playground, see Try models in the Playground UI.

Models that accept video

The following table lists the models that accept H.264 MP4 video. Each model accepts video through an HTTPS URL or a Base64 data URL:

Send a video

To ask a question about a video, send a text part with your question and a video_url part in the same user message.
  • For a hosted video, use a directly reachable HTTPS URL.
  • For a local video, Base64-encode the file and include the MIME type in the data URL, as in data:video/mp4;base64,[ENCODED-VIDEO].
The following example sends a hosted MP4. To send a local H.264 MP4 instead, uncomment the two lines that encode the file and set the file path. Change the question to suit your video.
The script prints the model’s text description of the video.
Last modified on December 3, 2026