Images from an AI agent over MCP
Every operation is a tool. Point an agent at the server with your key and ask for the image.
Connect
One URL, your key as the bearer token.
Claude Code:
claude mcp add imageapis https://mcp.imageapis.com/ --header "Authorization: Bearer YOUR_KEY"
Cursor, Windsurf and others take the same URL in their MCP settings with an Authorization: Bearer YOUR_KEY header. A client that can only take a URL and no headers can use https://mcp.imageapis.com/k/YOUR_KEY instead; the key is lifted into a header at the edge and never logged.
What the agent sees
Seventeen tools, named after the API's operations: create_image, create_og_image, create_template, list_templates, update_template, create_pdf, create_screenshot, create_signed_base, list_fonts and the record readers. Each tool's description is the same text the docs show, with the request example, so the agent knows that a text layer has fit: "shrink" and that a PDF costs a unit per page.
Things to ask for
- "Make an Open Graph card for this post: title Launch week starts Monday, site example.com, dark theme. Give me the URL."
- "Design a 1200×630 template for product launch announcements with a title, a one-line subtitle, our logo top left and an accent bar. Use the Space Grotesk font. Then render it for Acme Widgets 2.0."
- "Screenshot https://example.com/pricing at 1280×800 and tell me if the plan names are visible."
- "Turn this HTML invoice into an A4 PDF with 20 mm margins and give me the link."
The agent calls the tool, gets the hosted URL back, and hands it to you. Costs are the same as the API: one image per render, free for template work.
Keeping an agent on a budget
Every tool result carries the gateway's plan headers, so the agent can see X-Gw-Remaining and stop before a 429. A free key is 150 images a month, which is a sensible sandbox for an agent you are still supervising; give it a paid key when its templates are settled.