---
canonical_url: "https://docs.composio.dev/toolkits/imagerouter"
markdown_url: "https://docs.composio.dev/toolkits/imagerouter.md"
product: "platform"
version: null
last_updated: null
---

# ImageRouter

Generate images, videos, and text with ImageRouter, inspect credits, validate normal API keys, and discover models. Management-key endpoints are excluded.

- **Category:** ai content generation
- **Auth:** API_KEY
- **Composio-managed OAuth available?** N/A
- **Tools:** 8
- **Triggers:** 0
- **Slug:** `IMAGEROUTER`
- **Version:** 00000000_00

## Tools

### Create Chat Completion

**Slug:** `IMAGEROUTER_CREATE_CHAT_COMPLETION`

Create a non-streaming OpenAI-compatible chat completion with a paid text model. Call IMAGEROUTER_LIST_MODELS, IMAGEROUTER_GET_MODEL, and IMAGEROUTER_GET_CREDITS first to verify availability, context, supported parameters, pricing, and sufficient credits.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `model` | string | Yes | Exact text-output model ID from IMAGEROUTER_LIST_MODELS. Inspect its context, supported parameters, and pricing before this paid call. |
| `tools` | array | No | OpenAI-compatible function tool definitions available to the model. |
| `top_p` | number | No | Nucleus-sampling probability mass from 0 to 1. |
| `messages` | array | Yes | OpenAI-compatible conversation messages in chronological order. |
| `max_tokens` | integer | No | Maximum number of completion tokens. |
| `temperature` | number | No | Sampling temperature supported by the selected model. |
| `tool_choice` | string | No | OpenAI-compatible tool-selection policy as a keyword or policy object. |
| `response_format` | object | No | OpenAI-compatible response format configuration, including structured output. |
| `reasoning_effort` | string | No | Reasoning effort for selected models that support this parameter. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Response

**Slug:** `IMAGEROUTER_CREATE_RESPONSE`

Create a non-streaming OpenAI Responses API result from plain text or structured multimodal input with a selected ImageRouter text model. Call IMAGEROUTER_LIST_MODELS and IMAGEROUTER_GET_CREDITS first because all text models observed during probing were paid. Streaming and SSE are not supported.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `text` | object | No | Text output and structured-format configuration. |
| `input` | string | Yes | Plain prompt text or OpenAI Responses input items. Structured items may include model-supported multimodal content such as input_image parts. |
| `model` | string | Yes | Exact text-output model ID from IMAGEROUTER_LIST_MODELS. Inspect the model's capabilities and pricing first because this call may consume credits. |
| `tools` | array | No | OpenAI Responses-compatible tool definitions passed to the selected model. |
| `top_p` | number | No | Nucleus-sampling probability mass, from 0 to 1. |
| `reasoning` | object | No | Reasoning configuration supported by the selected model. |
| `temperature` | number | No | Sampling temperature, when supported by the selected model. |
| `tool_choice` | string | No | OpenAI Responses-compatible tool-selection policy. |
| `instructions` | string | No | Optional system-level guidance for the response. |
| `max_output_tokens` | integer | No | Maximum number of output tokens to generate. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Edit Image

**Slug:** `IMAGEROUTER_EDIT_IMAGE`

Transform or inpaint one or more existing images supplied as URLs or data URIs. Call IMAGEROUTER_LIST_MODELS and inspect the selected model first to verify image and optional mask input support, accepted parameters, pricing, and funding requirements. Multipart file uploads are not supported.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `size` | string | No | Model-supported WIDTHxHEIGHT value or auto. Omit to use its default. |
| `masks` | array | No | Optional mask URLs or data URIs for a model that accepts mask input. Provide 1-16 JSON string values when used. |
| `model` | string | Yes | Exact model ID from IMAGEROUTER_LIST_MODELS whose architecture accepts image input. Inspect its capabilities and pricing before editing. |
| `images` | array | Yes | Source image URLs or data URIs. Provide 1-16 JSON string values; binary multipart files are not supported. |
| `prompt` | string | Yes | Describe the requested transformation or inpainting result. |
| `quality` | string ("auto" | "low" | "medium" | "high") | No | Requested quality. Omit unless the selected model lists quality as a supported parameter. |
| `output_format` | string ("webp" | "jpeg" | "png") | No | Edited image file format. |
| `response_format` | string | No | Output transport. Only URL output is supported to keep results bounded. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Generate Image

**Slug:** `IMAGEROUTER_GENERATE_IMAGE`

Generate an image from a text prompt with a selected ImageRouter model. Call IMAGEROUTER_LIST_MODELS and inspect the selected model first because pricing, supported sizes and quality levels, and funding requirements vary. Results are returned as URLs; inline base64 output is not supported.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `size` | string | No | Model-supported WIDTHxHEIGHT value or auto. Omit to use its default. |
| `model` | string | Yes | Exact image model ID from IMAGEROUTER_LIST_MODELS. Inspect the model's capabilities and pricing before generation because production calls may consume credits or require a funded account. |
| `prompt` | string | Yes | Text description of the image to generate. |
| `quality` | string ("auto" | "low" | "medium" | "high") | No | Requested quality. Omit unless the selected model lists quality as a supported parameter. |
| `output_format` | string ("webp" | "jpeg" | "png") | No | Generated image file format. |
| `response_format` | string | No | Output transport. Only URL output is supported to keep results bounded. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Generate Video

**Slug:** `IMAGEROUTER_GENERATE_VIDEO`

Generate a video from text and optional URL or data-URI image inputs. Call IMAGEROUTER_LIST_MODELS and inspect the selected model first because pricing, accepted modalities, quality levels, sizes, and duration constraints vary. Results are returned as URLs; inline base64 output is not supported.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `size` | string | No | Model-supported WIDTHxHEIGHT value or auto. Omit to use its default. |
| `model` | string | Yes | Exact video model ID from IMAGEROUTER_LIST_MODELS. Inspect the model's capabilities and pricing before generation because production calls may consume credits or require a funded account. |
| `images` | array | No | Optional source image URLs or data URIs for image-to-video models. Multipart files are not supported. |
| `prompt` | string | Yes | Text description of the video to generate. |
| `quality` | string ("auto" | "low" | "medium" | "high") | No | Requested quality. Omit unless the selected model lists quality as a supported parameter. |
| `seconds` | integer | No | Requested duration in seconds. Omit for the provider's auto default; each model supports its own subset. |
| `response_format` | string | No | Output transport. Only URL output is supported to keep results bounded. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Credits

**Slug:** `IMAGEROUTER_GET_CREDITS`

Inspect remaining credits, cumulative usage, deposits, and optional per-key usage before making potentially paid generation calls.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `by_api_key` | boolean | No | Include usage and spend metadata grouped by API key. Secret key values are not returned. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Model

**Slug:** `IMAGEROUTER_GET_MODEL`

Get current capabilities, accepted parameters, and pricing for one exact ImageRouter model ID before generation.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `model_id` | string | Yes | Exact model ID returned by IMAGEROUTER_LIST_MODELS, such as openai/gpt-image-2. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Models

**Slug:** `IMAGEROUTER_LIST_MODELS`

Discover current ImageRouter model IDs, modalities, supported parameters, and pricing before generation. Filters may be combined. limit truncates results and cannot be continued; omit it for an exhaustive filtered list.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `free` | boolean | No | Set true for zero-priced models or false for paid models. Zero price does not guarantee access from an unfunded account. |
| `name` | string | No | Case-insensitive partial model name, ID, or alias filter. |
| `sort` | string ("name" | "provider" | "price" | "date") | No | Sort by name or provider alphabetically, price ascending, or date newest first. |
| `limit` | integer | No | Truncate the returned array to at most this many models. There is no next page or continuation token. |
| `fields` | string | No | Comma-separated response fields to include, such as architecture,pricing,supported_parameters,parameters,aliases. The model ID is always returned. |
| `provider` | string | No | Case-insensitive partial provider filter. |
| `input_modality` | string ("image" | "mask" | "text" | "audio" | "video") | No | Return models accepting this input modality. |
| `output_modality` | string ("image" | "video" | "text") | No | Return models producing this modality. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
