Documentation Index
Fetch the complete documentation index at: https://docs.together.ai/llms.txt
Use this file to discover all available pages before exploring further.
Generating an image
To query an image model, use the.images method and specify the image model you want to use.

Provide reference image
Some image models support editing or transforming an existing image. The parameter you use depends on the model:| Parameter | Type | Models | Description |
|---|---|---|---|
image_url | string | FLUX.1 Kontext (pro/max), FLUX.2 (pro/flex) | A single image URL to edit or transform |
reference_images | string[] | FLUX.2 (pro/dev/flex), Gemini 3 Pro Image, Flash Image 2.5 | An array of image URLs to guide generation |
reference_images is recommended for FLUX.2 and Google models as it supports multiple input images. FLUX.2 [pro] and [flex] also accept image_url for single-image edits, but FLUX.2 [dev], Gemini 3 Pro Image, and Flash Image 2.5 only support reference_images.Using image_url (Kontext models)

Using reference_images (FLUX.2 & Google models)
Supported Models
See our models page for supported image models.Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
prompt | string | Text description of the image to generate | Required |
model | string | Model identifier | Required |
width | integer | Image width in pixels | 1024 |
height | integer | Image height in pixels | 1024 |
n | integer | Number of images to generate (1-4) | 1 |
steps | integer | Diffusion steps (higher = better quality, slower) | 1-50 |
seed | integer | Random seed for reproducibility | any |
negative_prompt | string | What to avoid in generation | - |
image_url | string | URL of a reference image to edit. Used by Kontext models. | - |
reference_images | array | Array of image URLs for image-to-image editing. Used by FLUX.2 and Google models. | - |
frame_images | array | Required for Kling model. Array of images to guide video generation, like keyframes. | - |
promptis required for all models except Klingwidthandheightwill rely on defaults unless otherwise specified - options for dimensions differ by model- Flux Schnell and Kontext [Pro/Max/Dev] models use the
aspect_ratioparameter to set the output image size whereas Flux.1 Pro, Flux 1.1 Pro, and Flux.1 Dev usewidthandheightparameters.
Generating Multiple Variations
Generate multiple variations of the same prompt to choose from:
Custom Dimensions & Aspect Ratios
Different aspect ratios for different use cases:
Quality Control with Steps
Compare different step counts for quality vs. speed:
Base64 Images
If you prefer the image data to be embedded directly in the response, setresponse_format to “base64”.
b64_json field that contains the image encoded as a base64 string.
Safety Checker
We have a built in safety checker that detects NSFW words but you can disable it by passing indisable_safety_checker=True. This works for every model except Flux Schnell Free and Flux Pro. If the safety checker is triggered and not disabled, it will return a 422 Unprocessable Entity.
Troubleshooting
Image doesn’t match prompt well- Make prompt more descriptive and specific
- Add style references (e.g., “National Geographic style”)
- Use negative prompts to exclude unwanted elements
- Try increasing steps to 30-40
- Increase
stepsto 30-40 for production - Add quality modifiers: “highly detailed”, “8k”, “professional”
- Use negative prompt: “blurry, low quality, distorted, pixelated”
- Try a higher-tier model
- Use
seedparameter for reproducibility - Keep the same seed when testing variations
- Generate multiple variations with
nparameter
- Specify
widthandheightexplicitly - Common ratios:
- Square: 1024x1024
- Landscape: 1344x768
- Portrait: 768x1344
- Ensure dimensions are multiples of 8