Tutorials

Guide

Build with the REST API

Make images, video, voice and full ads from your own code, with the price before every job.

  1. InYour code
  2. DoEstimate, create, poll
  3. OutFiles in your app
What you getFiles in your app

Who it is for

Developers adding ad making to a store, a tool or a workflow.

Why it works

Every job has a free estimate, a price cap you set and an automatic refund when it fails. Retries with an idempotency key never charge twice.

The steps in Staglight

Each step and what it does.

  1. Get an API key

    Sign up, confirm your email, then make a key in the studio.

  2. Estimate

    Send the same body as the job and get its price, for free.

  3. Create and poll

    Create the job, then ask for it with wait until it is done.

  4. Download

    Each finished job has signed links to its files.

Tips

  • Get the estimate first: it is free.
  • Send an Idempotency-Key on every paid call.
  • Poll with wait so the answer comes when the job ends.

Ready when you are

Open it in Staglight and follow the same steps.

Open the guide