API Reference
The Try Garage AI API lets you integrate AI-powered car transformation into any application. You can transform car photos by selecting styles, tires, and accessories — fully programmatically.
Authentication
All API requests must include your API key in the request header:
X-API-Key: YOUR_API_KEY
You can find your API key in the Dashboard → Embed & API section. Keep it secret — never expose it in client-side code.
Base URL
https://trygarage.net/api/v1
All endpoints below are relative to this base URL. The API uses HTTPS only.
Error Codes
| HTTP Status | Code | Description |
|---|---|---|
401 | unauthenticated | Missing or invalid API key |
400 | invalid-argument | Missing required fields or invalid values |
402 | failed-precondition | Insufficient Pixels or expired balance |
429 | resource-exhausted | Daily transform limit reached |
500 | internal | All AI providers failed — retry in a moment |
{
"error": {
"code": "failed-precondition",
"message": "Insufficient pixels. Current balance: 50, required: 200."
}
}
/transform
Generate a photorealistic AI transformation of a car photo. This deducts Pixels from your balance automatically.
Request Body
{
"carImageUrl": "https://storage.googleapis.com/...", // REQUIRED — Firebase Storage URL
"resolution": "2K", // "1K" | "2K" | "4K" (default: "1K")
"style": {
"name": "Matte Black", // "None" to skip
"description": "...", // optional, improves accuracy
"customImageUrl": null // Firebase Storage URL of a custom swatch (optional)
},
"tire": {
"name": "Sport 19-inch", // "None" to skip
"description": "...",
"customImageUrl": null
},
"accessory": {
"name": "Rear Spoiler", // "None" or "AI Choice" to skip
"description": "...",
"customImageUrl": null
}
}
transform_inputs/{uuid}.jpg in Firebase Storage first, then pass the download URL here. Any other URL is rejected for security reasons.
Response
{
"ok": true,
"imageUrl": "https://firebasestorage.googleapis.com/v0/b/.../ai_proxy/..."
}
Pixel Cost
| Selection | Pixels |
|---|---|
| Style (paint / wrap) | 200 px |
| + Tires | +130 px |
| + Accessories | +130 px |
| + 4K resolution | +100 px |
| Full transform (all options + 4K) | 560 px |
Example — cURL
curl -X POST https://trygarage.net/api/v1/transform \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"carImageUrl": "https://firebasestorage.googleapis.com/v0/b/YOUR_BUCKET/o/transform_inputs%2Fuuid.jpg?alt=media&token=...",
"resolution": "2K",
"style": { "name": "Pearl White" },
"tire": { "name": "None" },
"accessory": { "name": "None" }
}'
/catalog
Retrieve all items in your catalog (styles, tires, accessories). You can filter by type.
Query Parameters
| Param | Type | Description |
|---|---|---|
type | string | styles | tires | accessories (omit for all) |
{
"ok": true,
"catalog": {
"styles": [
{ "name": "Matte Black", "thumbnailUrl": "...", "imageUrl": "...", "description": "..." },
...
],
"tires": [ ... ],
"accessories": [ ... ]
}
}
/balance
Get the current Pixel balance and expiry information for the authenticated account.
{
"ok": true,
"pixels": 4800,
"expiryTimestamp": null,
"totalTransformations": 12
}
/catalog/upload
Upload a custom item to your catalog. Items added here appear in the transform widget for your users.
name : "Volcanic Red"
description : "Deep metallic red with volcanic shimmer"
type : "style" // "style" | "tire" | "accessory"
image : [binary file data] // JPEG/PNG, max 5MB
Widget Embed
The easiest way to add Try Garage AI to your website. One <script> tag renders a complete interactive widget.
<div id="trygarage-widget"></div>
<script
src="https://trygarage.net/embed/widget.js"
data-key="YOUR_EMBED_KEY"
data-theme="dark"
data-lang="en"
data-primary-color="#ff4500"
data-on-result="window.onGarageResult"
defer
></script>
<script>
// Optional: receive the result image URL in your own JS
window.onGarageResult = function(resultUrl, metadata) {
console.log('AI result:', resultUrl);
console.log('Style used:', metadata.style);
};
</script>
iFrame Embed
For CMS platforms (WordPress, Shopify, Webflow) where custom JS is restricted, use the iFrame embed.
<iframe
src="https://trygarage.net/embed/frame?key=YOUR_EMBED_KEY&theme=dark&lang=en"
width="100%"
height="700"
frameborder="0"
allow="camera; clipboard-write"
loading="lazy"
title="Try Garage AI — Car Visualizer"
></iframe>
Embed Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
data-key | string | — | Required. Your embed API key |
data-theme | dark | light | dark | Widget color theme |
data-lang | en | fr | es | ar | en | Interface language |
data-catalog | string | default | Your catalog ID (for custom catalogs) |
data-primary-color | hex | #ff4500 | Accent color override |
data-on-result | callback | — | JS global function called with result URL |
data-hide-credits | boolean | false | Hide the "Powered by Try Garage AI" footer |
Pixel Credits
Pixels are the credit currency used to pay for transformations. Each account starts with 330 free Pixels. Additional Pixels are purchased in packages.
Pixels are deducted per-transform based on the options selected:
| Option | Cost |
|---|---|
| Style (paint/wrap) — always charged if anything is selected | 200 px |
| Tires add-on | 130 px |
| Accessories add-on | 130 px |
| 4K resolution add-on | 100 px |