Your API Keys
Building the integration? Create a free fiv_test_* key instead — it returns a stock
image, charges nothing, and never touches your credits. One test key per account.
| Name | Prefix | Credits | Calls | Status | |
|---|---|---|---|---|---|
| Loading... | |||||
Buy Credits
1 try-on = 8 credits. Credits never expire. Each pack is added to a key you select.
Agentic commerce
AI agents can buy credits on behalf of your users via Stripe Shared Payment Tokens.
No card credentials touch your code. The agent posts an spt_... token plus a pack slug; we create the PaymentIntent, credit the key, and return synchronously.
POST /api/v1/credits/purchase
Authorization: Bearer fiv_xxx
Content-Type: application/json
{
"pack_slug": "starter",
"shared_payment_granted_token": "spt_..."
}
Quick start
curl -X POST https://api.fitinview.com/api/v1/tryon \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"person_url": "https://example.com/me.jpg",
"garment_urls": ["https://example.com/shirt.jpg"],
"wait": true
}'
Node.js:
// Node 18+ (built-in fetch). Save as tryon.mjs, run: FITINVIEW_KEY=fiv_test_xxx node tryon.mjs
const res = await fetch("https://api.fitinview.com/api/v1/tryon", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.FITINVIEW_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
person_url: "https://example.com/me.jpg",
garment_urls: ["https://example.com/shirt.jpg"], // array of 1-3 HTTPS image URLs
output_size: "1K", // 1K = 8 credits, 2K = 12, 4K = 20
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status}: ${JSON.stringify(data)}`);
console.log(data.status, data.result_url);
Uploading local files instead of URLs? Send multipart/form-data with person and garment; see the docs.