{"openapi":"3.1.0","info":{"title":"FreeSaveVideo personal agent API","version":"2.0.0"},"servers":[{"url":"https://api.freesavevideo.online"}],"components":{"securitySchemes":{"agentToken":{"type":"http","scheme":"bearer","bearerFormat":"fsv_agent_"}}},"paths":{"/agent/v1/products":{"get":{"operationId":"list_payment_products","description":"Public catalog. Amounts use minor currency units: fen or cents.","parameters":[{"name":"kind","in":"query","required":true,"schema":{"type":"string","enum":["credits","memberships"]}},{"name":"provider","in":"query","schema":{"type":"string","enum":["wechat","nowpayments","buymeacoffee"],"default":"wechat"}}],"responses":{"200":{"description":"Products with enabled flags, currency, amountFen and benefits"},"400":{"description":"Invalid kind/provider"}}}},"/agent/v1/checkouts":{"post":{"operationId":"create_checkout","security":[{"agentToken":[]}],"description":"Requires payments:create. Create an unpaid order within grant currency and amount limits. Present confirmationUrl to the user. Only the user can confirm and pay. Reuse the same idempotencyKey on retries; deduplication has no one-hour cutoff.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["kind","productKey","idempotencyKey"],"properties":{"kind":{"type":"string","enum":["credits","memberships"]},"provider":{"type":"string","enum":["wechat","nowpayments","buymeacoffee"],"default":"wechat"},"productKey":{"type":"string","minLength":1,"maxLength":80},"idempotencyKey":{"type":"string","pattern":"^[a-zA-Z0-9_-]{8,80}$"}}}}}},"responses":{"200":{"description":"Checkout ID, product/amount, confirmationUrl, status and readyToContinue:false"},"400":{"description":"Invalid input or unavailable product"},"401":{"description":"Invalid credential"},"403":{"description":"Purchase scope, currency, per-order or daily order ceiling denied"},"409":{"description":"Key already used with different input"},"429":{"description":"Call limit reached"}}}},"/agent/v1/checkouts/{checkoutId}":{"get":{"operationId":"get_checkout","security":[{"agentToken":[]}],"description":"Requires payments:read. Only checkouts created by this credential are visible. Poll no more than once per 15 seconds. Resume only if readyToContinue:true; payment does not expand existing download permissions.","parameters":[{"name":"checkoutId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Verified order status, paidAt and readyToContinue; no user profile or provider notifications"},"401":{"description":"Invalid credential"},"403":{"description":"Scope denied"},"404":{"description":"Checkout not found for this credential"},"429":{"description":"Call limit reached"},"502":{"description":"Order reconciliation unavailable"}}}},"/agent/v1/capabilities":{"get":{"operationId":"get_capabilities","responses":{"200":{"description":"Services, pricing rules, permission and delivery guidance"}}}},"/agent/v1/balance":{"get":{"operationId":"get_balance","security":[{"agentToken":[]}],"responses":{"200":{"description":"Points balance and this grant's limits"},"401":{"description":"Invalid, expired or revoked token"},"403":{"description":"Scope denied"},"429":{"description":"Call limit reached"}}}},"/agent/v1/resolve":{"post":{"operationId":"resolve_media","security":[{"agentToken":[]}],"description":"Resolve one media link. Successful resolution consumes points or an authorized membership download. Use the same idempotencyKey when retrying; inspect status before attempting a save.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["url","idempotencyKey"],"properties":{"url":{"type":"string","format":"uri","maxLength":4096},"idempotencyKey":{"type":"string","pattern":"^[a-zA-Z0-9_-]{8,80}$"},"downloadMode":{"type":"string","enum":["auto","audio","mute"],"default":"auto"},"videoQuality":{"type":"string","enum":["1080","720","480","360","240","144"],"default":"720"}}}}}},"responses":{"200":{"description":"Existing downloader result plus points outcome; links may expire"},"400":{"description":"Invalid link or options"},"401":{"description":"Invalid token"},"403":{"description":"Scope, membership permission or points limit denied"},"429":{"description":"Call limit reached"}}}}}}