Agent API
TryDrobe agent try-on docs
Programmatically generate commerce-grade virtual try-ons for AI agents and shopping workflows. Use account MCP keys with an existing TryDrobe credit balance, or use the Stripe Machine Payments Protocol with Shared Payment Tokens for an anonymous paid call.
Machine-readable descriptions
Agent clients and crawlers can discover both access models through OpenAPI, the plain-text agents file, and the MCP server card.
Account MCP server
Create an expiring API key in the MCP / API dashboard, then connect a Streamable HTTP MCP client tohttps://mcp.trydrobe.com. Send the key as a bearer token. Keys are displayed once and can be revoked at any time.
# Codex config.toml
[mcp_servers.trydrobe]
url = "https://mcp.trydrobe.com"
bearer_token_env_var = "TRYDROBE_API_KEY"
# Set this outside source control
export TRYDROBE_API_KEY="td_mcp_..."The server exposes get_account_usage,create_virtual_try_on, andget_try_on_status. A try-on costs 2 account credits; failed generations are refunded automatically. The limit is 5 create requests per minute per key and 2 active MCP try-ons per account.
Stripe MPP pay-per-call 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.