API docs

Documentation

Create a generation

Create image, video and audio jobs with the Raywake generation endpoint using a valid quote, model input and an idempotency key.

Updated

POST/v1/generate

Holds the quoted funds and starts the generation. Requires generate.

Headers
NameTypeDescription
Idempotency-Keyrequiredstring
A unique value per intended generation, such as a UUID.
Body
NameTypeDescription
modelrequiredstring
The quoted model id.
inputrequiredobject
The exact input you quoted.
quote_idrequiredstring
A valid, unexpired quote for this model and input.
webhook_urlstring
A public https URL (port 443). When the job ends we POST it a signed event; see Webhooks below.
Query parameters
NameTypeDescription
waitboolean
Return when the job is terminal (up to about three minutes) instead of immediately.

Default: false

curl -s -X POST https://api.raywake.com/v1/generate \
  -H "Authorization: Bearer $RAYWAKE_API_KEY" \
  -H "Idempotency-Key: YOUR-UUID" \
  -H "Content-Type: application/json" \
  -d '{"model":"nano-banana-pro","input":{"prompt":"A red ceramic cup on a wooden table, soft morning light","aspect_ratio":"1:1"},"quote_id":"QUOTE_ID"}'

Returns a job; see Jobs for its fields.

Webhooks

With webhook_url, the job's end is sent to you instead of polling. The body is {"type": "job.succeeded" | "job.failed", "timestamp", "data"}, where data is exactly what GET /v1/jobs/{job_id} returns, with output links ready.

Each request carries webhook-id, webhook-timestamp and webhook-signature headers (Standard Webhooks), signed with your account's secret from the API keys page. Answer with any 2xx status within 10 seconds. Otherwise we retry after 1 and 5 minutes, then 30 minutes, 2, 6 and 12 hours. Use webhook-id to ignore a repeat.

The URL must be https on port 443 and resolve only to public addresses; redirects are not followed.

Verify (Python)
# pip install standardwebhooks
from standardwebhooks.webhooks import Webhook

# The signing secret from the API keys page (whsec_...)
event = Webhook(RAYWAKE_WEBHOOK_SECRET).verify(raw_body, request_headers)
if event["type"] == "job.succeeded":
    outputs = event["data"]["outputs"]