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 returningmetadata.
Attach metadata
Pass a JSON object on the generate request:request.metadata and returns it unchanged. Nested objects and arrays are allowed as values.
Read metadata back
Metadata is echoed in these places:| Surface | Where to read it |
|---|---|
| SDK completed result | result.getMetadata() |
Full task (GET /tasks/:id) | data.request.metadata |
| Webhooks | payload.request.metadata |
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):
request, so metadata is available on both task.image.generate.completed and task.image.generate.failed.
Constraints
| Constraint | Limit |
|---|---|
| Type | JSON object (not a string, number, or array at the top level) |
| Maximum size | 2 KB (2048 bytes of JSON.stringify UTF-8) |
REST example
request.
How metadata fits generation
- You send
metadataon the generate request. - Mynth stores it on the task as part of
request. - Generation runs as usual. Metadata does not change model selection, billing, or image output.
- Completed and failed deliveries include the same
request.metadatayou sent.
- 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)