Reference · API

OpenAI vision chat

Last updated

Same **chat completions** endpoint with image parts in messages.

Same **chat completions** endpoint with image parts in messages.

Endpoint

POST https://api.openai.com/v1/chat/completions

Vision-capable models

Use `gpt-4o`, `gpt-4o-mini`, or current vision model IDs from provider docs.

Message with image

{
  "model": "gpt-4o-mini",
  "messages": [{
    "role": "user",
    "content": [
      { "type": "text", "text": "What error code is shown?" },
      { "type": "image_url", "image_url": { "url": "https://..." } }
    ]
  }]
}

Tips

  • Prefer URLs or base64 under size limits
  • Don't log customer images in production traces
  • **Try the lesson:** `multimodal-api-lab` in Lane D