Skip to Content

ビジョン

OfoxAIはマルチモーダルモデルのビジョン入力をサポートし、画像、スクリーンショット、ドキュメント、動画コンテンツを分析できます。

対応モデル

モデル画像動画説明
openai/gpt-4o高品質な画像分析
openai/gpt-4o-mini高速な画像分析
anthropic/claude-sonnet-4.5優れたドキュメント・コード理解力
google/gemini-3-flash-previewマルチモーダル万能型
google/gemini-3.1-pro-preview最強のマルチモーダル推論

画像分析

URLによる画像送信

Terminal
curl https://api.ofox.ai/v1/chat/completions \ -H "Authorization: Bearer $OFOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/gpt-4o", "messages": [{ "role": "user", "content": [ {"type": "text", "text": "この画像の内容を説明してください"}, {"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}} ] }] }'

Base64による画像送信

ローカルファイルやスクリーンショットのシナリオに適しています:

vision_base64.py
import base64 # ローカル画像を読み込み with open("screenshot.png", "rb") as f: image_data = base64.standard_b64encode(f.read()).decode("utf-8") response = client.chat.completions.create( model="openai/gpt-4o", messages=[{ "role": "user", "content": [ {"type": "text", "text": "このスクリーンショットには何が表示されていますか?"}, { "type": "image_url", "image_url": { "url": f"data:image/png;base64,{image_data}" } } ] }] )

画像の詳細レベル

detail パラメータで分析精度を制御します:

説明適用シナリオ
auto自動選択(デフォルト)一般的なシナリオ
low低精度、より高速シンプルな分類、タグ認識
high高精度、より詳細ドキュメント OCR、詳細分析
{ "type": "image_url", "image_url": { "url": "https://example.com/document.jpg", "detail": "high" # 高精度モード } }

複数画像の比較

1つのリクエストで複数の画像を送信できます:

response = client.chat.completions.create( model="openai/gpt-4o", messages=[{ "role": "user", "content": [ {"type": "text", "text": "この2つの画像の違いを比較してください"}, {"type": "image_url", "image_url": {"url": "https://example.com/before.jpg"}}, {"type": "image_url", "image_url": {"url": "https://example.com/after.jpg"}} ] }] )

Anthropic プロトコルでのビジョン入力

import anthropic client = anthropic.Anthropic( base_url="https://api.ofox.ai/anthropic", api_key="<あなたの OFOXAI_API_KEY>" ) message = client.messages.create( model="anthropic/claude-sonnet-4.5", max_tokens=1024, messages=[{ "role": "user", "content": [ { "type": "image", "source": { "type": "base64", "media_type": "image/jpeg", "data": image_data } }, {"type": "text", "text": "この画像を説明してください"} ] }] )

よくあるユースケース

  • ドキュメント OCR — 画像内のテキストや表を抽出
  • コードスクリーンショット分析 — スクリーンショット内のコードを分析し、修正案を提示
  • UI レビュー — インターフェースのデザインやレイアウトを分析
  • チャート解読 — データチャートやビジュアライゼーションの内容を分析
  • オブジェクト認識 — 画像内のオブジェクトやシーンを認識
Last updated on