Building

Multimodal input

Send images, audio, video and documents alongside your text. Content becomes an array of parts instead of a plain string.

Which model takes what#

ModelAccepts
upfyn-balaText only.
upfyn-yuvaText, images, audio, PDFs and documents.
upfyn-rishiAll of the above, plus video.

Attaching media a model cannot read is an error

It is not ignored. Send an image to Bala and you get 400 media_not_supported before anything is charged. That is deliberate — silently dropping an attachment produces an answer about a question you did not ask.

Images#

By URL, or inline as a data URI if the file is local.

response = client.chat.completions.create(
model="upfyn-yuva",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "What is the total on this invoice?"},
{"type": "image_url",
"image_url": {"url": "https://example.com/invoice.png"}},
],
}],
)

Getting good answers from images

  • Ask a specific question. “What is the total?” beats “describe this” every time.
  • Send the image at a readable size — downscaling a dense screenshot until the text blurs is the most common cause of a wrong answer.
  • Several images in one message is fine. Say which is which in the text part.
  • Base64 counts toward your request size. For anything you will reference more than once, upload it instead.

Documents and reuse#

Upload once, reference by id. This is the right approach for PDFs, and for any file used across several turns — you pay to send the bytes once.

Upload, then reference
# 1. Upload once
uploaded = client.files.create(file=open("contract.pdf", "rb"), purpose="assistants")
 
# 2. Reference it by id — no re-upload on later turns
response = client.chat.completions.create(
model="upfyn-yuva",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "Summarise the termination clause."},
{"type": "file", "file": {"file_id": uploaded.id}},
],
}],
)
  • Uploads cap at 100 MB; larger returns 413 file_too_large.
  • Files are private to your account. A file id alone fetches nothing — every read matches the owner.
  • Manage them from Files or GET /v1/files.

Audio and video#

Audio parts go to Yuva and Rishi; video is Rishi only. Both work the same way as images — a content part with a URL or a file_id.

Transcription is a different endpoint

If you want a transcript rather than a conversation about the audio, use POST /v1/audio/transcriptions. It is cheaper and it returns text directly.

Producing media, not reading it#

This page is about input. To make an image, speech or a video, see Generating media.