Skip to main content
Hagaki Renderer exposes a small HTTP API for rendering card game assets to PNG. All three endpoints follow the same pattern: encode a JSON payload as a base64 standard no-pad string, then pass it as a path segment.

Base URL

The service listens on port 8899.
http://<host>:8899
Hagaki Renderer has no built-in authentication. Expose it only on a private network or behind a reverse proxy that enforces access control.

Endpoints

MethodPathDescription
GET/render/card/{hash}Render a single card image
GET/render/fan/{hash}Render multiple cards in a fan layout
GET/render/album/{hash}Render multiple cards in a grid layout
Any request to an unrecognised path returns 418 I'm a Teapot.

Hash encoding

Each {hash} path segment is a base64 standard alphabet, no-padding encoding of a JSON payload.
  1. Serialise your request struct to JSON.
  2. UTF-8 encode the JSON string to bytes.
  3. Encode the bytes with base64 standard alphabet (+ and /), no padding (= stripped).
  4. Place the result directly in the URL path.
See Hash encoding for full details and examples in multiple languages.

Response format

A successful response is raw PNG bytes with Content-Type: image/png. There is no JSON wrapper.

Response headers

HeaderExample valueDescription
Content-Typeimage/pngAlways PNG
X-Sourcerendered on requestHow the image was produced. Also loaded from disk cache when served from a saved file.
X-Processing-Time12.345msWall-clock time for the operation, in milliseconds.

Error codes

StatusDescription
400 Bad RequestThe {hash} could not be base64-decoded, or the decoded JSON does not match the expected request structure.
418 I'm a TeapotThe request path is not recognised.
500 Internal Server ErrorA render pipeline error occurred — invalid frame type, missing or undecodable asset, buffer write failure, or a render that exceeded the 5-second timeout.
There is no built-in rate limiting. If you need rate limiting, configure it at the reverse proxy layer.

Build docs developers (and LLMs) love