Skip to content
Masko logomasko
Docs
Documentation

Create from a Brand Book

Send your brand book and get a mascot back: its views from every angle as references, and its description, colors, style, don'ts and props in its context. New images of the mascot then follow the brand book.

Create the mascot

Send the brand book as public links or as images you uploaded with POST /v1/upload, in reading order:

  • a PDF up to 50 MB;
  • PNG, JPEG or WebP pages up to 10 MB each;
  • at most 30 pages in total.
curl -X POST https://api.masko.ai/v1/mascots/from-brand-book \
  -H "Authorization: Bearer masko_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "PROJECT_ID",
    "files": [{ "url": "https://example.com/brand-book.pdf" }],
    "max_credits": 17
  }'
FieldRequiredDescription
project_idYesProject the mascot is created in.
filesYesEach file is { "url": "..." } or { "asset_id": "..." }, with an optional name.
nameNoMascot name. By default, the name written in the brand book.
max_creditsNoSpending cap, from 1 to 17.

Send a PDF from your computer

A PDF that is not online goes straight to storage with a signed upload URL, so its size is not limited by the API request. Ask for the URL, upload the file to it, then pass its asset_id:

curl -X POST https://api.masko.ai/v1/upload \
  -H "Authorization: Bearer masko_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "content_type": "application/pdf", "size": 31759881, "file_name": "brand-book.pdf" }'

# PUT the file with the returned upload_headers before expires_at (15 minutes)
curl -X PUT "UPLOAD_URL" \
  -H "Content-Type: application/pdf" \
  -H "x-goog-content-length-range: 0,52428800" \
  --data-binary @brand-book.pdf

Then call POST /v1/mascots/from-brand-book with "files": [{ "asset_id": "ASSET_ID" }]. Storage refuses a file above 50 MB, and a call made before the upload finishes returns 400.

Wait for the mascot

Poll the job. step reports where it is: pages while files become pages, read during the free reading, generate while views and props are drawn, and mascot while its context is filled. It takes about 2 to 4 minutes.

curl "https://api.masko.ai/v1/jobs/JOB_ID?wait=true&timeout=120" \
  -H "Authorization: Bearer masko_YOUR_API_KEY"

Use result.mascot_id with every other mascot endpoint, for example POST /v1/mascots/{id}/generate. A prop is added to a new image only when its prompt asks for it.

What it costs

Reading the brand book is free. Each mascot view and each prop it finds is then drawn as a clean image for 1 credit, at most 5 views and 12 props, so at most 17 credits. Each image that fails is refunded.

The job stops after the free reading, with nothing charged, when:

  • the brand book has no mascot;
  • it costs more than max_credits;
  • your balance is too low.

The job's error gives the reason and the price. Each account can read 15 brand books per day.

Tips

  • A link must be public: a signed storage URL works, a page behind a login does not.
  • Page images can also be uploaded one by one with POST /v1/upload and sent as asset_ids, in reading order.
  • Send an Idempotency-Key header to retry the call without starting a second job.