所有伺服器工具

Image generation

openrouter:image_generation

讓任何文字模型都能產生圖片。模型會撰寫圖片提示詞,OpenRouter 使用設定的圖片模型(預設為 openai/gpt-image-2.6-flare)產生圖片,並將圖片與回應一併傳回。

運作方式

用於在任何模型的回應中加入圖片,包括純文字模型。

  1. 您的模型 判定圖片會有幫助,並為其撰寫提示詞。

  2. OpenRouter 使用設定的影像模型生成影像,並傳回 URL。

  3. 您的模型 會在回應中包含圖片,並可建立多張圖片。

供應商與定價

  • OpenRouter

    圖像模型定價

    依工具呼叫的圖像模型計價;可選擇任何支援圖像輸出的模型。

每個請求皆適用標準模型 token 費用。

使用此工具

OpenRouter 會在請求期間執行工具,並將結果傳回模型,因此不需要用戶端工具迴圈。

支援的 API:Chat Completions, Responses, and Anthropic Messages。

Shell
curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "openai/gpt-5.2",
  "tools": [
    {
      "type": "openrouter:image_generation"
    }
  ],
  "messages": [
    {
      "role": "user",
      "content": "Draw a watercolor painting of a lighthouse at dusk."
    }
  ]
}'

設定、參數與範例請參閱文件。

閱讀整合指南

常見問題