We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.

Vision & files

Endpoints

Vision & files

Send images, PDFs, audio and video as content parts in a chat message to api14 models, with supported formats, size limits and examples.

Try it in the playground

Multimodal models accept images, PDFs, audio and video in a user message. Pass content as an array of parts instead of a string. To see what a model accepts, check architecture.input_modalities in Models (image, file, audio, video).

Content parts

PartShapeNotes
Text{ "type": "text", "text": "..." }
Image{ "type": "image_url", "image_url": { "url": "https://..." | "data:image/png;base64,...", "detail": "auto" } }PNG, JPEG, WebP, GIF. URL or base64 data URL.
PDF / file{ "type": "file", "file": { "filename": "doc.pdf", "file_data": "https://..." | "data:application/pdf;base64,..." } }Works with any model. Models without native file support get parsed text.
Audio{ "type": "input_audio", "input_audio": { "data": "<base64>", "format": "wav" } }Base64 only. wav, mp3 and others, depending on the model.
Video{ "type": "video_url", "video_url": { "url": "https://..." } }Supported by some models, e.g. Gemini.
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api14.com/api/v1",
  apiKey: process.env.API14_API_KEY,
});

const result = await client.chat.completions.create({
  "model": "openai/gpt-5-mini",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "What is in this image?"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg"
          }
        }
      ]
    }
  ]
});
console.log(result.choices[0].message.content);

Image example

{
  "model": "google/gemini-2.5-flash",
  "messages": [
    {
      "role": "user",
      "content": [
        { "type": "text", "text": "What is in this picture?" },
        { "type": "image_url", "image_url": { "url": "https://upload.wikimedia.org/wikipedia/commons/a/a7/Camponotus_flavomarginatus_ant.jpg" } }
      ]
    }
  ]
}

PDF example

{
  "model": "anthropic/claude-sonnet-4.5",
  "messages": [
    {
      "role": "user",
      "content": [
        { "type": "text", "text": "Summarize this contract in five bullets." },
        { "type": "file", "file": { "filename": "contract.pdf", "file_data": "data:application/pdf;base64,JVBERi0xLjcK..." } }
      ]
    }
  ],
  "plugins": [{ "id": "file-parser", "pdf": { "engine": "pdf-text" } }]
}

The optional file-parser plugin chooses how a PDF is read: pdf-text (free text extraction), mistral-ocr (OCR for scans, billed per page) or native (the model reads the file itself). The parsing cost is part of usage.cost.

Response

The response is a normal chat completion. Image, file and audio inputs count as input tokens, and their cost is in usage.cost:

{
  "choices": [{ "index": 0, "finish_reason": "stop", "message": { "role": "assistant", "content": "A close-up of an ant on a leaf." } }],
  "usage": { "prompt_tokens": 1290, "completion_tokens": 12, "total_tokens": 1302, "cost": 0.000417 }
}

Limits & errors

  • A request body can be at most 25 MB. Base64 makes files about 33% larger. Larger requests return 413 payload_too_large. For big images, use public URLs.
  • A model that doesn't accept an input type returns an upstream 400 or 404.
  • Other errors are the same as for Chat completions. See Errors.