- Responses
- Chat Completions
- Messages
Check what the model reads
architecture.input_modalities of each model in /v1/models lists what it reads: text, image, audio and file. Check it before you send anything other than text. NagaAI refuses a part the model can’t read with 400 unsupported_modality before the request reaches a provider.
Parts in each format
An image link is an
https URL or a data URI. In Responses and Chat Completions, detail sets how closely the model looks at the image: low, high or auto.
One inline image, file or audio part can be up to 20 MiB, and the whole request up to 32 MiB.
Files and PDFs
Send a file as base64 data or as anhttps link. NagaAI has no Files API, so it can’t resolve a file_id. Some providers of a model that reads files have no file input. NagaAI sends such a provider the text of the file instead.
- Responses
- Chat Completions
- Messages
file_url is a NagaAI addition to the official format. In Messages, a document takes a base64 PDF with media_type: "application/pdf", a url to a PDF, or text with media_type: "text/plain". NagaAI drops a document with a content source without an error, so the model never sees it.
Audio
Responses and Chat Completions take audio in aninput_audio part. data is plain base64 without a data: prefix, and format is one of wav, mp3, aiff, aac, ogg, flac, m4a, pcm16 or pcm24. The official API accepts only wav and mp3.
Python
Images in the answer
Models that draw return the picture in the response. In Chat Completions it arrives inmessage.images, a list of {"type": "image_url", "image_url": {"url": "..."}} entries next to content. The url is either a data: URI or an https link, so handle both. In Responses it’s an image_generation_call output item with the image in result and its type in mime_type.
To edit the picture on the next turn, send the assistant message back with its images, or the image_generation_call item in input. The model then changes that picture instead of drawing a new one.
Troubleshooting
400 unsupported_modality
The model doesn’t read this kind of part. Pick a model whose input_modalities lists it, or send the content as text.
400 file_id_unsupported
NagaAI has no Files API. Send the file itself in file_data or as a link in file_url.
400 on input_audio
input_audio.data starts with data:. Send the base64 string without the prefix.