In this guide, we’ll walk you through using one of our popular model endpoints, such as black-forest-labs/flux.1-dev. Before diving in, ensure you have an API key from your dashboard, which is required for authenticating your requests to the sunra API.

To get started, install the client package and configure it with your API key:

npm install @sunra/client

Once configured, you can invoke our Model API endpoint using the sunra client:

import { sunra } from "@sunra/client";

// Configure the client
sunra.config({
  credentials: "YOUR_SUNRA_KEY",
});

const result = await sunra.subscribe("black-forest-labs/flux.1-dev", {
  input: {
    prompt:
      "A rabbit wearing glasses reading a book under a mushroom in watercolor style.",
  },
});

We offer various models like Flux kontext pro and Kling v2 master as ready-to-use APIs. Explore these on our Model Playgrounds or join us on Discord for more suggestions.

To use a model, visit its “API” tab to find the URL, source code, and usage examples, helping you integrate it seamlessly into your applications.