Skip to main content
POST
/
image
/
generate
cURL
curl --request POST \
  --url https://api.example.com/image/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "output": {
    "format": "webp",
    "quality": 80
  },
  "model": "black-forest-labs/flux.2-pro",
  "count": 1,
  "destination": "<string>",
  "inputs": [
    "<string>"
  ],
  "magic_prompt": "<unknown>",
  "metadata": {},
  "negative_prompt": "<string>",
  "rating": {
    "mode": "custom",
    "levels": [
      {
        "value": "<13",
        "description": "Safe for Children"
      },
      {
        "value": "<18",
        "description": "Safe for Teens"
      },
      {
        "value": "18+",
        "description": "Adults Only"
      }
    ]
  },
  "size": {
    "type": "<unknown>",
    "scale": "base"
  },
  "webhook": {
    "custom": [
      {
        "url": "<string>"
      }
    ],
    "dashboard": "<unknown>"
  }
}
'
{
  "data": {
    "taskId": "<string>",
    "access": {
      "publicAccessToken": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

Mynth API key sent as Authorization: Bearer <api-key>.

Body

application/json
prompt
string
required

Positive prompt.

Required string length: 1 - 8192
Example:

"Cute Cat"

output
object
model
default:auto
Example:

"black-forest-labs/flux.2-pro"

count
number
default:1
Required range: 1 <= x <= 20
access
object

Controls whether the create-task response should include a short-lived Public Access Token.

That token can be passed to browser or client-side code for polling task status and task images without exposing your API key.

destination
string
Required string length: 1 - 64
Example:

"bunny-prod"

inputs
(string | object)[]
Maximum array length: 20
Required string length: 1 - 2048
magic_prompt
any
metadata
object
negative_prompt
string
Required string length: 1 - 8192
rating

Content rating

Example:
{
  "mode": "custom",
  "levels": [
    {
      "value": "<13",
      "description": "Safe for Children"
    },
    {
      "value": "<18",
      "description": "Safe for Teens"
    },
    {
      "value": "18+",
      "description": "Adults Only"
    }
  ]
}
size
webhook
object

Response

201 - application/json

Create image generation task

data
object
required