Quick start
Send a POST request to /quote/generate with a JSON body containing at least one message.
POST /quote/generate
Content-Type: application/json
{
"messages": [
{
"from": {"id": 1, "name": "Test User", "photo": {}},
"text": "Hello world!"
}
]
}Request
The request is a JSON object. Query-string and body properties are merged by the API middleware.
| Field | Type | Description |
|---|---|---|
messages | array | Required list of quote messages. |
backgroundColor | string | Background color for the generated quote. |
type | string | quote, image, or stories. Omit for raw canvas. |
width / height | number | Output dimensions. |
scale | number | Rendering scale. |
emojiBrand | string | Emoji rendering brand. |
format | string | png or webp for the generated image format. |
Message object
Each entry in messages describes sender information and message text. Optional reply and media data are supported by the renderer.
| Field | Type | Description |
|---|---|---|
from | object | Sender information, including id, first_name, last_name, name, username, and photo data. |
text | string | Message text. |
avatar | boolean | Whether the avatar is rendered. |
replyMessage | object | Optional replied-to message information. |
media | object | Optional media information. |
entities | array | Optional Telegram-style message entities. |
Response
Without an extension, the API returns a JSON envelope containing the generated image. With .png or .webp, it returns image bytes directly.
{
"ok": true,
"result": {
"image": "<base64 image data>"
}
}Direct image responses also expose quote metadata through response headers.
Errors
Invalid or missing requests return an error envelope with HTTP 400. Known generator errors include query_empty, messages_empty, and empty_messages. Unknown API methods return method not found.
The current server limits requests to 20 per IP over a 55-second window. A configured bot token is whitelisted by the rate-limit middleware.