Skip to content
Masko logomasko
Docs
Documentation

Create from Text

Describe your mascot and pick a style - the API generates the reference image.

Two Approaches

You can either preview multiple variations first (recommended) or create a mascot directly in a single call. Each generated preview costs 1 credit; requesting four successful previews costs 4 credits. Direct creation auto-generates one reference for 1 credit and builds the mascot immediately. If generation, storage or saving the mascot fails, that credit is refunded. Refunds retry in the background if immediate repayment fails. Send an Idempotency-Key and reuse it with the exact same request when retrying; completed errors also replay, so a retry does not generate or charge again.

Step 1: Browse Styles

Fetch the list of available art styles. Each style has a preset ID you can pass to the generation endpoint.

curl https://api.masko.ai/v1/styles \
  -H "Authorization: Bearer masko_YOUR_API_KEY"

Step 2: Generate Previews

Generate multiple preview images from your text description. This lets you pick the best variation before committing to a mascot.

curl -X POST https://api.masko.ai/v1/generate/preview \
  -H "Authorization: Bearer masko_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A friendly orange fox wearing a space helmet",
    "preset_id": "STYLE_ID",
    "count": 4
  }'

Step 3: Create Mascot

Take the preview URL you like best and use it as a reference image to create your mascot.

curl -X POST https://api.masko.ai/v1/mascots \
  -H "Authorization: Bearer masko_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Astro Fox",
    "project_id": "PROJECT_ID",
    "prompt": "A friendly orange fox wearing a space helmet",
    "reference_image_urls": [
      "URL_FROM_PREVIEW_RESPONSE"
    ]
  }'

Shortcut: Direct Creation

If you don't need to preview, you can create a mascot in one call. The API auto-generates a reference image (1 credit) from your prompt. Optionally pass a style to apply a visual preset.

curl -X POST https://api.masko.ai/v1/mascots \
  -H "Authorization: Bearer masko_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Astro Fox",
    "project_id": "PROJECT_ID",
    "prompt": "A friendly orange fox wearing a space helmet",
    "style": "3d"
  }'

Next Steps