Code for each endpoint: Chat Completions, Responses, Messages.
Rules
- Check what the model accepts.
architecture.input_modalitiesin/v1/modelsliststext,image,audioandfile. Sending another type fails with400 unsupported_modalitybefore the request reaches a provider. - Size. One inline image, file or audio part can be up to 20 MiB, and the whole request up to 32 MiB.
- Files by value or by link. Send files as base64 or as an
httpslink. NagaAI has no Files API, so afile_idfails with400 file_id_unsupported. Models without native file input receive the text of the file. - Audio formats.
input_audio.datais raw base64. Adata:prefix fails with400.formatis one ofwav,mp3,aiff,aac,ogg,flac,m4a,pcm16,pcm24. - Messages documents. NagaAI drops a
documentwith acontentsource. Usebase64,urlortext.