Prerequisites
- Base URL — replace
https://api.example.comwith your deployed API host. - API key — Bearer token issued via Unkey, format
pi_live_.... - TLS — always use
httpsin production.
End-to-end flow
Extract brand DNA
POST to
/api/v1/brands/extract with at least one of url, logoBase64, or imagesBase64. The response is 202 Accepted with data.job_id.Poll the job
GET
/api/v1/jobs/:job_id with wait_for_completion=true to long-poll until the job reaches completed or failed. Add expand=brand to receive the brand object inline and avoid a separate fetch.If you did not use
expand=brand, fetch the brand separately with GET /api/v1/brands/:brand_id.Campaign ads
Campaign-grade static ads are available via two equivalent routes:POST /api/v1/campaigns/generatePOST /api/v1/images/campaigns(image-style alias)
202 Accepted with data.job_id and are polled through GET /api/v1/jobs/:id.
Next steps
- Introduction — envelopes, rate-limit headers, expansion convention
- Authentication — key format, error codes, idempotency
- Async jobs — job lifecycle, long-polling, error handling
- Response format — full envelope reference and HTTP status codes