Skip to main content
The SDK exposes a single client class: Mynth.

Basic setup

If you omit apiKey, the SDK reads MYNTH_API_KEY from the environment.

Explicit configuration

Options

Authentication behavior

The client always sends Bearer authentication:
The SDK uses your API key for server-to-server requests. For browser-safe task polling, use the task’s publicAccessToken instead of your API key. The same client exposes image generation, rating, and alt text methods:

When to override baseUrl

Override baseUrl only when you have a clear reason:
  • an internal proxy
  • a staging API
  • tests that run against a mocked or isolated host
For standard production usage, keep the default https://api.mynth.io.