WanGogh

API

A confirmed account draws one image per request. The key is created in the profile and shown once. The cabinet on the site still draws two images and does not use this key.

One request
1 image
Price
1 cent
Pause
5 seconds

The balance starts at zero. There is no top-up in the API. There is no other quota. An API image is not sent through content moderation. An adult request is written and drawn as asked, without softening. A sexual context with a child is refused before any picture. If the order is refused before a picture exists, the cent comes back.

After drawing, the picture is checked for anatomy: five fingers on an open hand, two claws on a crab, and the same kind of visible count. A wrong count is drawn once more. A part the request asked to remove is not treated as an error. While this runs, status is checking.

Key

Send it on every request: Authorization: Bearer wg_…. A new key in the profile replaces the old one at once.

Create an image

POST https://api.wangogh.art/api/v1/images

Body is JSON. Content-Type: application/json.

curl -sS https://api.wangogh.art/api/v1/images \
  -H "Authorization: Bearer wg_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"A red bicycle on an empty street at dusk","style":"plain","ratio":"9:16","creativity":4}'
  • text is required, from 25 to 1500 characters. Spaces count.
  • style is plain, real, art, anime, fantasy, water, cinema or oil. Empty means plain.
  • ratio is 9:16, 16:9, 1:1, 4:5, 5:4, 3:4, 4:3, 2:3 or 3:2. Empty means 9:16.
  • creativity is an integer from 0 to 10. Empty means 4.

An accepted request answers 202 with id, status, price_cents, balance_cents and image. Until the file exists, image is null.

Status and file

GET /api/v1/images/{id}

The same key. status moves through queued, reading, waiting_card and drawing, then ready or refused. When the largest copy is ready, image is /api/v1/images/{id}/file. That address returns one PNG at the largest size and needs the same key. It does not return WebP, JPEG or a smaller file. Until that copy exists, the address answers 404 with code not_ready and image is null. The picture does not appear in the cabinet. The file is kept for 48 hours after the request. After that the address answers 404 with code expired.

GET /api/v1/balance

Returns balance_cents, spent_cents, price_cents and pace_sec. This call does not draw and does not charge.

Errors

401
The key is missing, or the mailbox is not confirmed.
402
The balance is below 1 cent. The order is not created.
429
The previous accepted request was less than 5 seconds ago.
400
The text, style or ratio cannot be drawn. The balance is not charged.
404
This key has no such image, the full PNG is not ready yet, or 48 hours have passed since the request.