Agent API
TryDrobe agent try-on docs
Programmatically generate commerce-grade virtual try-ons for AI agents and shopping workflows. V1 uses the standard Stripe Machine Payments Protocol flow with Shared Payment Tokens for one paid try-on request.
Machine-readable descriptions
Agent clients and crawlers can discover this paid virtual try-on endpoint through OpenAPI, the plain-text agents file, and the MCP capability manifest.
Endpoint
POST https://trydrobe.com/api/agent/try-onRequest body
{
"personImageUrl": "https://example.com/person.jpg",
"garmentImageUrl": "https://example.com/garment.png",
"callbackUrl": "https://agent.example.com/callback",
"metadata": {
"source": "agent"
}
}Image URLs must be public HTTPS URLs. Private networks, localhost, oversized files, and unsupported image types are rejected before generation.
Payment flow
A request without payment credentials returns HTTP 402 with a standard MPPWWW-Authenticate: Paymentchallenge. Agents create a Stripe Shared Payment Token scoped to TryDrobe’s Stripe profile, then retry the same request withAuthorization: Payment ....
HTTP/1.1 402 Payment Required
WWW-Authenticate: Payment id="...", method="stripe", intent="charge", ...
Cache-Control: no-storeThe challenge includes the amount, currency, Stripe method details, and the Stripe profile/network ID. Test integrations should use profile_test_...; live integrations should use profile_....
Example retry
npx @stripe/link-cli mpp pay https://trydrobe.com/api/agent/try-on \
--spend-request-id lsrq_... \
--method POST \
--data '{
"personImageUrl": "https://example.com/person.jpg",
"garmentImageUrl": "https://example.com/dress.png",
"metadata": { "source": "agent" }
}'
curl https://trydrobe.com/api/agent/try-on \
-X POST \
-H "Content-Type: application/json" \
-H "Idempotency-Key: tryon_123" \
-H "Authorization: Payment <mpp-credential>" \
-d '{
"personImageUrl": "https://example.com/person.jpg",
"garmentImageUrl": "https://example.com/dress.png",
"metadata": { "source": "agent" }
}'Successful responses include a standardPayment-Receiptheader whose Stripe reference is the PaymentIntent ID.
Successful response
{
"success": true,
"jobId": "uuid",
"paymentId": "uuid",
"paymentIntentId": "pi_...",
"amount_cents": 35,
"currency": "usd",
"status": "succeeded",
"resultUrl": "https://...",
"resultUrlExpiresIn": 3600,
"generator": "vertex",
"latencyMs": 18000
}Limits
V1 rate limits by IP and caps concurrent jobs. Send anIdempotency-Keyto make retries safe.
Privacy
Source image bytes are not stored by default. TryDrobe stores request metadata, payment records, and generated result paths for fulfillment and abuse prevention.