Uç noktalar
Görsel ve dosyalar
Multimodal modellere kullanıcı mesajında görsel, PDF, ses ve video gönderin; içerik parçası biçimleri, örnekler, PDF ayrıştırma ve boyut limitleri.
Playground’da deneMultimodal modeller, kullanıcı mesajında görsel, PDF, ses ve video kabul eder. content alanını dize yerine parça dizisi olarak geçin. Bir modelin neyi kabul ettiğini görmek için Modeller içindeki architecture.input_modalities alanına bakın (image, file, audio, video).
İçerik parçaları
| Parça | Yapı | Notlar |
|---|---|---|
| Metin | { "type": "text", "text": "..." } | |
| Görsel | { "type": "image_url", "image_url": { "url": "https://..." | "data:image/png;base64,...", "detail": "auto" } } | PNG, JPEG, WebP, GIF. URL veya base64 data URL. |
| PDF / dosya | { "type": "file", "file": { "filename": "doc.pdf", "file_data": "https://..." | "data:application/pdf;base64,..." } } | Her modelle çalışır. Yerel dosya desteği olmayan modeller ayrıştırılmış metin alır. |
| Ses | { "type": "input_audio", "input_audio": { "data": "<base64>", "format": "wav" } } | Yalnızca base64. Modele bağlı olarak wav, mp3 ve diğerleri. |
| Video | { "type": "video_url", "video_url": { "url": "https://..." } } | Gemini gibi bazı modeller destekler. |
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);
Görsel örneği
{
"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 örneği
{
"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" } }]
}
İsteğe bağlı file-parser eklentisi, bir PDF'in nasıl okunacağını seçer: pdf-text (ücretsiz metin çıkarma), mistral-ocr (taramalar için OCR, sayfa başına faturalandırılır) veya native (modelin dosyayı kendisinin okuması). Ayrıştırma maliyeti usage.cost içine dahildir.
Yanıt
Yanıt normal bir chat completion'dır. Görsel, dosya ve ses girdileri girdi token'ı olarak sayılır ve maliyetleri usage.cost içindedir:
{
"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 }
}
Limitler ve hatalar
- Bir istek gövdesi en fazla 25 MB olabilir. Base64 dosyaları yaklaşık %33 büyütür. Daha büyük istekler
413 payload_too_largedöndürür. Büyük görseller için herkese açık URL'ler kullanın. - Bir girdi türünü kabul etmeyen model, sağlayıcı kaynaklı bir
400veya404döndürür. - Diğer hatalar Chat completions ile aynıdır. Bkz. Hatalar.