Image MCP
Connect an MCP client to TokenFlux to list supported image models and generate one image with your API key.
Use the TokenFlux image generation MCP server from Claude Code or another client that supports Streamable HTTP. The endpoint is https://tokenflux.ai/studio/mcp.
You need a TokenFlux API key with access to a supported image model and enough balance. New API checks your key, model access and balance. Generation is billed per request as listed in the model catalog. A catalog list price does not include account group adjustments.
Connect Claude Code
Set TOKENFLUX_API_KEY in the Claude Code process environment. Keep the key out of version control. Add this entry to your MCP configuration:
{
"mcpServers": {
"tokenflux-studio": {
"type": "http",
"url": "https://tokenflux.ai/studio/mcp",
"headers": {
"Authorization": "Bearer ${TOKENFLUX_API_KEY}"
}
}
}
}Open /mcp in Claude Code to check the connection. Ask the client to list image models before you ask it to generate an image. Other clients must send the same Bearer header and support JSON responses over Streamable HTTP.
Tools
image_models__list takes an empty object. It returns only models that your key can access and that TokenFlux has verified for image generation. Each model includes its ID, the generate operation and a fixed image count of one. Catalog prices are optional. If the pricing service is unavailable, the response includes pricing_status: "unavailable".
images__generate takes a model ID and a prompt:
{
"model": "image/black-forest-labs/flux-2-klein-4b",
"prompt": "A plain blue circle on a white background"
}The tool generates one image. It returns model, created and one HTTPS URL in images, with a request_id when available. The result is available as structured content and JSON text. Download the image if you need to keep it. The provider URL can expire.
Limits and errors
- The prompt must contain text and have at most 4,000 characters. The model ID has a limit of 200 characters.
- Omit
size. No custom sizes have been verified for the current model. - Each call generates one image. Editing, multiple images, inline base64, custom provider fields and background job recovery are unavailable.
- The request body has a limit of 64 KiB. Upstream JSON responses have a limit of 1 MiB. Catalog requests have a 10-second deadline. Generation has a 120-second deadline.
- Set the client timeout above 120 seconds. If the tool returns
outcome_unknown, check your usage before you retry. A timeout or disconnected client does not prove that generation stopped or that no charge occurred. Repeated calls can incur repeated charges. - Missing or invalid keys return HTTP 401. Permission failures return 403. Generation refusals return a tool error with
upstream_statusand, when available,request_idandretry_after_seconds.
The server accepts POST requests and notifications. It has no persistent session or GET event stream. GET and DELETE return 405. CLI clients can omit Origin. Requests with an Origin must match the deployment allowlist. Browser CORS is unavailable.
This endpoint does not add an image tool to TokenFlux Agents. The retired /v1/images/mcp and /v1/mcps endpoints are not aliases.