fashn-logo
FASHNAI

Use FASHN with Claude Code, Codex, and Cursor

Coding agents such as Claude Code, Codex, and Cursor can work with FASHN in two ways:

  • Make images with the FASHN Agent API. Your agent 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.
  • Integrate FASHN into your project with the official FASHN agent skill, which teaches your agent the FASHN single-task endpoints and SDKs.

Make images with the FASHN Agent API

The FASHN Agent API is a plain REST endpoint: one request with a prompt and up to six reference images returns every image the Agent made. A coding agent can call it with curl or a short script, so you describe the content you need and your agent runs it.

API key

You need a FASHN API key. Generate one from API Setup. Keep it in an environment variable or a .env file, and never paste it into the chat.

Claude Code: follow a recipe

A recipe is a file of instructions your agent follows step by step. The lookbook recipe makes a four-look lookbook of one model in one location from six photos, in one call. Open Claude Code in a folder with a face photo, a location photo, and four outfit photos, and paste:

Download https://docs.fashn.ai/recipes/lookbook.md with curl and follow it exactly

The recipe sets up your API key in a .env file, confirms which photo is which, and saves the looks in a new folder. How to make an AI lookbook with Claude Code ↗ walks through a full run, and this video shows it from start to finish:

Any agent: point it at the docs

Every page of these docs is also available as Markdown. Ask your agent to read the Agent Images reference, then describe what you need:

On-model photos from several angles:

Read https://docs.fashn.ai/api-reference/agent-images.md.
Then use the FASHN Agent API to make three on-model photos of ./dress.jpg
from different angles, and save them in ./on-model.

Packshots for a folder of products:

Read https://docs.fashn.ai/api-reference/agent-images.md.
Then make a white-background packshot of every photo in ./bags
with the FASHN Agent API.

A reusable script for your catalog:

Read https://docs.fashn.ai/api-reference/agent-images.md.
Then write a script that sends each product photo in ./products
to the FASHN Agent API and saves the results.

For more prompts, see the Agent API Quickstart.

Integrate FASHN with the agent skill

FASHN publishes an agent skill that teaches coding agents how to integrate the FASHN single-task endpoints through the REST API or the official TypeScript and Python SDKs. Once installed, your agent can wire FASHN into your project, or run a one-off generation, without you pasting documentation into the chat.

It works with Claude Code, Codex, Cursor, and many others.

Install

Install the skill with skills.sh. The CLI auto-detects which coding agents you have installed and configures the skill for each:

npx skills add fashn-ai/fashn-skill
API key

The skill reads a FASHN_API_KEY from the environment. If it isn't set, the skill asks for your key and helps you configure it, caching it for future runs. Generate one from API Setup.

What the skill knows

  • Every FASHN single-task endpoint (/v1/run) and its inputs.
  • The prediction lifecycle: subscribe (submit and auto-poll) versus the manual run plus status polling flow.
  • The response envelope, the error catalog, credit usage, and webhooks.
  • Both integration paths (REST and the TypeScript or Python SDKs), plus a one-off inline run.

The skill covers the single-task endpoints. To use the FASHN Agent API from a coding agent, point your agent at the Agent Images docs as described in Make images with the FASHN Agent API.

Usage

After installing, your agent loads the skill automatically (restart the agent if a session is already open). Mention FASHN in your request so the skill activates, then describe the outcome you want and it chooses the right model and wires up the call.

Build FASHN into your app

Add a FASHN virtual try-on route to my Next.js app: accept a model photo
and a garment image, and return the result URL.
Use FASHN to write a Python worker that runs every garment in ./products
through a model.
Integrate FASHN API into my PHP project.

Generate something on the spot

In Claude Code and Codex, run a one-off generation by invoking the skill directly with /fashn:

Product to model:

/fashn generate three on-model shots of this product for our product page

A one-off try-on:

/fashn do a try-on with this model photo and this jacket

With other agents, describe the same task in chat and the skill activates automatically.


Next: Make your first request with the Agent API Quickstart, pick an integration path with the TypeScript or Python SDK, or browse the API Reference.

On this page