Pretty QR
来自 AI 助手的品牌 QR 码:可自定义颜色、渐变、徽标、边框,以及心形/房屋/地图图钉形状,支持导出为 PNG 或 SVG;还可交接至编辑器进行手动微调。远程可流式传输的 HTTP 端点:https://pretty-qr.com/api/mcp。身份验证:使用免费 pretty-qr.com 账户获取的 Bearer API 密钥。工具:list_templates、create_qr_code、open_in_editor、create_file_upload。
托管 MCP 服务器
npx add-mcp 'https://pretty-qr.com/api/mcp'可安装到 Claude Code、Codex、Cursor 等客户端
文档
Create QR codes from your own app. Send the content and a design, and get back the same PNG or SVG file that Download gives in the editor.
POSThttps://pretty-qr.com/api/v1/qr
Quick start
- Sign in. A free account includes 100 requests a month; Pro raises that to 10,000.
- Create a key on the API keys page and keep it somewhere safe: it is shown once.
- Set it as
PRETTY_QR_KEYand send your first request. This one savesqr.png:
curl https://pretty-qr.com/api/v1/qr \
-H "Authorization: Bearer $PRETTY_QR_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "https://example.com",
"design": {
"backgroundColor": "#ffffff",
"foregroundStyle": {
"colors": [
"#000000"
]
}
},
"format": "png"
}' \
-o qr.png
Authentication
Send the key as a bearer token: Authorization: Bearer pqr_…. A key keeps working if the account loses Pro, on the free allowance. Treat it like a password: keep it on your server, never in a web page or app that others can download. You can revoke a key on the API keys page at any time. A free account can hold 2 keys; Pro can hold 10.
Request
POST /api/v1/qr with a JSON body of three fields. Everything about the look lives in design, which uses the same options as the editor.
content stringrequired
What the code encodes: a URL or any text. At most 2331 bytes (UTF-8), or 1273 with a logo or the shield shape.
format stringrequired
png (2048 × 2048 px) or svg.
design objectrequired
How the code looks. Unknown fields are refused with a 400, so a typo never gives a different code.
design.backgroundColor stringrequired
Background colour as #rrggbb.
design.foregroundStyle.colors string[]required
Module colours as #rrggbb, 1 to 5. One colour draws a solid code. Two or more draw one gradient over the code and its shape, the colours evenly spaced.
design.foregroundStyle.type string
Gradient type: linear, radial. Default linear.
design.foregroundStyle.direction string
Linear gradients only, from the first colour to the last: top-bottom, left-right, top-left-bottom-right, top-right-bottom-left, bottom-top, right-left, bottom-right-top-left, bottom-left-top-right. Default top-bottom.
design.moduleShape string
square, circle, rounded, dot. Default square.
design.eyeShape string
Shape of the three corner squares: square, circle, rounded. Default square.
design.cornerRadius number
Rounds the code's background, 0 to 1000.
design.shape.type string
Silhouette: square, circle, heart, shield, house, pin. Silhouettes hold at most 213 bytes of content (119 with a logo or the shield).
design.logo object | null
A logo in the middle of the code. Omit it or send null for none.
design.logo.src stringrequired
Base64 data URL of a PNG, JPEG, WebP or SVG image. SVGs must not reference external files or contain scripts.
design.logo.size numberrequired
Share of the code's width, 0.1 to 0.5.
design.logo.margin numberrequired
Space around the logo, 0 to 50.
design.logo.hideBackgroundDots booleanrequired
Clear the modules behind the logo.
design.frame object | null
A frame around the code. Omit it or send null for none.
design.frame.enabled truerequired
Always true.
design.frame.borderWidth numberrequired
1 to 20.
design.frame.borderColor stringrequired
#rrggbb.
design.frame.padding numberrequired
8 to 48.
design.frame.cornerRadius numberrequired
0 to 240. The frame is drawn with at most the radius that keeps the code scannable and the label inside the frame: it depends on the frame type, padding and border width (for example rectangle 112 at padding 16, 240 at padding 48; banner 64 at padding 2). The coffee cup always has small corners.
design.frame.text object
Label: { "enabled": boolean, "content": string }, at most 24 characters. Shown on every frame except rectangle.
design.frame.outerColor string
Colour outside the frame, #rrggbb.
Fields under design.logo and design.frame marked required are required only when you send that object.
Response and errors
A 200 is the file itself: image/png (2048 × 2048 px) or image/svg+xml. Anything else is JSON with one field, { "error": "…" }, a sentence that says what to fix.
Limits
- Free: 100 requests per calendar month (UTC, resets on the 1st).
- Pro: 1,000 requests in any hour and 10,000 per calendar month (UTC), per account across all its keys.
- API requests and the MCP tools
create_qr_code,open_in_editorandcreate_file_uploadshare one count.list_templatesdoes not count. - Every counted request with a valid key counts, including ones that fail with 400 or 413. A request the quota refuses does not.
- Request bodies up to 1 MB, logo included.
- Requests are rendered one after another. Send them in sequence rather than hundreds at once, and retry a
503after a few seconds.
Examples
Each image is what the request next to it returns. Start from one and change the fields you need.

Banner frame with a label Rounded modules and eyes inside a banner frame that reads "SCAN ME".

Heart with a logo Heart silhouette, speech-bubble frame and an SVG logo sent as a data URL.

Coffee cup Circle silhouette with dot modules in a coffee-cup frame with an outer colour.
MCP
AI assistants such as Claude Code, Cursor and VS Code can make QR codes for you through the MCP server at https://pretty-qr.com/api/mcp. It takes the same API key and the same monthly allowance. Hosting a file with create_file_upload stays part of Pro.
claude mcp add --transport http pretty-qr https://pretty-qr.com/api/mcp \
--header "Authorization: Bearer $PRETTY_QR_KEY"
Tools
list_templates
Lists the templates with their id, name, description and a preview image. Does not count towards the quota.
create_qr_code
Returns the PNG or SVG file for content, a template id and design fields as in Request; design replaces the template's fields. Each call counts towards the quota.
open_in_editor
Saves the design to your account and returns a link that opens it in the editor, also listed in My designs. Each call counts towards the quota.
create_file_upload
Pro only. Hosts a photo, video, audio file or PDF for a hosted file QR code. Returns a one-time upload_url (30 minutes) and the file_url the file will have. Upload with curl --upload-file photo.jpg <upload_url>, then call create_qr_code with file_url as content. Up to 10 files per account; each call counts towards the quota.
Clients that only run local (stdio) servers can connect through mcp-remote. Connectors in claude.ai and ChatGPT need sign-in, which is not available yet.
Postman and OpenAPI
The Postman collection has every example on this page and the common errors, each with a test. To use it:
- In Postman, choose Import and drop in both the collection and the environment.
- Select the Pretty QR environment and paste your key into
apiKey. - Send a request. Use Send and Download to save the file.
The OpenAPI file describes the same request and responses. Import it into Insomnia, Bruno or any OpenAPI tool, or generate a client from it.
Questions or a field you need? Write to [email protected].