FASHN Agent API Quickstart
The FASHN Agent API is the main way to make fashion images with FASHN. You send one request with a plain-language prompt and up to six reference images, and the FASHN Agent plans the steps, runs them, and returns every image it made. It can run try-on, product-to-model, model creation and swap, edits, background changes, packshots, transparent images, upscaling, and background removal.
This page takes you from an API key to your first images, then shows prompts for common fashion content. For every parameter, limit, and error, see the Agent Images reference.
See it in action: this video makes a four-look lookbook from six photos with Claude Code and one FASHN Agent API call.
Make your first request
Get an API key
Create an account, buy credits, and create a key by following API Setup. Then store the key in an environment variable:
Send a prompt and your images
Send the prompt and the image URLs to POST /v1/agent/images. In the prompt, refer to the images by their position or by what they show. This example turns a product photo into an on-model photo:
The request stays open until the Agent finishes: about 40 seconds for one image at the default settings, and longer for requests with several steps.
Use the images
The response lists every operation that produced images, in the order the Agent ran them, intermediate steps included. Each entry's results holds the image URLs, and credits_used gives the cost:
Download the images you want to keep. See Data Retention & Privacy for how long outputs stay available.
Run longer requests in the background
Requests with several steps, such as a lookbook, can take a few minutes. Instead of holding the connection open, start a run with POST /v1/agent/images/run. It takes the same body and returns a run ID right away. Then poll the run's status with that ID until status is completed or failed:
A completed run returns the same predictions and credits_used as the synchronous response. To get the result on your server instead of polling, add a webhook_url query parameter when you start the run. See Asynchronous runs and Webhooks.
Example prompts for fashion content
Each example below is a request body for /v1/agent/images or /v1/agent/images/run. Replace the image URLs with your own, or send base64 data URIs.
On-model product photos
Turn a product photo into photos of a model wearing it:
A request for several images, such as three angles, makes one image per generation and is billed per image.
Packshots
Make a clean product image from a photo of the product:
For a cutout, ask for a transparent background instead.
Catalog images
Put several products on the same model in the same setting, one image per product:
A request takes up to six images and runs up to eight operations, so a larger catalog takes several requests. They can run in parallel up to your concurrency limit.
Lookbooks
A lookbook keeps one model and one location across several looks. The lookbook recipe makes four looks from a face photo, a location photo, and four outfits in one call, with a prompt worded to keep the face the same in every look:
Run it in the background: it takes about five minutes and, at these settings, 12 credits for the four looks.
Use it from Claude Code or Codex
A coding agent can run these requests for you. It finds the photos, sends the request, and saves the results, and the FASHN Agent makes the images: your agent is the producer, and the FASHN Agent is the photographer.
Claude Code. Open Claude Code in a folder with a face photo, a location photo, and four outfit photos, and paste:
The recipe sets up your API key in a .env file, confirms which photo is which, and saves the four looks in a new folder. How to make an AI lookbook with Claude Code ↗ walks through a full run.
Codex, Cursor, and other agents. Every page of these docs is also available as Markdown. Ask your agent to read the Agent Images reference, then describe what you need, for example:
See Coding Agents for more ways to use FASHN from a coding agent.
Tips for better results
- Refer to the images by their position ("the first image") or by what they show ("the dress").
- The Agent never asks a question back. When a prompt is unclear, it makes its best guess, so say what you want: framing, background, pose, and how many images.
- The Agent adds no steps you did not ask for, such as an upscale or a variation. Ask for them in the prompt.
- Use
generation_mode: "fast"for drafts, and"quality"with a higherresolutionfor final assets. See Credit cost. - Each request runs at most 8 operations, so it costs at most 32 credits.
- The Agent makes images only. For video, use Image to Video.
For virtual try-on in a shopping experience, such as a "try it on" button on a product page, call Try-On Max or the faster Try-On v1.6 directly.
Next: Read the full Agent Images reference, or set up Webhooks for background runs.