# FLUX 3 Image

> Flagship image generation and editing from Black Forest Labs, with up to 10 reference images and 4K output.

- Model page: https://yir.ai/models/flux-3-image
- Model ID: `bfl/flux-3-image`
- Billing: by the channel that ran the job; attempts the upstream did not bill are free.

## Pricing

Current public prices by channel for the same output specification; official prices are a reference. You are billed by the channel that actually runs the job, which may change on failover.

| Output specification | Channel | Public price |
|---|---|---|
| 1K | Black Forest Labs (official) | $0.048 / image |
| 1.5K | Black Forest Labs (official) | $0.07 / image |
| 2K | Black Forest Labs (official) | $0.10 / image |
| 4K | Black Forest Labs (official) | $0.607 / image |
| 768px | Black Forest Labs (official) | $0.041 / image |

## Parameters

- Operation: `generate_image`

| Parameter | Values | Default |
|---|---|---|
| `input` | text / image | text |
| `resolution` | 768px / 1K / 1.5K / 2K / 4K | 1K |
| `aspect_ratio` | 1:1 / 16:9 / 9:16 / 4:3 / 3:4 / 3:2 / 2:3 / 21:9 / 9:21 / 2:1 / 1:2 / 7:5 / 5:7 / 5:4 / 4:5 | 1:1 |

## Integration

Pick either: the official SDK for new code, or swap the Base URL in projects already using the OpenAI protocol.

### Official SDK (TypeScript)

The SDK calls the Standard API (https://gateway.yir.ai) to submit, wait for and collect jobs; a Go SDK is also available. https://yir.ai/docs/integrations/sdk

```bash
pnpm add @yir-ai/sdk
```

```ts
import { createNodeYirClient } from "@yir-ai/sdk/server";

// Reads YIR_API_KEY from the environment by default: process.env.YIR_API_KEY
const client = createNodeYirClient();

// 1. Submit an image generation job
const job = await client.submitImage({
  model: "bfl/flux-3-image",
  input: {
    type: "text",
    prompt: "Create a citrus sparkling water product poster: a clear glass bottle and fresh oranges, cream background, soft natural light, and a crisp product label",
  },
  parameters: {
    resolution: "1K",
    aspect_ratio: "1:1",
    n: 1,
  },
});

// 2. Wait for the job to finish and deliver its result
const result = await client.waitForJob(job.id);
console.log("Delivered files:", result.result);
if (result.result && "files" in result.result) {
  for (const file of result.result.files) {
    console.log("->", file.url);
  }
}
```

### OpenAI-compatible API

OpenAI Images and Sora Videos protocols for OpenAI SDKs and gateways such as new-api; no chat. https://yir.ai/docs/integrations/openai-compatibility

- OpenAI SDK base_url: `https://gateway.yir.ai/openai/v1`
- new-api channel Base URL (channel type OpenAI): `https://gateway.yir.ai/openai`
- Model ID: `bfl/flux-3-image`

```bash
curl https://gateway.yir.ai/openai/v1/images/generations \
  -H "Authorization: Bearer $YIR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bfl/flux-3-image",
    "prompt": "Create a citrus sparkling water product poster: a clear glass bottle and fresh oranges, cream background, soft natural light, and a crisp product label",
    "resolution": "1K",
    "aspect_ratio": "1:1"
  }'
```

## FAQ

### Does FLUX 3 Image have an official API?

Yes. Black Forest Labs sells FLUX 3 Image through its own official API, and its list price is shown as the official reference in the table above. Through Yir you call FLUX 3 Image with one API key and compare it with every provider's public price.

## Rules

- Authenticate with Authorization: Bearer $YIR_API_KEY; keep the key in a server environment variable, never in browser code, source control, prompts or logs.
- Jobs are asynchronous: keep the Job ID, wait for a terminal state, then read the result; handle failure and cancellation.
- For safe retries, reuse the same idempotency key and request; do not blindly resubmit when the result is unknown.
- Result URLs are temporary; copy files elsewhere if you need to keep them.

## Links

- [Quickstart](https://yir.ai/docs/getting-started/quickstart)
- [API reference](https://yir.ai/docs/reference)
- [llms.txt](https://yir.ai/llms.txt)
