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.
API
Подтверждённый кабинет рисует один кадр на запрос. Ключ выпускается в профиле и показывается один раз. Кабинет на сайте по-прежнему рисует два кадра и этот ключ не использует.
- Один запрос
- 1 кадр
- Цена
- 1 цент
- Пауза
- 5 секунд
Баланс начинается с нуля. Пополнения в API нет. Другого лимита нет. Кадр API не идёт на модерацию содержания. Взрослый заказ пишется и рисуется как просили, без смягчения. Детский сексуальный контекст закрывается до картинки. Если заказ закрыт отказом до картинки, цент возвращается.
После рисунка кадр проверяют на счёт частей: пять пальцев на открытой руке, две клешни у краба и такой же видимый счёт. Неверный счёт рисуется один раз заново. Часть, которую просили убрать, ошибкой не считается. Пока идёт проверка, status равен checking.
Ключ
Его нужно слать с каждым запросом: Authorization: Bearer wg_…. Новый ключ в профиле сразу гасит старый.
Создать кадр
POST https://api.wangogh.art/api/v1/images
Тело — 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 обязателен, от 25 до 1500 знаков. Пробелы входят.
style: plain, real, art, anime, fantasy, water, cinema, oil. Пустое — plain.
ratio: 9:16, 16:9, 1:1, 4:5, 5:4, 3:4, 4:3, 2:3, 3:2. Пустое — 9:16.
creativity — целое от 0 до 10. Пустое — 4.
Принятый запрос отвечает 202: id, status, price_cents, balance_cents и image. Пока файла нет, image равен null.
Статус и файл
GET /api/v1/images/{id}
Тот же ключ. status идёт queued, reading, waiting_card, drawing, затем ready или refused. Когда готова самая крупная копия, image равен /api/v1/images/{id}/file. Этот адрес отдаёт один PNG максимального размера и требует тот же ключ. WebP, JPEG и файл меньше он не отдаёт. Пока такой копии нет, адрес отвечает 404 с кодом not_ready, а image равен null. В кабинете этого кадра нет. Файл хранится 48 часов после запроса. Дальше адрес отвечает 404 с кодом expired.
GET /api/v1/balance
Отдаёт balance_cents, spent_cents, price_cents и pace_sec. Этот запрос не рисует и денег не берёт.
Ошибки
- 401
- Нет ключа или ящик не подтверждён.
- 402
- На балансе меньше цента. Заказ не создаётся.
- 429
- С прошлого принятого запроса не прошло 5 секунд.
- 400
- Текст, стиль или пропорция не подходят. Деньги не списываются.
- 404
- Такого кадра у этого ключа нет, полный PNG ещё не готов или с запроса прошло 48 часов.
API
Ein bestätigtes Studio zeichnet ein Bild je Anfrage. Der Schlüssel entsteht im Profil und wird einmal gezeigt. Das Studio auf der Seite zeichnet weiter zwei Bilder und benutzt diesen Schlüssel nicht.
- Eine Anfrage
- 1 Bild
- Preis
- 1 Cent
- Pause
- 5 Sekunden
Das Guthaben beginnt bei null. Eine Aufladung gibt es in der API nicht. Ein weiteres Limit gibt es nicht. Ein API-Bild geht nicht durch eine Inhaltsmoderation. Ein Auftrag eines Erwachsenen wird geschrieben und gezeichnet, wie er gestellt wurde, ohne Abmilderung. Ein sexueller Kontext mit einem Kind wird vor dem Bild abgelehnt. Wird der Auftrag vor dem Bild abgelehnt, kommt der Cent zurück.
Nach dem Zeichnen wird die Anatomie gezählt: fünf Finger an einer offenen Hand, zwei Scheren bei einem Krebs und dieselbe Art sichtbarer Zählung. Eine falsche Zahl wird einmal neu gezeichnet. Ein Teil, den der Auftrag entfernen wollte, gilt nicht als Fehler. Währenddessen ist status gleich checking.
Schlüssel
Er geht mit jeder Anfrage mit: Authorization: Bearer wg_…. Ein neuer Schlüssel im Profil löscht den alten sofort.
Ein Bild erstellen
POST https://api.wangogh.art/api/v1/images
Der Körper ist 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 ist nötig, 25 bis 1500 Zeichen. Leerzeichen zählen.
style ist plain, real, art, anime, fantasy, water, cinema oder oil. Leer heißt plain.
ratio ist 9:16, 16:9, 1:1, 4:5, 5:4, 3:4, 4:3, 2:3 oder 3:2. Leer heißt 9:16.
creativity ist eine ganze Zahl von 0 bis 10. Leer heißt 4.
Eine angenommene Anfrage antwortet mit 202: id, status, price_cents, balance_cents und image. Solange keine Datei da ist, ist image null.
Status und Datei
GET /api/v1/images/{id}
Derselbe Schlüssel. status geht durch queued, reading, waiting_card und drawing, dann ready oder refused. Ist die größte Kopie fertig, ist image gleich /api/v1/images/{id}/file. Diese Adresse gibt ein PNG in der größten Größe und braucht denselben Schlüssel. WebP, JPEG und eine kleinere Datei gibt sie nicht. Solange diese Kopie fehlt, antwortet die Adresse mit 404 und dem Code not_ready, und image ist null. Im Studio erscheint das Bild nicht. Die Datei bleibt 48 Stunden nach der Anfrage. Danach antwortet die Adresse mit 404 und dem Code expired.
GET /api/v1/balance
Liefert balance_cents, spent_cents, price_cents und pace_sec. Dieser Aufruf zeichnet nicht und bucht nichts ab.
Fehler
- 401
- Der Schlüssel fehlt, oder das Postfach ist nicht bestätigt.
- 402
- Das Guthaben liegt unter 1 Cent. Der Auftrag entsteht nicht.
- 429
- Seit der letzten angenommenen Anfrage sind keine 5 Sekunden vergangen.
- 400
- Text, Stil oder Seitenverhältnis passen nicht. Es wird nichts abgebucht.
- 404
- Dieser Schlüssel hat kein solches Bild, das volle PNG ist noch nicht fertig, oder seit der Anfrage sind 48 Stunden vergangen.
API
Un estudio confirmado dibuja una imagen por solicitud. La clave se crea en el perfil y se muestra una vez. El estudio del sitio sigue dibujando dos imágenes y no usa esta clave.
- Una solicitud
- 1 imagen
- Precio
- 1 centavo
- Pausa
- 5 segundos
El saldo empieza en cero. En la API no hay recarga. No hay otro límite. Una imagen de la API no pasa por moderación de contenido. Un pedido de un adulto se escribe y se dibuja como se pidió, sin suavizarlo. Un contexto sexual con un niño se cierra antes de la imagen. Si el pedido se cierra antes de que exista la imagen, el centavo vuelve.
Después del dibujo se cuenta la anatomía: cinco dedos en una mano abierta, dos pinzas en un cangrejo y el mismo tipo de cuenta visible. Un número incorrecto se dibuja una vez más. Una parte que el pedido pidió quitar no cuenta como error. Mientras tanto, status es checking.
Clave
Va en cada solicitud: Authorization: Bearer wg_…. Una clave nueva en el perfil apaga la anterior al momento.
Crear una imagen
POST https://api.wangogh.art/api/v1/images
El cuerpo es 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 es obligatorio, de 25 a 1500 caracteres. Los espacios cuentan.
style es plain, real, art, anime, fantasy, water, cinema u oil. Vacío significa plain.
ratio es 9:16, 16:9, 1:1, 4:5, 5:4, 3:4, 4:3, 2:3 o 3:2. Vacío significa 9:16.
creativity es un entero de 0 a 10. Vacío significa 4.
Una solicitud aceptada responde 202 con id, status, price_cents, balance_cents e image. Mientras no hay archivo, image es null.
Estado y archivo
GET /api/v1/images/{id}
La misma clave. status pasa por queued, reading, waiting_card y drawing, y luego ready o refused. Cuando la copia más grande está lista, image es /api/v1/images/{id}/file. Esa dirección devuelve un PNG del mayor tamaño y pide la misma clave. No devuelve WebP, JPEG ni un archivo más pequeño. Mientras esa copia no existe, la dirección responde 404 con el código not_ready, e image es null. La imagen no aparece en el estudio. El archivo se guarda 48 horas después de la solicitud. Después la dirección responde 404 con el código expired.
GET /api/v1/balance
Devuelve balance_cents, spent_cents, price_cents y pace_sec. Esta llamada no dibuja y no cobra.
Errores
- 401
- Falta la clave, o el correo no está confirmado.
- 402
- El saldo está por debajo de 1 centavo. El pedido no se crea.
- 429
- No han pasado 5 segundos desde la solicitud aceptada anterior.
- 400
- El texto, el estilo o la proporción no sirven. No se cobra.
- 404
- Esta clave no tiene esa imagen, el PNG completo aún no está listo, o han pasado 48 horas desde la solicitud.