← リストに戻る

マルチモーダル — 画像と文書の理解

ビジョン対応モデルは、タイプ image_url のコンテンツ部分を受け入れます。 image_url

python
resp = client.chat.completions.create(
    model="gpt-4o",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "How many cats are in this image?"},
            {"type": "image_url", "image_url": {"url": "https://.../cats.png"}}
        ]
    }],
)

イメージトークンの課金

各画像の請求額はおおよそ次のようになります 1,000 ~ 4,000 解像度に応じたトークン。カウントは応答にロールアップされます。 usage.prompt_tokens.

以下も参照してください。API ドキュメント › マルチモーダル入力