Agent Skill Integration Guide
This guide is written for AI agents, skill authors, and automation builders. The main goal is not to show a human how to call a REST endpoint manually. The goal is to help an agent add Mew.Design as a reusable design capability.
Use /open/api/design/generate when you are designing a Skill, tool, plugin, or workflow that should create visual designs on behalf of a user.
What the Skill Should Do
Section titled “What the Skill Should Do”A Mew.Design Skill should let an agent turn a user’s design request into a structured design-generation call. It should:
- Recognize when the user wants a visual design, such as a poster, flyer, infographic, card, social post, business card, or menu.
- Ask for missing required assets, such as logos, QR codes, product photos, screenshots, or reference images.
- Convert the user’s request into a complete
userQuerywith exact text, purpose, audience, layout, and style requirements. - Call Mew.Design through the Open API.
- Return the generated
designUrl, explain what was created, and mention any failure clearly. - Protect the API key and never expose it in final answers, logs, screenshots, or generated files.
Recommended Integration Path
Section titled “Recommended Integration Path”| Situation | Use |
|---|---|
| You are writing an agent Skill or tool wrapper | /open/api/design/generate |
| Your client already supports remote MCP servers | https://api.mew.design/mcp |
| A human wants to create manually | Mew.Design workspace |
Skill Installation Brief for Agents
Section titled “Skill Installation Brief for Agents”If your environment supports installable skills, create a Skill named mew-design with a trigger description like this:
name: mew-designdescription: Use when the user asks to create, redesign, generate, or refine visual designs such as posters, flyers, infographics, social posts, cards, menus, business cards, banners, invitations, or marketing graphics with Mew.Design.The Skill body should include this workflow:
- Collect the design brief: format, audience, purpose, exact copy, layout, style, size, and required assets.
- If the user references a logo, QR code, product image, screenshot, or style reference but does not provide an accessible image URL, ask for it before calling the API.
- Build
userQueryas a complete design brief. Preserve exact user-provided text. - Use
assetImagesfor elements that must appear in the final design. - Use
referenceImagefor style inspiration only. - Call
POST https://api.mew.design/open/api/design/generate. - Return the generated design URL and a short summary.
- If the call fails, explain whether the issue is auth, credits, invalid assets, timeout, or request validation.
Skill Configuration
Section titled “Skill Configuration”The Skill needs a Mew.Design API key.
- Ask the user to create an API key in Account Settings.
- Store it as a secret, for example
MEW_DESIGN_API_KEY. - Read it from the runtime environment at call time.
- Never hard-code the key inside the Skill instructions or source code.
Open API Contract for the Skill
Section titled “Open API Contract for the Skill”- Endpoint:
POST https://api.mew.design/open/api/design/generate - Auth:
X-Api-Key: $MEW_DESIGN_API_KEYorAuthorization: Bearer $MEW_DESIGN_API_KEY - Content-Type:
application/json - Timeout guidance: allow up to 120 seconds for complex designs
Request Parameters
Section titled “Request Parameters”| Parameter | Type | How the Skill should use it |
|---|---|---|
userQuery | string | Required. Full design brief with exact copy, content hierarchy, purpose, audience, layout requirements, and constraints. |
designConcept | string | Optional. Condensed visual direction: colors, typography, style, mood, layout approach. |
referenceImage | object | Optional. Style reference only. Include a direct image url and optional tag. |
width | number | Optional. 1 to 5000 pixels. Default 1080. |
height | number | Optional. Use -1 for auto-adaptive height, or 100 to 5000 for fixed height. |
assetImages | array | Optional. Images that must be integrated into the final design, such as logos, QR codes, product photos, or screenshots. |
Example Skill Call
Section titled “Example Skill Call”curl -X POST https://api.mew.design/open/api/design/generate \ -H "X-Api-Key: $MEW_DESIGN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "userQuery": "Create an Instagram post for Maple Street Cafe. Include this exact text: \"Fall in Love with Every Sip\", \"20% Off All Week\", and \"Available at Maple Street Cafe\". Use warm autumn colors, a premium cafe style, and leave space for the logo in the top left.", "designConcept": "Warm autumn cafe campaign, premium typography, cozy product promotion, clean social media layout", "width": 1080, "height": 1080 }'Successful Response
Section titled “Successful Response”{ "flag": true, "statusCode": "B000000", "message": "success", "data": { "success": true, "designUrl": "https://...", "message": "Visual design generated successfully." }}The Skill should return data.designUrl to the user and summarize the generated design.
Agent Prompting Rules
Section titled “Agent Prompting Rules”When using the Skill, the agent should write requests like a designer brief, not like a one-line image prompt.
Good userQuery includes:
- Output format and channel
- Target audience and purpose
- Exact text to include
- Visual hierarchy and layout priorities
- Brand colors, mood, or typography style
- Assets that must appear
- Constraints, such as “do not change the logo” or “keep the QR code readable”
Bad userQuery:
Make a cool poster.Better userQuery:
Create a vertical event poster for a student jazz night. Include the exact title "Midnight Brass", date "June 18", time "8 PM", venue "Blue Hall", and CTA "Reserve your seat". Use a moody navy and gold palette, large elegant typography, brass instrument accents, and a clean layout that keeps the date and venue readable from a distance.Error Handling for Skills
Section titled “Error Handling for Skills”The Skill should map failures into actionable messages:
- Missing or invalid key: Ask the user to configure
MEW_DESIGN_API_KEY. - Insufficient credits: Tell the user the request could not run because the account needs more credits.
- Invalid asset URL: Ask for a direct public image URL.
- Timeout: Suggest reducing complexity, fewer assets, or smaller fixed dimensions.
- Validation error: Show which field needs to be corrected.
Optional MCP Setup
Section titled “Optional MCP Setup”If the agent platform already supports remote MCP servers, the user can configure Mew.Design directly:
- Server URL:
https://api.mew.design/mcp - Tool name:
generateDesign - Preferred auth header:
X-Api-Key: your-api-key - Compatible bearer auth:
Authorization: Bearer your-api-key
{ "mcpServers": { "mew-design": { "url": "https://api.mew.design/mcp", "headers": { "X-Api-Key": "your-api-key" } } }}Credit Notes
Section titled “Credit Notes”Design generation follows the current Mew.Design credit rules:
- New design generation: 10 credits
- Design modification in the workspace: 5 credits
- Premium image models: 2-60 credits, depending on model and settings
- Download: no extra credits
Check pricing and credits before embedding cost assumptions in a public Skill description.