Skip to main content
The Mynth SDK provides a simple and powerful way to interact with the Mynth API using TypeScript or JavaScript.

Features

  • Fully Typed: The SDK is written in TypeScript and provides full type definitions for all requests and responses. It uses advanced type inference to determine the return type based on your input parameters.
  • Async Support: Built-in support for asynchronous generation tasks.
  • Easy Integration: Simple API for easy integration into your projects.

Installation

bun add @mynthio/sdk

Basic Usage

The core of the SDK is the Mynth class.
import Mynth from "@mynthio/sdk";

const mynth = new Mynth({ apiKey: "mak_..." });

const task = await mynth.generate({
  prompt: "A futuristic city",
  model: "black-forest-labs/flux.1-dev",
});

console.log(task.getImages());