Introduction
The Mynth HTTP API. Base URL, authentication, response shapes, and every endpoint, generated from the OpenAPI document.
Every endpoint lives under https://api.mynth.io, with no version prefix. It
speaks JSON, except POST /image/upload, which takes multipart form data. It
authenticates with a bearer token. No SDK is required.
The endpoint pages are generated from the API's OpenAPI document, so every parameter they list is one the API validates. The document itself is at api.mynth.io/openapi.json.
curl https://api.mynth.io/image/generate \
-H "Authorization: Bearer $MYNTH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"black-forest-labs/flux.2-pro","prompt":"A lighthouse at dusk"}'Conventions#
- Generation is asynchronous. A generate call returns a task, not media. Poll the task or receive a webhook. The task object covers every field.
- Successful bodies are wrapped in
data. Errors are not: they carrycodeand usuallymessageat the top level. See errors. - Money is a decimal string in USD, such as
"0.03". Parse it with a decimal type, not a float. - Ids have prefixes:
tsk_tasks,img_images,vid_videos,ak_API keys,wbh_webhooks,dst_destinations. - Unknown request fields are dropped, not rejected. Check the task's
echoed
requestwhen a setting seems to have no effect. - There are no idempotency keys. Every create is a new task and a new hold. See what is safe to retry.
Credentials#
curl https://api.mynth.io/tasks \
-H "Authorization: Bearer $MYNTH_API_KEY"An API key belongs on a server. A public access token comes with a task, expires after an hour, and can only read that task's status and result, which is why it is safe in browser code. Authentication has the rules for both, and the scope each endpoint needs.