How ATXP's Image Generation Works (and What It Costs)

Your agent doesn’t need a separate Midjourney subscription, a DALL-E API key, or a Stability AI account. ATXP handles image generation as a native tool call — charged to the agent’s IOU balance, accessible in any framework, no separate setup.


Image generation pipeline: agent sends text prompt, API processes through diffusion model, returns generated image

The short answer

The agent calls image_generate with a prompt. ATXP routes to the appropriate model, charges the cost (~$0.04 per standard image) to the agent’s IOU balance, and returns the image URL. No separate API key, no separate billing, no model selection required.


How to use it

Definition — Agent Image Generation
Agent image generation is the ability of an AI agent to produce images programmatically as part of a multi-step workflow — not as a standalone task, but as one tool call among many. The agent sends a text prompt; the tool routes it to a diffusion model; the result is returned as a URL the agent can save, display, or pass to the next workflow step. Cost is charged to the agent's IOU balance per image, with no separate API key or billing account required.
— ATXP

In any framework (via npx atxp):

In Claude Code, just describe the task:

Generate a 1024x1024 product image for 'minimalist ceramic coffee mug, white background, studio lighting'
and save it to ./images/product-hero.png

In LangChain:

from atxp import AtxpToolkit

tools = AtxpToolkit.from_env().get_tools()
image_tool = next(t for t in tools if t.name == "image_generate")

result = image_tool.run({
    "prompt": "dark navy background, neon circuit board pattern, isometric AI robot icon, product thumbnail style",
    "size": "1024x1024"
})
# result.url → image URL valid for 24 hours

In the OpenAI Agents SDK:

from atxp.openai import get_atxp_tools

tools = get_atxp_tools()
# image_generate is included automatically

Prompt structure that works

Image generation quality scales directly with prompt specificity. A few patterns that produce consistent results:

Product photography:

[subject description], [background], [lighting style], [camera angle], photorealistic, product photography

Example: "minimalist desk lamp, white studio background, soft directional lighting, 3/4 angle, photorealistic, product photography"

Infographics and diagrams:

[dark/light] background, [color palette], [diagram type], [content description], no text, clean infographic

Example: "dark navy background, cyan and green neon, architecture diagram, three-layer infrastructure stack, no text, clean infographic"

Marketing assets:

[style], [subject], [mood/tone], [format], suitable for [use case]

Example: "flat illustration style, AI agent icon, professional, square format, suitable for LinkedIn post"


Costs and pricing

FormatApproximate cost
512x512~$0.02
1024x1024 (standard)~$0.04
1792x1024 (landscape)~$0.06
1024x1792 (portrait)~$0.06

All costs draw from the agent’s IOU balance. For high-volume image generation (product catalog at 100+ images), set a daily limit to control spend:

npx atxp limits --daily 10  # Caps spending at $10/day equivalent

At $0.04/image, a $10 daily cap allows ~250 images per day before the limit kicks in.


Common workflows

Product catalog generation:

products = load_product_list("catalog.csv")

for product in products:
    image_url = image_tool.run({
        "prompt": f"{product.name}, {product.description}, white background, product photography",
        "size": "1024x1024"
    })
    file_store_tool.run({
        "url": image_url,
        "path": f"images/{product.sku}.png"
    })

Blog image generation: The images in every ATXP blog post — including this one — were generated by an agent running npx atxp image with a prompt describing the article’s content. At ~$0.04/image, generating 2 images per blog post costs $0.08 — a fraction of the cost of commissioning custom illustrations.

Report diagrams: An agent generating a competitive analysis report can create a custom diagram for each section — architecture diagrams, comparison charts, process flows — automatically during the report generation step.


Image storage

Generated images are returned as URLs valid for 24 hours. For permanent storage:

# Save to ATXP file storage
file_result = file_store_tool.run({
    "source_url": image_result.url,
    "filename": "product-hero.png",
    "folder": "product-images"
})
# file_result.permanent_url → persistent storage URL

Or download directly to your local filesystem:

# In Claude Code
curl -o ./images/hero.png [image_url_from_agent]

# Image generation is included with any ATXP account
npx atxp

# ~$0.04 per standard image, no separate API key

10 free IOU tokens on registration. Docs →

For more tools: How AI agents search the web with ATXP →


Frequently asked questions

How does image generation work with ATXP?

Call image_generate with a prompt. ATXP routes to the model, charges the IOU balance, returns the URL.

What model does ATXP use?

Routes to best-available — Stable Diffusion XL, DALL-E 3, Ideogram — depending on request type.

What does it cost?

~$0.04 per standard 1024x1024 image. Charged to IOU balance.

What resolutions are supported?

512x512, 1024x1024, 1792x1024 (landscape), 1024x1792 (portrait).

How do I save generated images?

Image URL is valid 24 hours. Pass to file_store for permanent storage or download with curl.

Can my agent generate images in a pipeline?

Yes — image generation is one tool call among many. What can an AI agent do for me? →