Skip to main content
The @mynthio/tanstack-ai-adapter package lets you use Mynth as an image provider through TanStack AI’s generateImage API.

Usage

import { generateImage } from "@tanstack/ai";
import { mynthImage } from "@mynthio/tanstack-ai-adapter";

const result = await generateImage({
  adapter: mynthImage("black-forest-labs/flux.2-dev"),
  prompt: "Editorial product photo of a ceramic cup",
  numberOfImages: 1,
  size: "landscape",
});

When to use this adapter

Use it when your app already standardizes on TanStack AI’s image abstraction and you want to add Mynth as a provider without changing your application code. If Mynth is your primary integration surface, use the main SDK directly for full control over async flows, polling, webhooks, and metadata.