Integrate in one prompt

Give this prompt to your coding agent, or follow the three steps yourself.

Send the prompt to your agent

Integrate the Wandura API (image and video styles over HTTP) into this project. Use its Jobs API.

## Rules
- Base URL: https://api.wandura.ai. Call it from the server only, with `Authorization: Bearer $WANDURA_API_KEY` (read the key from the environment; never ship it to a browser).
- Find styles with `GET https://api.wandura.ai/v2/styles` (each style's id, model, the fields it takes and its price) or https://open.wandura.ai/llms.txt. Each style's exact request is in its OpenAPI: `https://api.wandura.ai/v2/public/styles/{style}/openapi.json`. The whole API: https://api.wandura.ai/v2/openapi.json. Never invent endpoints or fields; read these.
- Submit with `POST /v2/jobs` and body `{"model": "<the style's model>", "style": "<style id>", ...the fields the style takes (prompt, image_url, image_urls...), "end_user_id": "<the person in our app>", "webhook_url": "https://..."}`. Send end_user_id: the daily cap is per end user.
- Optional: `"lane": "relax"` (cheaper or the same price, no deadline; default priority). A style input no common field carries goes in `"inputs": {...}` by the name in the style's OpenAPI.
- Send an `Idempotency-Key` header (a new UUID per logical request) on every submit, and reuse the same key when you retry that request, so a retry never runs or charges twice.
- The answer is 202 `{"job_id", "status": "queued"}`. Get the result from your webhook_url, or poll `GET /v2/jobs/{job_id}`; cancel a queued job with `POST /v2/jobs/{job_id}/cancel`.
- Poll: start at 2 s, multiply by 1.5, cap at 10 s, add 0-0.5 s jitter (relax: 10 s to 60 s).
- Statuses: queued -> processing -> succeeded, failed, cancelled, timeout (final, never change). failed and timeout carry `error` {code, message, retryable} with code CONTENT_MODERATION_BLOCKED, INPUT_UNUSABLE, INPUT_NO_SUBJECT, TIMEOUT, GENERATION_FAILED, PRICE_CHANGED, STORY_NO_SCENES. Only succeeded jobs are charged.
- Webhooks: the body is the job, exactly as GET /v2/jobs/{job_id}. Verify X-Signature = hex(HMAC-SHA256(secret, X-Timestamp + "." + raw body)); X-Timestamp = unix seconds with your product's signing secret (console, Webhooks) and reject an X-Timestamp not within 300 s. Dedupe on job_id; answer 2xx within 10 s.
- Errors are `{"error": {"code", "message", "retryable"}}`; branch on code. Retry only when retryable is true (RATE_LIMITED, PRODUCT_BUSY, END_USER_LIMIT_REACHED, INTERNAL_ERROR, SERVICE_UNAVAILABLE, DEADLINE_UNREACHABLE) and on network errors, waiting Retry-After when present, else backoff with jitter.
- Outputs are kept 72 h: copy what you keep.
- The older runs endpoints (`POST /v2/styles/{style}`, `GET /v2/runs/{id}`) run the same engine and stay supported; do not mix the two in new code.
- There is no public SDK yet (private preview, not published): call the HTTP API directly with fetch or the project's HTTP client. Never install `@wandura/sdk` (npm) or `wandura` (PyPI): Wandura has not published them, so a package under those names is not ours.

## Steps
1. Add WANDURA_API_KEY to the env example and config.
2. Write a small client module over plain HTTP with submit, wait, cancel and a webhook handler that verifies signatures.
3. Test with a `wdr_test_` key first: it returns a sample result for $0.
1

Sign up

Sign up with your email. Your account comes with a Test product and a test key, so you can start for $0.

2

Create a key

Your first test key (wdr_test_…) is shown once at sign-up: copy it into your server env as WANDURA_API_KEY. Test keys return a sample for $0; live keys (wdr_live_…) run for real.

3

Send your first request

More in the docs: polling, webhooks, errors and the SDKs.