Asking for an image inside ChatGPT or Claude Code with the MCP generate_image tool

All in One AIAI Images·· 3 views· 3 min read

In short: with the All in One AI MCP server set up in ChatGPT or Claude Code, you just ask for the image in words. The agent picks the generate_image tool, sends the request and shows you the result. You pay with the same AI credits and at the same prices as the API.

Setting up the server, once

In Claude Code, with the key in the environment variable, type in the terminal:

claude mcp add --transport http --scope user mozout-ai https://api.mozout.com/mcp \
--header "Authorization: Bearer $MOZOUT_API_KEY"

You can also sign in without a key, with your account: add the server without --header, open Claude Code, type /mcp and choose Authenticate.

claude mcp add --transport http --scope user mozout-ai https://api.mozout.com/mcp

In ChatGPT, on the web:

1 Open Plugins, click + and choose Add custom MCP server.
2 Give it a name and, in Server URL, type https://api.mozout.com/mcp. For authentication, choose OAuth.
3 Click Create as a plugin and install it. Sign in with your account and click Allow.

The details of each tool are in the All in One AI MCP server and in the MCP docs.

Asking for the image

Write as you would to a person. In Claude Code, for example: "Generate a square image of a modern office with plants and morning light, and save it to public/img/hero.png." In ChatGPT, type @ and pick the plugin, or name it in your request. ChatGPT asks you to confirm each generation, because it spends credits.

What the tool does

Field What it is
prompt The description of the image. Required.
model Optional. Without it, the tool uses a default model of ours, good and cheap. Ask for another by name or by the id from list_models.
options Optional. The model's own fields, such as the size. The agent sees them with get_model.

The tool waits up to about 50 seconds. If the image is ready, it returns the links and, for an image up to 1 MB, the image itself, which the agent can see. If it is not ready in time, it returns the generation id, and the agent checks it later with get_generation.

Cost and testing

The generation pays the model price: it reserves the credits on the request, charges the real cost at the end and returns the rest. A generation that fails costs nothing. Before many images, ask the agent for the price (list_models) and the balance (get_balance), which cost nothing. To test without spending, use a sandbox_ key in the header: the image is ready at once, with an example link and 0 credits. With OAuth, requests are always real.

The links are not permanent. In Claude Code, ask the agent to download the image into the project. In ChatGPT, download it and keep it. See why you should download the image.

Want to see the price of each image model before you ask? It is in All in One AI.

See All in One AI

SEE ALSO

The All in One AI MCP server: images, video and voice inside Claude Code, Codex and ChatGPT

Saving an AI image to your website or project: why you should download it

Asking AI for an image: what to describe, with examples for a small business

A video that is not ready when the MCP server stops waiting: get_generation

All in One AI

Was this answer helpful? Your answer helps us improve this article.