QRdx
HelpGuidesDevelopersReact librarySelf-hosting

Generate AI QR art

Paints a QR code into AI artwork from your description and checks that the image scans. Where the model's image doesn't scan as drawn, QRdx strengthens the code just enough, on the model's own pixels (blend says how). It's the same AI art as the playground's Art tab and the AI art studio.

Credits. Each image uses one from the monthly AI art allowance of the workspace the key acts on, the same allowance as the app: 3 on Free, 30 on Pro and 150 on Business, shared by the team. A failed call is refunded. Each person can also make at most 25 a day. credits in the response shows what's left.

Timing. A call takes about 15 to 45 seconds in code mode, 25 to 45 in photo mode and 40 to 55 in scene mode (it makes its picture first), and gives up before a minute without using a credit: a scene that runs out of time answers AI_ART_TIMEOUT, so try again or use code mode. Set your HTTP client's timeout to at least 60 seconds.

What it encodes. Send text, or a dynamic code's code (its id) to encode its short link, so you can change where it goes later and its scans are counted. A code in another workspace is a 404.

Response. JSON with the image as a data: URL, or the PNG itself with ?format=png or Accept: image/png (seed, mode and blend then come as X-QRdx-Seed, X-QRdx-Mode, X-QRdx-Blend, X-QRdx-Blend-Strength and X-QRdx-Credits-Remaining headers). Nothing is stored, and photos and reference images are discarded after the call. AI art API.

Scope: codes:write, for API keys and OAuth tokens alike.

POST
/art

Authorization

headerAuthorizationBearer <qrdx_ followed by 40 letters and digits>

An API key, sent as Authorization: Bearer qrdx_…. Create one in Settings → API keys & apps: it is shown once. A key acts on the workspace it was created in as its creator, with their current role there, and only within its scopes, the same scopes as OAuth (each operation names the one it needs). API keys.

Query Parameters

format?string

json (default) or png for the image's bytes. Accept: image/png does the same.

Value in"json""png"

Request Body

application/json
  1. body

Send exactly one of text and code.

text?string

What the code encodes: a link or text, up to 300 characters. Send this or code.

Length1 <= length <= 300
code?string

The id of one of the workspace's dynamic codes, in place of text: the art encodes its short link, so you can change where it goes after printing and its scans are counted.

Length1 <= length <= 64
prompt?string

The artwork to paint, in plain words, at least 3 characters when sent. Leave it out and QRdx writes one for the mode, look and photo you sent; the response then includes it as writtenPrompt.

Lengthlength <= 400
negativePrompt?string

What to keep out of the picture.

Lengthlength <= 300
visibility?integer

QR visibility, 0 to 100 in steps of 5: higher shows the code more clearly, lower favors the picture.

Range0 <= value <= 100
Default50
creativity?integer

0 follows the prompt literally, 100 interprets it freely.

Range0 <= value <= 100
Default45
seed?integer

Send a seed again for a similar image. Random when left out.

Range0 <= value <= 4294967295
reference?string

A reference image for colors and shapes, such as a logo or a palette: a PNG or JPEG data: URL, downsized to about 512 px. It goes to the model and is discarded.

Lengthlength <= 819232
mode?string

How the code sits in the art: code paints the art into the code's modules; scene paints a picture from the description first, then paints the code into its middle, so the picture runs through the code; photo does the same with your photo as the picture.

Default"code"
Value in"code""scene""photo"
style?string

A quick look by its id, combined with your prompt. The AI art API docs list them.

Value in"watercolor""oil-painting""anime""cartoon""pixel-art""pop-art""charcoal""ink""cyberpunk""fantasy""photographic""low-poly""papercut"
photo?string

Photo mode only: your picture as a PNG or JPEG data: URL, cropped square and downsized to about 1024 px (at most 1 MB). It goes to the model and is discarded.

Lengthlength <= 1398134
picture?string
Match^[A-Za-z0-9_-]+$
Lengthlength <= 1399126

Response Body

The image. Cache-Control: no-store.

  1. response
data*
credits*|

The workspace's AI art allowance after this image

curl -X POST 'https://api.qrdx.dev/v1/art' \  -H 'Content-Type: application/json' \  -d '{  "text": "https://qrdx.dev",  "prompt": "a koi pond at dusk, ink and watercolor"}'
Example Response
{  "data": {    "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAIAAADwf7zU…",    "width": 1024,    "height": 1024,    "seed": 2841337190,    "mode": "code",    "blend": "least",    "blendStrength": 0.35,    "text": "https://qrdx.dev/q/aB3dE5f",    "code": {      "id": "cm5code0spring0menu00001",      "shortLink": "https://qrdx.dev/q/aB3dE5f"    },    "visibility": 50,    "creativity": 45  },  "credits": {    "plan": "pro",    "limit": 30,    "used": 7,    "remaining": 23,    "pooled": false,    "resetsAt": "2026-02-01T00:00:00.000Z"  }}

Last updated on