# ImageRouter

> Generate images and videos, discover models and read ImageRouter credit usage.

App · 9 actions. Web page: https://docs.lodol.com/docs/integrations/imagerouter

## Actions

### Browse model capabilities

Browse model capabilities.

**Inputs**

- Limit (`limit`, number): Limit. From 1 to 100.

**Outputs**

- `data` (list): The response from ImageRouter.

**Example output**

```json
{
  "data": [
    {
      "architecture": {
        "input_modalities": [
          "example"
        ],
        "output_modalities": [
          "example"
        ]
      },
      "id": "example",
      "parameters": {},
      "pricing": {},
      "provider": "example",
      "supported_parameters": [
        "example"
      ]
    }
  ]
}
```

### Create a chat completion

Send chat messages to a text model and return its reply.

**Inputs**

- Model (`model`, text, required): Text model to use.
- Messages (`messages`, list, required): Ordered chat messages with a role and text for each.

**Outputs**

- `data` (object): The response from ImageRouter.

**Example output**

```json
{
  "data": {
    "choices": [
      {
        "finish_reason": "example",
        "index": 1,
        "message": {
          "content": "example",
          "role": "example"
        }
      }
    ],
    "id": "example",
    "model": "example",
    "usage": {}
  }
}
```

### Create a model response

Send a text prompt through the Responses API and return the model output.

**Inputs**

- Model (`model`, text, required): Text model to use.
- Input (`input`, text, required): Text prompt for the model.

**Outputs**

- `data` (object): The response from ImageRouter.

**Example output**

```json
{
  "data": {
    "id": "example",
    "model": "example",
    "output": [
      {}
    ],
    "status": "example",
    "usage": {}
  }
}
```

### Edit an image

Apply an editing prompt to an uploaded image or a public image URL.

**Inputs**

- Image (`image`, text, required): Upload an image or enter its public URL.
- Prompt (`prompt`, text, required): Describe the changes to make.
- Model (`model`, text, required): Image model that accepts an image as input.
- Output format (`output_format`, text): Output image format. One of: `webp`, `jpeg`, `png`.

**Outputs**

- `data` (object): The response from ImageRouter.

**Example output**

```json
{
  "data": {
    "created": 1,
    "data": [
      {
        "b64_json": "example",
        "revised_prompt": "example",
        "url": "example"
      }
    ]
  }
}
```

### Generate a video

Generate a video.

**Inputs**

- Prompt (`prompt`, text, required): Prompt.
- Model (`model`, text, required): Model.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json), `b64_ephemeral` (B64 ephemeral).
- Quality (`quality`, text): Quality. One of: `auto`, `low`, `medium`, `high`.
- Size (`size`, text): Size.
- Seconds (`seconds`, number): Duration in seconds. Leave blank to use the model default. From 1 to 60.
- Image URL (`image_url`, text): Public image URL to animate, when supported by the model.

**Outputs**

- `data` (object): The response from ImageRouter.

**Example output**

```json
{
  "data": {
    "created": 1,
    "data": [
      {
        "b64_json": "example",
        "revised_prompt": "example",
        "url": "example"
      }
    ]
  }
}
```

### Generate an image

Generate an image.

**Inputs**

- Prompt (`prompt`, text, required): Prompt.
- Model (`model`, text, required): Model.
- Response format (`response_format`, text): Response format. One of: `url`, `b64_json` (B64 json), `b64_ephemeral` (B64 ephemeral).
- Quality (`quality`, text): Quality. One of: `auto`, `low`, `medium`, `high`, `very_low` (Very low), `xhigh`, `max`.
- Size (`size`, text): Size.
- Output format (`output_format`, text): Output image format. One of: `webp`, `jpeg`, `png`.

**Outputs**

- `data` (object): The response from ImageRouter.

**Example output**

```json
{
  "data": {
    "created": 1,
    "data": [
      {
        "b64_json": "example",
        "revised_prompt": "example",
        "url": "example"
      }
    ]
  }
}
```

### Get credit balance and usage

Get credit balance and usage.

**Inputs**

- By API key (`by_api_key`, true/false): Break down usage by API key.

**Outputs**

- `data` (object): The response from ImageRouter.

**Example output**

```json
{
  "data": {
    "credit_usage": "example",
    "remaining_credits": "example",
    "total_deposits": "example",
    "usage_by_api_key": [
      {
        "api_key_id": "example",
        "api_key_name": "example",
        "created_at": "example",
        "credit_usage": "example",
        "expires_at": "example",
        "is_active": true,
        "period_spend": "example",
        "period_start": "example",
        "spend_limit": "example",
        "spend_limit_period": "example",
        "total_requests": 1
      }
    ]
  }
}
```

### Get model capabilities

Get model capabilities.

**Inputs**

- Model (`model`, text, required): Model.

**Outputs**

- `data` (object): The response from ImageRouter.

**Example output**

```json
{
  "data": {
    "architecture": {
      "input_modalities": [
        "example"
      ],
      "output_modalities": [
        "example"
      ]
    },
    "id": "example",
    "parameters": {},
    "pricing": {},
    "provider": "example",
    "supported_parameters": [
      "example"
    ]
  }
}
```

### List models

List models.

**Inputs**: None.

**Outputs**

- `data` (object): The response from ImageRouter.

**Example output**

```json
{
  "data": {}
}
```
