feat: banatie script

This commit is contained in:
2026-02-24 00:21:54 +07:00
parent 7a6bd81d9e
commit 5a854479f9
2 changed files with 59 additions and 32 deletions
+13 -4
View File
@@ -150,12 +150,21 @@ When generating HTML worksheets:
## Banatie API
REST API for generating images.
REST API at `https://api.banatie.app` for generating images. Auth via `X-API-Key` header (reads `BANATIE_KEY` from `.env`).
- **Backgrounds:** ~1200×1700px, themed illustrations (forest, space, ocean, etc.)
- **Icons:** 128×128px, transparent PNG, simple collectible items (stars, gems, animals)
**POST `/api/v1/generations`** — create generation:
- `prompt` (string, required) — image description
- `aspectRatio` — `1:1`, `16:9`, `9:16`, `3:2`, `21:9` (default: `1:1`)
- `referenceImages` (string[]) — image IDs as references
- `autoEnhance` (boolean) — prompt enhancement (default: true)
Configuration is in `src/scripts/banatie.mjs`. Set the `BANATIE_API_KEY` environment variable for authentication.
Response returns JSON with `data.outputImage.storageUrl` (CDN URL to download).
Script `src/scripts/banatie.mjs` wraps the API with presets:
- `background` → `aspectRatio: "9:16"` (vertical, for page backgrounds)
- `icon` → `aspectRatio: "1:1"` (square, for problem card icons)
Rate limit: 100 requests/hour per API key.
## Background Removal