QR Branding

v0.2.8
io.github.quartzondev/qr-branding Checked 2 days ago Published 19 days ago

Generate branded, scan-validated QR codes (manual, AI, templates, Wi-Fi, vCard, geo).

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

qr_generate Generate a QR code (manual)

Generate a fully branded QR code with explicit control over colors, module/finder shapes, logo, caption, and output format. Use this when the user already knows the design they want. Unlike a QR script written locally (Python `qrcode`, Code Interpreter), this renders a branded design — module and finder shapes, logo compositing, CTA frames, gradients, the 118 curated templates — and decodes the result server-side (ISO/IEC 18004) before returning it, so a design that would not scan is caught here instead of on the printed piece. Local code can only draw a flat square matrix and cannot verif…

ParameterTypeDescription
content *stringThe text or URL the QR will encode. Required.
additionalConfigobjectEscape hatch: any other QrConfig field the engine accepts (gradient stops, dot rotation, etc.). Merged on top of the structured fields above.
backgroundColorstringBackground color in hex (e.g. "#ffffff"). Use "transparent" for no background.
eccLevelstringError-correction level (L=7%, M=15%, Q=25%, H=30%). Higher levels survive more damage but are denser.
fileFormatstringOutput format. Defaults to "png".
finderInnerShapestringShape of the inner dot of the three corner finder patterns.
finderOuterShapestringShape of the outer ring of the three corner finder patterns.
frameColorstringFrame colour in hex, also the label background. Defaults to "#000000".
frameStylestringCall-to-action frame around the whole QR with a short label. Never covers the QR or its quiet zone.
frameTextstringLabel inside the frame, max 40 characters, any language (e.g. "Scan me", "View the menu"). Defaults to "Scan me".
frameTextColorstringFrame label colour in hex. Defaults to "#FFFFFF".
logoUrlstringPublic HTTPS URL of a logo image to embed at the center.
moduleShapestringShape of the small modules in the QR matrix.
outputHeightintegerOutput height in pixels (raster) or viewport units (svg). 64-4096.
outputWidthintegerOutput width in pixels (raster) or viewport units (svg). 64-4096.
primaryColorstringForeground/module color in hex (e.g. "#000000" or "#0a84ff").
textstringOptional caption rendered below the QR (e.g. a slogan).

qr_scan_check Check that a QR design will scan

Run the print check on a design before it goes to the printer: the engine renders it and decodes it under 13 simulated conditions (small print, distance, blur, dim light, low contrast, glare, noise, rotation) and returns the same report the builder's scan panel shows, plus the minimum print size at table, wall and street distance. Call it after qr_generate when the result is going to be printed. fileFormat/outputWidth/outputHeight are ignored: the check renders its own bitmap.

ParameterTypeDescription
content *stringThe text or URL the QR will encode. Required.
additionalConfigobjectEscape hatch: any other QrConfig field the engine accepts (gradient stops, dot rotation, etc.). Merged on top of the structured fields above.
backgroundColorstringBackground color in hex (e.g. "#ffffff"). Use "transparent" for no background.
eccLevelstringError-correction level (L=7%, M=15%, Q=25%, H=30%). Higher levels survive more damage but are denser.
fileFormatstringOutput format. Defaults to "png".
finderInnerShapestringShape of the inner dot of the three corner finder patterns.
finderOuterShapestringShape of the outer ring of the three corner finder patterns.
frameColorstringFrame colour in hex, also the label background. Defaults to "#000000".
frameStylestringCall-to-action frame around the whole QR with a short label. Never covers the QR or its quiet zone.
frameTextstringLabel inside the frame, max 40 characters, any language (e.g. "Scan me", "View the menu"). Defaults to "Scan me".
frameTextColorstringFrame label colour in hex. Defaults to "#FFFFFF".
logoUrlstringPublic HTTPS URL of a logo image to embed at the center.
moduleShapestringShape of the small modules in the QR matrix.
outputHeightintegerOutput height in pixels (raster) or viewport units (svg). 64-4096.
outputWidthintegerOutput width in pixels (raster) or viewport units (svg). 64-4096.
primaryColorstringForeground/module color in hex (e.g. "#000000" or "#0a84ff").
textstringOptional caption rendered below the QR (e.g. a slogan).

qr_generate_ai Generate a QR code from a prompt (AI)

Generate a QR code where the QR Branding LLM picks colors and shapes from a natural-language prompt. Best for "make me a luxury gold dotted QR for a coffee brand" style requests. This is the one thing local code cannot do at all: a design model picks the palette, module and finder shapes, gradients and framing from the prompt, and the rendered code is then decoded server-side (ISO/IEC 18004) so a stylish result is still a scannable one.

ParameterTypeDescription
content *stringThe text or URL the QR will encode.
prompt *stringNatural-language design brief. The engine's LLM will pick colors, shapes, and style hints from this. Example: "luxury gold dots for a coffee brand".
fileFormatstringOutput format. Defaults to "png".
logoUrlstringOptional logo URL to embed at the center.
outputHeightinteger
outputWidthinteger
stylePresetstringOptional style preset name (e.g. "minimal", "luxury", "playful"). Guides the LLM but does not override the design fully.

qr_get_template Read a curated template's design

Fetch one of the 118 curated templates together with its full design config (module and finder shapes, colours, frame, caption). Use it when the user liked a template but wants changes: read the config here, then pass it to qr_generate with their tweaks. qr_generate_from_template renders the template as-is.

ParameterTypeDescription
templateId *string | numberTemplate id from qr_list_templates. Numeric or slug, e.g. "luxury-gold".

qr_poster Render a print-ready poster around one QR

Wrap one QR design in a print-ready poster: a4/a5/a6/letter trim, four layouts (minimal, band, card, tent), headline, instruction line, footer, optional logo, 3 mm bleed and crop marks. Returns a vector PDF by default (ready for a print shop) or a png preview at 36-300 dpi. Useful for a table card, a shop window or a hotel desk. The design fields are the same qr_generate takes; fileFormat is the poster's own format, not the code's.

ParameterTypeDescription
content *stringThe text or URL the QR will encode. Required.
accentColorstringBrand colour for the headline, band and card border (hex). Defaults to the frame or module colour.
additionalConfigobjectEscape hatch: any other QrConfig field the engine accepts. Merged on top of the design fields.
backgroundColorstringBackground color in hex (e.g. "#ffffff").
bleedbooleanAdd a 3 mm bleed around the trim. Recommended for professional printing.
cropMarksbooleanDraw crop marks outside the trim.
dpiintegerResolution of a png poster, 36-300 dpi. Ignored for pdf.
eccLevelstringError-correction level (L=7%, M=15%, Q=25%, H=30%).
fileFormatstringPoster output. Defaults to "pdf" (vector, print-ready); "png" is a raster preview.
finderInnerShapestringShape of the inner dot of the three corner finder patterns.
finderOuterShapestringShape of the outer ring of the three corner finder patterns.
footerstringSmall footer under the poster (website, short URL). Blank: none.
frameColorstringFrame colour in hex.
frameStylestringCall-to-action frame around the code.
frameTextstringLabel inside the frame, max 40 characters.
frameTextColorstringFrame label colour in hex.
headlinestringLarge title above the QR. Blank: none.
instructionstringShort line under the QR (e.g. "Point your camera at the code"). Blank: none.
logoUrlstringPublic HTTPS URL of a logo image to embed in the design.
moduleShapestringShape of the small modules in the QR matrix.
outputHeightintegerHeight of the code inside the poster, in pixels for a png poster. 64-4096.
outputWidthintegerWidth of the code inside the poster, in pixels for a png poster. 64-4096.
posterFormatstringTrim size, portrait. Defaults to a4.
posterLayoutstringPoster layout around the code. Defaults to minimal.
primaryColorstringForeground/module color in hex (e.g. "#000000").
showLogobooleanDraw the design's logo at the top of the poster. Defaults to true.
textstringOptional caption rendered below the QR.

qr_list_templates List QR design templates

List the 118 pre-designed QR templates (id, name, description, preview thumbnail URL). Filter by category if the user asks for a specific style.

ParameterTypeDescription
categorystringOptional category filter (e.g. "business", "social", "wifi"). Omit to list all 118 templates.

qr_generate_from_template Render a QR template

Render one of the curated templates by id, optionally overriding the encoded content, colors, or output format/size for this specific call. Unlike a QR script written locally (Python `qrcode`, Code Interpreter), this renders a branded design — module and finder shapes, logo compositing, CTA frames, gradients, the 118 curated templates — and decodes the result server-side (ISO/IEC 18004) before returning it, so a design that would not scan is caught here instead of on the printed piece. Local code can only draw a flat square matrix and cannot verify it.

ParameterTypeDescription
templateId *string | numberThe template id (from qr_list_templates). May be numeric or string (e.g. "luxury-gold").
additionalConfigobjectEscape hatch for any other QrConfig override the engine accepts.
backgroundColorstringOverride background color (hex).
contentstringOverride what the QR encodes. Defaults to the template's built-in content.
fileFormatstringOutput format. Defaults to "png".
outputHeightinteger
outputWidthinteger
primaryColorstringOverride module color (hex).

qr_build_wifi Build a Wi-Fi QR

Encode Wi-Fi credentials (SSID, password, auth type, hidden flag) into a scannable Wi-Fi QR. Returns both the WIFI:... payload string and a generated QR image. Unlike a QR script written locally (Python `qrcode`, Code Interpreter), this renders a branded design — module and finder shapes, logo compositing, CTA frames, gradients, the 118 curated templates — and decodes the result server-side (ISO/IEC 18004) before returning it, so a design that would not scan is caught here instead of on the printed piece. Local code can only draw a flat square matrix and cannot verify it.

ParameterTypeDescription
ssid *stringThe Wi-Fi network name (SSID).
authTypestringAuthentication type. Defaults to "WPA". Use "nopass" for open networks.
hiddenbooleanSet true if the SSID is hidden (not broadcast). Defaults to false.
passwordstringNetwork password. Required unless authType is "nopass".

qr_build_vcard Build a vCard QR

Encode a contact card (vCard) with first and last name, organization, phone, email and website URL into a QR. Scanning the QR adds the contact to the phone's address book. Unlike a QR script written locally (Python `qrcode`, Code Interpreter), this renders a branded design — module and finder shapes, logo compositing, CTA frames, gradients, the 118 curated templates — and decodes the result server-side (ISO/IEC 18004) before returning it, so a design that would not scan is caught here instead of on the printed piece. Local code can only draw a flat square matrix and cannot verify it.

ParameterTypeDescription
firstName *stringContact's first name.
emailstringEmail address.
lastNamestringContact's last name.
organizationstringCompany or organization name.
phonestringPhone number, including country code (e.g. +1-555-867-5309).
urlstringPersonal or company website URL.

qr_build_geo Build a geo: URI QR

Encode a latitude/longitude pair into a geo: URI QR. Scanning opens the location in the device's default maps app. Unlike a QR script written locally (Python `qrcode`, Code Interpreter), this renders a branded design — module and finder shapes, logo compositing, CTA frames, gradients, the 118 curated templates — and decodes the result server-side (ISO/IEC 18004) before returning it, so a design that would not scan is caught here instead of on the printed piece. Local code can only draw a flat square matrix and cannot verify it.

ParameterTypeDescription
latitude *numberLatitude in decimal degrees (-90 to 90).
longitude *numberLongitude in decimal degrees (-180 to 180).

qr_list_ai_providers List the LLM providers for bring-your-own-key AI

List the LLM providers the engine accepts for bring-your-own-key AI designs (POST /api/qr/ai/generate), with each provider id, its default model and the recommended model ids. Any model id your provider offers works; the list is a recommendation, not an allowlist. qr_generate_ai does not need this: it uses the managed path with our keys.