Skip to navigation

Multimodal

Beyond text, Flow AI lets you send images, PDFs, audio and video to models that understand them, and generate images and video from a prompt. Everything goes through the same API and the same key.

Inputs

All inputs go to POST /v1/chat/completions. Instead of a string, a message’s content is a list of parts, and each part has a type:

InputPart typePage
Imageimage_urlImage inputs
PDFfilePDF inputs
Audioinput_audioAudio inputs
Videovideo_urlVideo inputs

You can mix text with several inputs, of one kind or several, in one message. How many a request can carry depends on the model.

{
"role": "user",
"content": [
{ "type": "text", "text": "Compare the chart with the report." },
{ "type": "image_url", "image_url": { "url": "https://example.com/chart.png" } },
{ "type": "file", "file": { "filename": "report.pdf", "file_data": "data:application/pdf;base64,..." } }
]
}

Outputs

OutputEndpointPage
ImagesPOST /v1/images/generations, POST /v1/images/editsImage generation
VideoPOST /v1/videosVideo generation

Chat models answer in text. Audio output, text-to-speech and speech-to-text aren’t available.

URL or base64

InputURLBase64
ImageYesYes, as a data:image/...;base64, URL
PDFDepends on the modelYes, as a data:application/pdf;base64, URL
AudioNoYes, raw base64 with a format
VideoDepends on the model’s hostYes, as a data:video/...;base64, URL

For public files, a URL keeps the request small and skips encoding. Use base64 for local or private files.

Which models take what

Every chat model takes text. Images, PDFs, audio and video depend on the model. Flow AI checks each part against what the model takes before anything is held: a part the model can’t read is refused with a 400 that names the model and the content, for example:

{ "error": { "message": "openai/gpt-6-luna does not take audio content", "code": "invalid_request" } }

Nothing is charged for a refused request.

Billing

The model turns every input into input tokens, and you pay for them at its input price. How many tokens an image, a PDF page, a second of audio or a second of video takes depends on the model, so check usage.prompt_tokens on a first request. Image and video generation are priced per image and per second; see their pages.

Next: Image Inputs — send pictures to a chat model.