Skip to main content
Use the metadata option on POST /image/generate when you need to carry application identifiers through the task lifecycle. Metadata is optional and omitted by default. Metadata is only available on image generation (image.generate). Content rating and alt text requests do not accept metadata. For the full generate request field list, see Image Generation Request. To receive completed tasks without polling, see Use Webhooks.

Pricing

Metadata is free. Mynth does not charge for attaching or returning metadata.

Attach metadata

Pass a JSON object on the generate request:
Mynth stores the object on the task as request.metadata and returns it unchanged. Nested objects and arrays are allowed as values.

Read metadata back

Metadata is echoed in these places: GET /tasks/:id/result does not include request, so it does not return metadata. Use the full task endpoint, the SDK, or webhooks when you need it. Webhook example (fields abbreviated):
Failed generate webhooks still include request, so metadata is available on both task.image.generate.completed and task.image.generate.failed.

Constraints

If the payload is too large, the API rejects the request with a validation error:

REST example

Creating a task does not return images immediately. Wait in the SDK, poll task endpoints, or use webhooks — see Async and polling. After completion, read metadata from the full task object or the webhook request.

How metadata fits generation

  1. You send metadata on the generate request.
  2. Mynth stores it on the task as part of request.
  3. Generation runs as usual. Metadata does not change model selection, billing, or image output.
  4. Completed and failed deliveries include the same request.metadata you sent.
Common uses:
  • Map Mynth tasks back to your jobs, users, orders, or database rows
  • Correlate webhook deliveries without an extra lookup
  • Pass string keys used by destination path templates as {meta.key} (string values only)
For a full-stack mapping pattern with Convex, see Convex full-stack image generation.