Skip to content
CLI

Anywear CLI and REST API

Create try-on links from the terminal, a script or a coding agent. Sign in once in your browser, then pass a garment image URL and open the fitting room with one command.

Using a chat app such as Claude or ChatGPT? Connect it through MCP instead. MCP setup

Install

Install the official anywear package from npm, or run it without installing through npx. It requires Node.js 22 or later on macOS or Linux.

Install globally

npm i -g anywear

Run without installing

npx anywear login

Commands

anywear login
Opens your browser to sign in to Anywear and allow the CLI. The sign-in is saved on this computer.
anywear try-on IMAGE_URL --open --wait
Creates a try-on link for the garment image. --open opens the link in your browser, and --wait waits until the room ends and prints the seconds and credits used.
anywear status LINK_ID
Shows the status of a link and the rooms opened from it.
anywear list
Lists your most recent try-on links.
anywear whoami
Shows the signed-in account and its credit balance.
anywear logout
Signs out and removes the saved sign-in from this computer.

Replace IMAGE_URL with a direct link to a JPEG, PNG or WebP image, and LINK_ID with the id the CLI prints.

Use it from a coding agent

Coding agents that run terminal commands, such as Claude Code or Codex, can use the CLI directly. Paste this instruction into the agent:

Read https://anywear.studio/mcp-guide.txt and set up the Anywear CLI on this computer. Let me sign in in my browser, then create a try-on link for the garment I choose.

Pricing

  • A room lasts up to 30 seconds and is billed by the second: 1 credit per second, with a 10-second minimum.
  • 30 credits are held when the room starts. The unused part returns to your balance when the room ends.
  • Creating a link is free, and a room that never starts costs nothing.
  • Switching garments inside a room is included at no extra cost.
  • Links expire after 24 hours. Each account can create up to 20 links per hour.
See credit packs

Privacy and control

  • The AI app cannot turn on your camera, start a room or buy anything. Only you can start a room, in your own browser.
  • The app can see your email address, your credit balance and the try-on links created for your account. It never receives your camera video.
  • You can disconnect an app at any time from your account page. Its access ends immediately.
Manage connected apps

REST API

The CLI is built on a small REST API that you can call from your own code. Each request sends an OAuth 2.1 access token in the Authorization header. The technical reference below is in English.

curl https://anywear.studio/api/v1/tryon/links \
  -H "Authorization: Bearer $ANYWEAR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"image_url": "https://shop.example/images/jacket.jpg"}'
GET /api/v1/account
The connected account: email, credits, rooms_available, pricing and top_up_url.
POST /api/v1/tryon/links
Create a try-on link. JSON body: {"image_url": "https://…/garment.jpg", "title": "optional"}. Returns 201 with the link, including its url and expires_at.
GET /api/v1/tryon/links?limit=10
The account's most recent try-on links (limit 1–50).
GET /api/v1/tryon/links/{id}
One link: status (waiting_for_user, in_progress, finished or expired), its latest five rooms with seconds_used, seconds_billed (minimum included) and credits_charged, and credits_charged / rooms_total across every room.
{"error": {"code": "not_found", "message": "Try-on link not found"}}

OAuth endpoints

Anywear is an OAuth 2.1 authorization server with dynamic client registration and PKCE. Clients are public, so no client secret is issued.

GET /.well-known/oauth-authorization-server
Authorization server metadata (RFC 8414).
GET /.well-known/oauth-protected-resource
Protected resource metadata (RFC 9728).
POST /api/oauth/register
Dynamic client registration (RFC 7591). Send redirect_uris; returns a client_id.
GET /oauth/authorize
Authorization code flow with PKCE (S256). The user signs in and chooses Allow.
POST /api/oauth/token
grant_type authorization_code or refresh_token. Access tokens last 1 hour; refresh tokens 60 days.
POST /api/oauth/revoke
Token revocation (RFC 7009). A refresh token ends the whole connection; an access token ends only itself.
AnywearSign in

Connect your Google account to continue.

Terms · Privacy
Your first 3 Passes are on us.3 free try-ons · No installation