← Back to Plugins
Tools

Mistral Image

HannesOberreiter By HannesOberreiter 👁 14 views ▲ 0 votes

OpenClaw plugin: Mistral as an image-generation provider

GitHub

Install

npm install
pnpm

README

# openclaw-mistral-image

An [OpenClaw](https://openclaw.ai) plugin that adds Mistral as an
image-generation provider for the `image_generate` tool.

Mistral has no direct image endpoint. The plugin uses the built-in
[`image_generation` tool](https://docs.mistral.ai/agents/tools/built-in/image_generation)
of the Mistral Conversations API. The plugin sends one conversation request
with `store: false`, reads the image reference from the response, and
downloads the image.

## Requirements

- OpenClaw 2026.12.2 or later.
- The official Mistral provider (`@openclaw/mistral-provider`) with a
  Mistral API key. The plugin uses the API key of the `mistral` provider. It
  has no API key setting of its own.

## Install

```bash
openclaw plugins install @hannesoberreiter/openclaw-mistral-image
```

If the `mistral` provider has no API key yet:

```bash
openclaw models auth paste-api-key --provider mistral
```

## Configure

Set Mistral as the image-generation model:

```json5
{
  agents: {
    defaults: {
      mediaModels: {
        image: { primary: "mistral-image/mistral-medium-latest" },
      },
    },
  },
}
```

Test from the command line:

```bash
openclaw infer image generate \
  --model mistral-image/mistral-medium-latest \
  --prompt "A honey bee on a sunflower" \
  --output bee.jpg
```

## Models

The model is the Mistral chat model that calls the image tool. A third-party
image model generates the image. The default is `mistral-medium-latest`.

The plugin has no model list. You can use each Mistral model that supports
built-in connectors. If a model does not support them, the request fails with
the error from Mistral, for example:

```
Model ministral-3b-latest currently does not support builtin connectors.
```

Tested models: `mistral-medium-latest`, `mistral-large-latest`.

## Limits

- One image for each request.
- Size, aspect ratio, resolution, quality, and output format hints have no
  effect. The images that we tested were 1024x768 JPEG files.
- No image editing and no reference images.
- The plugin tells the model to use the prompt verbatim. The model can still
  change the prompt. The result shows the prompt that the model used as
  `revisedPrompt`.
- Mistral marks the Agents and Conversations API as deprecated. Mistral can
  change or remove it.
- Each image generation costs money on your Mistral account.

## Development

The repository uses Node 26 (see `.tool-versions`) and pnpm.

```bash
pnpm install
pnpm check   # format check, lint, typecheck, unit tests
pnpm build
```

## Releases

[release-please](https://github.com/googleapis/release-please) makes the
releases from Conventional Commits:

1. Merge commits with `feat:` or `fix:` into `main`.
2. release-please opens a release PR with the new version and the changelog.
3. Merge the release PR. The release workflow then publishes the package to
   npm and ClawHub.

Test the package in a local OpenClaw:

```bash
pnpm pack --pack-destination /tmp
openclaw plugins install \
  npm-pack:/tmp/hannesoberreiter-openclaw-mistral-image-1.0.0.tgz \
  --force --accept-capabilities
openclaw plugins inspect mistral-image --runtime --json
```

## License

MIT
tools

Comments

Sign in to leave a comment

Loading comments...