TryItOn

Official SDKs

Official TryItOn client libraries for Node.js, Python, PHP, Ruby, and Go. Install, authenticate, and run your first virtual try-on.

TryItOn ships official, open-source client libraries so you can call the virtual try-on API without writing HTTP plumbing. Each SDK wraps the same endpoints (clothes, hairstyle, tattoo, status, credits), handles authentication, and includes a waitForResult helper that polls a job until it finishes.

Install

npm install tryiton
pip install tryiton
composer require tryiton/tryiton
gem install tryiton
go get github.com/tryiton-now/tryiton-go

Run your first try-on

Submit a clothing try-on, wait for it to finish, and print the result image URL. Get an API key from the Developer Dashboard.

import { TryItOn } from "tryiton";

const client = new TryItOn({ apiKey: process.env.TRYITON_API_KEY });

const jobId = await client.tryOnClothes({
  modelImage: "https://example.com/model.jpg",
  garmentImage: "https://example.com/tshirt.jpg",
  category: "clothing",
  subcategory: "tops",
});

const [resultUrl] = await client.waitForResult(jobId);
console.log(resultUrl);
import os
from tryiton import TryItOn

client = TryItOn(api_key=os.environ["TRYITON_API_KEY"])

job_id = client.try_on_clothes(
    model_image="https://example.com/model.jpg",
    garment_image="https://example.com/tshirt.jpg",
    category="clothing",
    subcategory="tops",
)

urls = client.wait_for_result(job_id)
print(urls[0])
<?php
require 'vendor/autoload.php';

use TryItOn\Client;

$client = new Client(getenv('TRYITON_API_KEY'));

$jobId = $client->tryOnClothes([
    'model_image'   => 'https://example.com/model.jpg',
    'garment_image' => 'https://example.com/tshirt.jpg',
    'category'      => 'clothing',
    'subcategory'   => 'tops',
]);

$urls = $client->waitForResult($jobId);
echo $urls[0];
require "tryiton"

client = Tryiton::Client.new(api_key: ENV["TRYITON_API_KEY"])

job_id = client.try_on_clothes(
  model_image: "https://example.com/model.jpg",
  garment_image: "https://example.com/tshirt.jpg",
  category: "clothing",
  subcategory: "tops"
)

urls = client.wait_for_result(job_id)
puts urls.first
package main

import (
	"context"
	"fmt"
	"log"
	"os"
	"time"

	tryiton "github.com/tryiton-now/tryiton-go"
)

func main() {
	client, err := tryiton.New(os.Getenv("TRYITON_API_KEY"))
	if err != nil {
		log.Fatal(err)
	}

	ctx := context.Background()

	jobID, err := client.TryOnClothes(ctx, tryiton.ClothesParams{
		ModelImage:   "https://example.com/model.jpg",
		GarmentImage: "https://example.com/tshirt.jpg",
		Category:     "clothing",
		Subcategory:  "tops",
	})
	if err != nil {
		log.Fatal(err)
	}

	urls, err := client.WaitForResult(ctx, jobID, 2*time.Second)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(urls[0])
}

Image inputs accept a public URL or a base64 data URL (data:image/png;base64,...). Output URLs are valid for 72 hours. Failed jobs are never charged.

What the SDKs cover

  • tryOnClothes / try_on_clothes — clothing and accessory try-on with category and subcategory routing.
  • tryOnHairstyle / try_on_hairstyle — hairstyle try-on.
  • tryOnTattoo / try_on_tattoo — tattoo try-on.
  • getStatus / get_status — poll a job, or use waitForResult / wait_for_result to poll until completion.
  • getCredits / get_credits — check your credit balance.

See each endpoint's reference page for the full parameter list.

On this page