Skip to main content

Practical limits

Image generation

  • count maximum: 100
  • prompt length maximum: 2056 characters
  • negative prompt length maximum: 2056 characters
  • custom webhook endpoints per request: 5
  • metadata maximum size: 2 KB

Content rating

  • custom levels minimum: 2
  • custom levels maximum: 7
  • custom level value max length: 24
  • custom level description max length: 150

Uploads

  • maximum files per request: 10
  • maximum file size: 10 MB
  • accepted formats: JPEG, PNG, WEBP

Concurrency

Mynth does not enforce API concurrency limits. If you want to create many independent tasks, you can send requests in parallel.

Common failure cases

Unauthorized

HTTP 401. You used:
  • a missing or invalid API key
  • a Public Access Token on an owner-only endpoint
  • a task token for the wrong task
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key."
  }
}

Validation errors

HTTP 400. The request shape does not match what Mynth expects, or the selected model does not support a requested capability such as input images.
{
  "error": {
    "code": "validation_error",
    "message": "The selected model does not support input images.",
    "field": "inputs"
  }
}

Insufficient balance

HTTP 402. Task creation reserves cost before generation begins. Requests fail when the account does not have enough available balance.
{
  "error": {
    "code": "insufficient_balance",
    "message": "Account balance is too low to create this task."
  }
}

Not found

HTTP 404. The task ID does not exist, or you do not have access to it.

Task failed

The task was accepted but did not complete successfully. This is not an HTTP error. Polling will eventually return status: "failed", and webhook delivery will emit task.image.generate.failed.

SDK-specific errors

The JavaScript SDK can also throw:
  • MynthAPIError - wraps all API errors with status code and response body
  • TaskAsyncTimeoutError - toTask() polled for five minutes without completion
  • TaskAsyncUnauthorizedError - the Public Access Token was rejected
  • TaskAsyncFetchError - a network fetch failed during polling
  • TaskAsyncTaskFetchError - the task detail fetch failed
  • TaskAsyncTaskFailedError - the task completed with status: "failed"
Catch MynthAPIError to inspect the underlying API error:
import { MynthAPIError } from "@mynthio/sdk";

try {
  const task = await mynth.generate({ prompt: "..." });
} catch (error) {
  if (error instanceof MynthAPIError) {
    console.error(error.status); // HTTP status code
    console.error(error.body); // parsed error response
  }
}