Saltar al contenido
Alfa
  • Modelos
  • Clasificaciones
  • Ori
Hablar con ventas

Pie de página

OpenRouterOpenRouter
© 2026 OpenRouter, Inc

Producto

  • Chat
  • Clasificaciones
  • Pruebas de rendimiento
  • Aplicaciones
  • Descubrir
  • Modelos
  • Ori
  • Colecciones
  • Proveedores
  • Herramientas
  • Precios
  • Business
  • Enterprise
  • Laboratorio

Empresa

  • Acerca de
  • Blog
  • Clientes
  • Empleo
    Empleo
  • Privacidad
  • Términos del servicio
  • Centro de confianza
  • Soporte
  • Compatible con OR
  • Datos
  • Marca

Desarrollador

  • Documentación
  • Referencia de la API
  • Plataforma para desarrolladores
  • Estado
  • Mapa del sitio para IA

Conectar

  • Discord
  • GitHub
  • LinkedIn
  • X
  • YouTube
Todas las herramientas del servidor

Image generation

openrouter:image_generation

DocumentaciónProbar esta herramienta

Permite que cualquier modelo de texto produzca imágenes. El modelo escribe un prompt de imagen, OpenRouter genera la imagen con el modelo de imágenes configurado (openai/gpt-5-image de forma predeterminada) y la imagen se devuelve junto con la respuesta.

DocumentaciónProbar esta herramienta
Cómo funcionaProveedores y preciosUso de esta herramientaPreguntas frecuentes

Cómo funciona

Para añadir imágenes a las respuestas de cualquier modelo, incluidos los modelos de solo texto.

  1. 1

    Su modelo decide que una imagen sería útil y escribe un prompt para ella.

  2. 2

    OpenRouter lo genera con el modelo de imágenes configurado y devuelve la URL.

  3. 3

    Su modelo incluye la imagen en su respuesta y puede crear varias.

Proveedores y precios

  • Favicon de https://openrouter.ai

    OpenRouter

    Precios de modelos de imagen

    El precio depende del modelo de imagen que invoque la herramienta; se puede seleccionar cualquier modelo con salida de imagen.

Los costes estándar de los tókenes del modelo se aplican a cada solicitud.

Uso de esta herramienta

OpenRouter ejecuta la herramienta durante la solicitud y devuelve el resultado al modelo, por lo que no se necesita un bucle de herramientas del lado del cliente.

API compatibles: 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."
    }
  ]
}'

Configuración, parámetros y ejemplos en la documentación.

Leer la guía de integración

Preguntas frecuentes

Yes. Add the openrouter:image_generation tool to the request’s tools array. The model writes an image prompt when the conversation calls for one, OpenRouter generates the image with an image model, and the image comes back with the response. A model with text-only output, such as openai/gpt-5.2, can answer with images this way.

The tool uses openai/gpt-5-image unless you set parameters.model on the tool entry. Any model with image output on OpenRouter can be selected, so switching image models changes one field and keeps the same API key and request shape. Other parameters such as quality, size and aspect_ratio pass through to that model.

Each image is billed at the selected image model’s price, on top of the token cost of the model that calls the tool. Each image model’s price is on its model page and in the image models collection.

With the Images API (POST /api/v1/images), your code writes the prompt and calls the image model directly. With the tool, the model decides when an image helps, writes the prompt itself and can create several images in one Chat Completions, Responses or Anthropic Messages request.