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.
| Language | Package | Source |
|---|---|---|
| Node.js / TypeScript | tryiton (npm) | tryiton-now/tryiton-node |
| Python | tryiton (pip) | tryiton-now/tryiton-python |
| PHP | tryiton/tryiton (Composer) | tryiton-now/tryiton-php |
| Ruby | tryiton (gem) | tryiton-now/tryiton-ruby |
| Go | tryiton-go (module) | tryiton-now/tryiton-go |
Install
npm install tryitonpip install tryitoncomposer require tryiton/tryitongem install tryitongo get github.com/tryiton-now/tryiton-goRun 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.firstpackage 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 withcategoryandsubcategoryrouting.tryOnHairstyle/try_on_hairstyle— hairstyle try-on.tryOnTattoo/try_on_tattoo— tattoo try-on.getStatus/get_status— poll a job, or usewaitForResult/wait_for_resultto poll until completion.getCredits/get_credits— check your credit balance.
See each endpoint's reference page for the full parameter list.