{"components":{"schemas":{"APIError":{"properties":{"code":{"type":"string"},"docs_url":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message","request_id"],"type":"object"},"APIResponse":{"properties":{"data":{"description":"Response data (endpoint-specific)","type":"object"},"page":{"type":"integer"},"page_size":{"type":"integer"},"request_id":{"type":"string"},"total":{"description":"Total count (list endpoints)","type":"integer"},"usage":{"$ref":"#/components/schemas/UsageInfo"},"warnings":{"items":{"type":"string"},"type":"array"}},"required":["data","request_id"],"type":"object"},"UsageInfo":{"properties":{"coin_cost":{"type":"integer"},"remaining_balance":{"type":"integer"}},"type":"object"}},"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"X-API-Key","type":"apiKey"},"BearerAuth":{"scheme":"bearer","type":"http"}}},"info":{"contact":{"email":"support@trenz.ai","name":"Trenz"},"description":"Trenz Open Platform API for cross-border e-commerce data, content creation, social media management and advertising.\n\n## Authentication\n\nAll requests must include `X-API-Key` header or `Authorization: Bearer \u003cAPI-Key\u003e`.\n\n## Error Codes\n\n| HTTP | Code | Description |\n|------|------|-------------|\n| 400 | BAD_REQUEST | Malformed request |\n| 400 | INVALID_PARAM | Invalid parameter |\n| 400 | MISSING_PARAM | Required parameter missing |\n| 400 | INVALID_SORT_FIELD | Invalid sort field |\n| 400 | INVALID_INCLUDE | Invalid include parameter |\n| 400 | PAGE_SIZE_EXCEEDED | Page size exceeded |\n| 401 | AUTH_MISSING_KEY | API Key missing |\n| 401 | AUTH_INVALID_KEY | API Key invalid |\n| 401 | AUTH_KEY_REVOKED | API Key revoked |\n| 401 | AUTH_KEY_SUSPENDED | API Key suspended |\n| 402 | INSUFFICIENT_BALANCE | Insufficient balance |\n| 403 | FORBIDDEN_SCOPE | No permission to access this resource |\n| 404 | ROUTE_NOT_FOUND | Endpoint not found |\n| 404 | TASK_NOT_FOUND | Async task not found |\n| 429 | RATE_LIMITED | Rate limit exceeded |\n| 429 | QUOTA_EXCEEDED | Quota exceeded |\n| 500 | INTERNAL_ERROR | Internal server error |\n| 502 | BACKEND_ERROR | Upstream service error |\n| 503 | BACKEND_UNAVAILABLE | Upstream service unavailable |\n| 504 | BACKEND_TIMEOUT | Upstream service timeout |","title":"Trenz Open Platform API","version":"1.0.0"},"openapi":"3.0.3","paths":{"/open/v1/ad-creatives/{id}":{"get":{"description":"Get TikTok ad creative details.","operationId":"trenz-ad-creative-detail","parameters":[{"description":"Routing parameter: routes to different backends by country value","in":"query","name":"country","required":true,"schema":{"enum":["br","de","es","fr","gb","id","it","jp","mx","my","ph","sg","th","us","vn"],"type":"string"}},{"description":"Include related resources, comma-separated (values: calendar(Calendar data), core(Core metrics), products(Linked products), similar(Similar creatives), trend(Trend data))","in":"query","name":"include","required":false,"schema":{"type":"string"}},{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"items":{"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"TikTok Ad Creative Detail","tags":["Data/Ads"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.ads.read"}},"/open/v1/ads/accounts":{"post":{"description":"List ad accounts with platform filtering; returns account info and statistics.","operationId":"trenz-ads-account-list","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"page":{"description":"Page number","type":"integer"},"page_size":{"default":10,"description":"Page size, default 10, max 100","maximum":100,"type":"integer"},"platforms":{"description":"Platform type list, default [\"tiktok-advertiser\"]","items":{"type":"string"},"type":"array"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"accounts":{"description":"Account list","items":{"properties":{"account_id":{"description":"Account ID","type":"string"},"advertiser_id":{"description":"Advertiser ID","type":"string"},"advertiser_name":{"description":"Advertiser name","type":"string"},"platform":{"description":"Platform type","type":"string"},"remark":{"description":"Remark","type":"string"},"status":{"description":"Status","type":"string"}},"type":"object"},"type":"array"},"page_info":{"description":"Pagination","properties":{"page":{"type":"integer"},"page_size":{"type":"integer"},"total_number":{"type":"integer"},"total_page":{"type":"integer"}},"type":"object"},"stats":{"description":"Account statistics","type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Ad Account List","tags":["Ads/Accounts"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.ads.read"}},"/open/v1/ads/accounts/remark":{"post":{"description":"Update the remark of an ad account; an empty string clears the remark.","operationId":"trenz-ads-account-update-remark","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_id":{"description":"Advertiser account ID (database primary key)","type":"string"},"remark":{"description":"Remark content, max 500 characters, empty string clears the remark","type":"string"}},"required":["account_id","remark"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"account":{"description":"Updated account info","properties":{"account_id":{"description":"Account ID","type":"string"},"advertiser_id":{"description":"Advertiser ID","type":"string"},"remark":{"description":"Updated remark","type":"string"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Update Ad Account Remark","tags":["Ads/Accounts"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.ads.write"}},"/open/v1/ads/search":{"get":{"description":"Search TikTok ad creatives with filters on delivery days, estimated GMV, engagement rate, etc.","operationId":"trenz-ads-search","parameters":[{"description":"Ad type: 1=TikTok Shop, 2=Independent Site, 3=App, 4=Game, 5=Brand, 6=Lead, 7=Engagement","in":"query","name":"ad_type","required":false,"schema":{"type":"string"}},{"description":"Ad category ID","in":"query","name":"category","required":false,"schema":{"type":"string"}},{"description":"Exclude Spark Ads","in":"query","name":"exclude_spark_ads","required":false,"schema":{"type":"boolean"}},{"description":"Search keyword","in":"query","name":"keyword","required":false,"schema":{"type":"string"}},{"description":"Max delivery days","in":"query","name":"max_days","required":false,"schema":{"type":"number"}},{"description":"Max GMV (USD)","in":"query","name":"max_gmv","required":false,"schema":{"type":"number"}},{"description":"Max views","in":"query","name":"max_views","required":false,"schema":{"type":"number"}},{"description":"Min delivery days","in":"query","name":"min_days","required":false,"schema":{"type":"number"}},{"description":"Min GMV (USD)","in":"query","name":"min_gmv","required":false,"schema":{"type":"number"}},{"description":"Min views","in":"query","name":"min_views","required":false,"schema":{"type":"number"}},{"description":"Page number, default 1","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},{"description":"Page size, default 20, max 20","in":"query","name":"page_size","required":false,"schema":{"default":20,"maximum":20,"type":"integer"}},{"description":"Sort field, format: field:asc|desc. Allowed fields: cost, days, engagement, gmv, views. Default: gmv:desc","in":"query","name":"sort","required":false,"schema":{"default":"gmv:desc","enum":["cost","days","engagement","gmv","views"],"type":"string"}},{"description":"Routing parameter: routes to different backends by country value","in":"query","name":"country","required":true,"schema":{"enum":["br","de","es","fr","gb","id","it","jp","mx","my","ph","sg","th","us","vn"],"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"items":{"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Ad Search","tags":["Data/Ads"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.ads.read"}},"/open/v1/ads/tiktok/ads":{"post":{"description":"List TikTok ads with field selection, filter conditions, and metrics.","operationId":"trenz-ads-list","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_id":{"description":"Advertiser account ID","type":"string"},"advertiser_id":{"description":"Advertiser account ID","type":"string"},"exclude_field_types_in_response":{"description":"Excluded field types","items":{"type":"string"},"type":"array"},"fields":{"description":"Fields to return","items":{"type":"string"},"type":"array"},"filtering":{"description":"Filter (click to expand for details)","properties":{"ad_ids":{"description":"Ad ID list","items":{"type":"string"},"type":"array"},"ad_name":{"description":"Ad name (fuzzy search)","type":"string"},"adgroup_ids":{"description":"Ad group ID list","items":{"type":"string"},"type":"array"},"campaign_ids":{"description":"Ad campaign ID list","items":{"type":"string"},"type":"array"},"objective_type":{"description":"Delivery objective type","type":"string"},"primary_status":{"description":"Primary status","type":"string"},"secondary_status":{"description":"Sub-status","type":"string"}},"type":"object"},"force_refresh":{"description":"Whether to force refresh","type":"boolean"},"page":{"description":"Page number","type":"integer"},"page_size":{"default":20,"description":"Page size, default 20, max 100","maximum":100,"type":"integer"},"with_metrics":{"description":"Whether to include metric data","type":"boolean"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"list":{"description":"Ad list","items":{"properties":{"ad_id":{"type":"string"},"ad_name":{"type":"string"},"adgroup_id":{"type":"string"},"advertiser_id":{"type":"string"},"campaign_id":{"type":"string"},"create_time":{"type":"string"},"operation_status":{"type":"string"},"status":{"type":"string"}},"type":"object"},"type":"array"},"page_info":{"description":"Pagination","properties":{"page":{"type":"integer"},"page_size":{"type":"integer"},"total_number":{"type":"integer"},"total_page":{"type":"integer"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Ad List","tags":["Ads/Campaigns"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.ads.read"}},"/open/v1/ads/tiktok/ads/detail":{"post":{"description":"Get full details of a single TikTok ad, including targeting, budget/bid, and performance data.","operationId":"trenz-ads-detail","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"ad_id":{"description":"Ad ID","type":"string"}},"required":["ad_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"ad_id":{"description":"Ad ID","type":"string"},"ad_name":{"description":"Ad name","type":"string"},"ad_text":{"description":"Ad copy","type":"string"},"adgroup_id":{"description":"Ad group ID","type":"string"},"adgroup_name":{"description":"Ad group name","type":"string"},"advertiser_id":{"description":"Advertiser account ID","type":"string"},"advertiser_name":{"description":"Advertiser account name","type":"string"},"bid_price":{"description":"Bid","type":"number"},"budget":{"description":"Budget amount","type":"number"},"campaign_id":{"description":"Campaign ID","type":"string"},"campaign_name":{"description":"Campaign name","type":"string"},"currency":{"description":"Currency","type":"string"},"data_items":{"description":"Performance data","items":{"type":"object"},"type":"array"},"images":{"description":"Image file","items":{"properties":{"file_name":{"type":"string"},"url":{"type":"string"}},"type":"object"},"type":"array"},"objective_type_desc":{"description":"Promotion objective description","type":"string"},"operation_status":{"description":"Operation status","type":"string"},"schedule_end_time":{"description":"Delivery end time","type":"string"},"schedule_start_time":{"description":"Delivery start time","type":"string"},"state_desc":{"description":"Status description","type":"string"},"videos":{"description":"Video file","items":{"properties":{"file_name":{"type":"string"},"url":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Ad Detail","tags":["Ads/Campaigns"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.ads.read"}},"/open/v1/ads/tiktok/ads/insight":{"post":{"description":"Get TikTok ad performance data, including dashboard summary and daily breakdown.","operationId":"trenz-ads-insight-data","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"ad_id":{"description":"Ad ID","type":"string"},"end_date":{"description":"Query end date, format YYYY-MM-DD, omit for all-time","type":"string"},"start_date":{"description":"Query start date, format YYYY-MM-DD, omit for all-time","type":"string"}},"required":["ad_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"board_items":{"description":"Dashboard summary","items":{"properties":{"key":{"type":"string"},"label":{"type":"string"},"trend":{"type":"number"},"value":{"type":"number"}},"type":"object"},"type":"array"},"detail_items":{"description":"Daily detail data","items":{"properties":{"date":{"type":"string"},"metrics":{"type":"object"}},"type":"object"},"type":"array"},"metrics":{"description":"Available metric definition list","items":{"properties":{"key":{"type":"string"},"label":{"type":"string"},"unit":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Ad Insight Data","tags":["Ads/Campaigns"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.ads.read"}},"/open/v1/ads/tiktok/leads":{"post":{"description":"List TikTok ad leads, filterable by advertiser account, platform, and time range.","operationId":"trenz-ads-leads-list","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"advertiser_id":{"description":"Advertiser account ID","type":"string"},"end_time":{"description":"Lead creation time end (Unix seconds)","type":"integer"},"lead_id":{"description":"Lead ID (exact match)","type":"string"},"page":{"description":"Page number","type":"integer"},"page_size":{"default":10,"description":"Page size, default 10, max 100","maximum":100,"type":"integer"},"platform":{"description":"Platform type, e.g. tiktok","type":"string"},"start_time":{"description":"Lead creation time start (Unix seconds)","type":"integer"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"list":{"description":"Lead list","items":{"properties":{"ad_id":{"type":"string"},"advertiser_id":{"type":"string"},"create_time":{"type":"string"},"form_data":{"type":"object"},"lead_id":{"type":"string"},"page_id":{"type":"string"},"platform":{"type":"string"}},"type":"object"},"type":"array"},"page_info":{"description":"Pagination","properties":{"page":{"type":"integer"},"page_size":{"type":"integer"},"total_number":{"type":"integer"},"total_page":{"type":"integer"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Leads List","tags":["Ads/Leads \u0026 Reports"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.ads.read"}},"/open/v1/ads/tiktok/pages":{"post":{"description":"List TikTok landing pages, filterable by status, title, type, and time range.","operationId":"trenz-ads-pages-list","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_id":{"description":"Advertiser account ID","type":"string"},"advertiser_id":{"description":"Advertiser account ID (one of `advertiser_account_id` or `library_id` is required)","type":"string"},"business_type":{"description":"Page type, default LEAD_GEN","type":"string"},"business_types":{"description":"Page type array (takes precedence over `business_type`)","items":{"type":"string"},"type":"array"},"library_id":{"description":"Form library ID (required when migrating the page to Business Center)","type":"string"},"page":{"description":"Page number","type":"integer"},"page_size":{"default":20,"description":"Page size, default 20, max 100","maximum":100,"type":"integer"},"status":{"description":"Page status filter","type":"string"},"title":{"description":"Page title fuzzy search","type":"string"},"update_time_range":{"description":"Updated time range (click to expand for details)","properties":{"end_time":{"description":"End time","type":"string"},"start_time":{"description":"Start time","type":"string"}},"type":"object"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"list":{"description":"Landing page list","items":{"properties":{"business_type":{"type":"string"},"create_time":{"type":"string"},"page_id":{"type":"string"},"status":{"type":"string"},"title":{"type":"string"},"update_time":{"type":"string"}},"type":"object"},"type":"array"},"page_info":{"description":"Pagination","properties":{"page":{"type":"integer"},"page_size":{"type":"integer"},"total_number":{"type":"integer"},"total_page":{"type":"integer"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Landing Page List","tags":["Ads/Landing Pages"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.ads.read"}},"/open/v1/ads/tiktok/pages/fields":{"post":{"description":"List form field definitions for a TikTok landing page.","operationId":"trenz-ads-page-fields","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_id":{"description":"Advertiser account ID","type":"string"},"advertiser_id":{"description":"Advertiser account ID","type":"string"},"page_id":{"description":"Page ID","type":"string"}},"required":["account_id","advertiser_id","page_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"fields":{"description":"Form field list","items":{"properties":{"field_id":{"type":"string"},"field_name":{"type":"string"},"field_type":{"type":"string"},"options":{"items":{"type":"string"},"type":"array"},"required":{"type":"boolean"}},"type":"object"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Landing Page Field Definitions","tags":["Ads/Landing Pages"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.ads.read"}},"/open/v1/ads/tiktok/report":{"post":{"description":"Get a TikTok ad integrated report with multi-dimensional, multi-metric aggregation.","operationId":"trenz-ads-integrated-report","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_id":{"description":"Advertiser account ID","type":"string"},"advertiser_id":{"description":"Advertiser account ID (one of `advertiser_account_id`, `advertiser_ids`, or `bc_id` is required)","type":"string"},"advertiser_ids":{"description":"Advertiser ID list, max 5","items":{"type":"string"},"type":"array"},"bc_id":{"description":"Business Center ID","type":"string"},"data_level":{"description":"Data level","enum":["AUCTION_AD","AUCTION_ADGROUP","AUCTION_CAMPAIGN","AUCTION_ADVERTISER"],"type":"string"},"dimensions":{"description":"Aggregation dimension","items":{"type":"string"},"type":"array"},"enable_total_metrics":{"description":"Whether to return aggregated metrics","type":"boolean"},"end_date":{"description":"End date, YYYY-MM-DD","type":"string"},"filtering":{"description":"Filter","items":{"properties":{"field_name":{"description":"Filter field name","type":"string"},"filter_type":{"description":"Filter type","type":"string"},"filter_value":{"description":"Filter value","type":"string"}},"type":"object"},"type":"array"},"metrics":{"description":"Metrics to query, default [\"spend\",\"impressions\"]","items":{"type":"string"},"type":"array"},"multi_adv_report_in_utc_time":{"description":"Whether to use UTC time","type":"boolean"},"order_field":{"description":"Sort field","type":"string"},"order_type":{"description":"Sort mode","enum":["ASC","DESC"],"type":"string"},"page":{"description":"Page number","type":"integer"},"page_size":{"default":10,"description":"Page size, default 10, max 1000","maximum":1000,"type":"integer"},"query_lifetime":{"description":"Whether to query lifetime metrics","type":"boolean"},"report_type":{"description":"Report type","enum":["BASIC","AUDIENCE","PLAYABLE_MATERIAL","CATALOG","BC","TT_SHOP"],"type":"string"},"service_type":{"description":"Service type","type":"string"},"start_date":{"description":"Start date, YYYY-MM-DD","type":"string"}},"required":["account_id","report_type","dimensions"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"list":{"description":"Report data list","items":{"properties":{"dimensions":{"description":"Dimension value","type":"object"},"metrics":{"description":"Metric value","type":"object"}},"type":"object"},"type":"array"},"page_info":{"description":"Pagination","properties":{"page":{"type":"integer"},"page_size":{"type":"integer"},"total_number":{"type":"integer"},"total_page":{"type":"integer"}},"type":"object"},"total_metrics":{"description":"Aggregated metrics (returned when enable_total_metrics is true)","type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Ad Integrated Report","tags":["Ads/Leads \u0026 Reports"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.ads.read"}},"/open/v1/ai/avatar/analyze":{"post":{"description":"Analyze whether a photo is suitable as avatar source material.","operationId":"trenz-ai-avatar-analyze","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"cdn_url":{"description":"Person photo URL (any publicly accessible image URL is supported)","type":"string"}},"required":["cdn_url"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1000,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"is_suitable":{"description":"Whether suitable","type":"boolean"},"issues":{"description":"Issue list","items":{"type":"string"},"type":"array"},"score":{"description":"Score (0-100)","type":"number"},"suggestions":{"description":"Improvement suggestions","items":{"type":"string"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Avatar Photo Analysis","tags":["Content/Avatar"],"x-billing-mode":"per_call","x-coin-cost":1000,"x-scope":"trenz.ai.read"}},"/open/v1/ai/embedding":{"post":{"description":"Convert text into a vector embedding.","operationId":"trenz-ai-embedding","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"text":{"description":"Text to embed (required when `type=text`)","type":"string"},"type":{"description":"Data type, currently only `text` is supported","enum":["text"],"type":"string"}},"required":["type"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":100,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"dimensions":{"description":"Embedding dimension","type":"integer"},"embedding":{"description":"Embedding array","items":{"type":"number"},"type":"array"},"model":{"description":"Model used","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Text Embedding","tags":["Content/Tools"],"x-billing-mode":"per_call","x-coin-cost":100,"x-scope":"trenz.ai.read"}},"/open/v1/ai/images/generate":{"post":{"description":"AI image generation across multiple scenarios (general editing / AI clothing / hero shot / avatar / handheld product).\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-ai-image-generate","parameters":[{"description":"Country code","in":"query","name":"country_code","schema":{"default":"us","type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"At least one of `product_images` or `digit_human_images` is required","properties":{"digit_human_images":{"description":"Avatar image list (at least one of `avatar_images` or `product_images` is required)","items":{"properties":{"url":{"description":"Avatar image URL (any publicly accessible image URL is supported)","type":"string"}},"type":"object"},"type":"array"},"function_type":{"default":"general_edit","description":"Feature type","enum":["general_edit","ai_clothing","product_image","digital_avatar","handheld_product"],"type":"string"},"image_size":{"default":"1K","description":"Image resolution","type":"string"},"model_type":{"default":"gemini","description":"AI model type","enum":["gemini"],"type":"string"},"product_images":{"description":"Product image list (at least one of `product_images` or `avatar_images` is required)","items":{"properties":{"url":{"description":"Product image URL (any publicly accessible image URL is supported)","type":"string"}},"type":"object"},"type":"array"},"prompt":{"description":"Prompt describing the desired image (scene, style, composition, etc.)","type":"string"},"ratio":{"default":"9:16","description":"Image ratio","enum":["1:1","9:16","16:9"],"type":"string"}},"required":["prompt"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":500,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"job_id":{"description":"Async task ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"AI Image Generation","tags":["Content/AI Image"],"x-billing-mode":"async_on_complete","x-coin-cost":500,"x-scope":"trenz.ai.write"}},"/open/v1/ai/materials/inpainting":{"post":{"description":"Inpaint (remove) subtitles or watermarks in a video, with region and time-range targeting.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-material-inpainting","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"boxes":{"default":[[0,0,1,1]],"description":"Inpainting region coordinates","items":{"items":{"type":"number"},"type":"array"},"type":"array"},"end_time":{"description":"End time (seconds)","type":"number"},"start_time":{"description":"Start time (seconds)","type":"number"},"url":{"description":"Video URL","type":"string"}},"required":["url"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1000,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"job_id":{"description":"Async task ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Video Subtitle Removal","tags":["Content/AI Image"],"x-billing-mode":"async_on_complete","x-coin-cost":1000,"x-scope":"trenz.ai.write"}},"/open/v1/ai/product/description":{"post":{"description":"AI-generated product description.","operationId":"trenz-ai-product-description","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"At least one of `title`, `category`, or `url` is required","properties":{"category":{"description":"Product category ID (at least one of `category`, `title`, or `url` is required)","type":"string"},"prompt":{"description":"Custom prompt","type":"string"},"title":{"description":"Product name (at least one of `name`, `category`, or `url` is required)","type":"string"},"url":{"description":"Product image URL (at least one of `product_image_url`, `title`, or `category` is required)","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":500,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"descriptions":{"description":"Generated description list","items":{"type":"string"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"AI Product Description","tags":["Content/AI Copywriting"],"x-billing-mode":"per_call","x-coin-cost":500,"x-scope":"trenz.ai.read"}},"/open/v1/ai/product/title":{"post":{"description":"AI-generated product title.","operationId":"trenz-ai-product-title","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"At least one of `old_title` or `url` is required","properties":{"old_title":{"description":"Original product title (at least one of `original title` or `url` is required)","type":"string"},"prompt":{"description":"Custom prompt","type":"string"},"url":{"description":"Product image URL (at least one of `product_image_url` or `old_title` is required)","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":500,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"titles":{"description":"Generated title list","items":{"type":"string"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"AI Product Title","tags":["Content/AI Copywriting"],"x-billing-mode":"per_call","x-coin-cost":500,"x-scope":"trenz.ai.read"}},"/open/v1/ai/products/review-analysis":{"post":{"description":"AI analysis of product user reviews.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-product-review-analysis","parameters":[{"description":"Country code","in":"query","name":"country_code","schema":{"default":"us","type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"is_regenerate":{"default":false,"description":"Whether to force re-analysis","type":"boolean"},"product_id":{"description":"Product ID","type":"string"}},"required":["product_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1000,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"product_id":{"description":"Product ID","type":"string"},"task_id":{"description":"Async task ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Product Review Analysis","tags":["Content/AI Copywriting"],"x-billing-mode":"async_on_complete","x-coin-cost":1000,"x-scope":"trenz.ai.write"}},"/open/v1/ai/sd-pro-fast/video/generation":{"post":{"description":"SeeDance2.0 Fast AI video generation with multi-image, reference video/audio, frame mode and other advanced features; faster generation.\n\n\u003e 💡 **Real-person reference images / videos**\n\u003e\n\u003e The upstream \"Asset Library API\" is used for compliance verification of real-person images / videos.\n\u003e\n\u003e **🎯 This endpoint already wraps that flow internally — callers do NOT need to invoke the Asset Library API separately.**\n\u003e\n\u003e Simply pass publicly accessible image / video URLs via the `images` or `reference_videos` fields.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-ai-sd-pro-fast-generate","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"aspect_ratio":{"default":"9:16","enum":["9:16","16:9","1:1","4:3","3:4","21:9"],"type":"string"},"audio":{"default":true,"type":"boolean"},"country_code":{"default":"us","type":"string"},"duration":{"default":5,"maximum":15,"minimum":4,"type":"integer"},"images":{"description":"Multiple reference image list","items":{"properties":{"url":{"type":"string"}},"type":"object"},"type":"array"},"language":{"type":"string"},"prompt":{"description":"Video generation prompt, 1-5000 characters","type":"string"},"reference_audios":{"description":"Reference audio list","items":{"properties":{"url":{"type":"string"}},"type":"object"},"type":"array"},"reference_videos":{"description":"Reference video list","items":{"properties":{"url":{"type":"string"}},"type":"object"},"type":"array"},"resolution":{"default":"720p","enum":["480p","720p"],"type":"string"},"role_mode":{"default":"reference","enum":["reference","frame"],"type":"string"}},"required":["prompt"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1575,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"task_id":{"description":"Async task ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"SeeDance2.0 Pro Fast Video Generation","tags":["Content/AI Video"],"x-billing-mode":"async_on_complete","x-coin-cost":1575,"x-pricing":{"default_quantity":5,"default_tier":"720p","fallback_coin_cost":1575,"mode":"per_unit","quantity_param":"duration","tier_param":"resolution","unit_price_map":{"480p":48,"720p":105}},"x-scope":"trenz.ai_video.write"}},"/open/v1/ai/sd-pro/video/generation":{"post":{"description":"SeeDance2.0 Pro AI video generation with multi-image, reference video/audio, frame mode and other advanced features.\n\n\u003e 💡 **Real-person reference images / videos**\n\u003e\n\u003e The upstream \"Asset Library API\" is used for compliance verification of real-person images / videos.\n\u003e\n\u003e **🎯 This endpoint already wraps that flow internally — callers do NOT need to invoke the Asset Library API separately.**\n\u003e\n\u003e Simply pass publicly accessible image / video URLs via the `images` or `reference_videos` fields.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-ai-sd-pro-generate","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"aspect_ratio":{"default":"9:16","enum":["9:16","16:9","1:1","4:3","3:4","21:9"],"type":"string"},"audio":{"default":true,"type":"boolean"},"country_code":{"default":"us","type":"string"},"duration":{"default":5,"maximum":15,"minimum":4,"type":"integer"},"images":{"description":"Multiple reference image list","items":{"properties":{"url":{"type":"string"}},"type":"object"},"type":"array"},"language":{"type":"string"},"prompt":{"description":"Video generation prompt, 1-5000 characters","type":"string"},"reference_audios":{"description":"Reference audio list","items":{"properties":{"url":{"type":"string"}},"type":"object"},"type":"array"},"reference_videos":{"description":"Reference video list","items":{"properties":{"url":{"type":"string"}},"type":"object"},"type":"array"},"resolution":{"default":"720p","enum":["480p","720p"],"type":"string"},"role_mode":{"default":"reference","enum":["reference","frame"],"type":"string"}},"required":["prompt"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1950,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"task_id":{"description":"Async task ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"SeeDance2.0 Video Generation","tags":["Content/AI Video"],"x-billing-mode":"async_on_complete","x-coin-cost":1950,"x-pricing":{"default_quantity":5,"default_tier":"720p","fallback_coin_cost":1950,"mode":"per_unit","quantity_param":"duration","tier_param":"resolution","unit_price_map":{"480p":60,"720p":130}},"x-scope":"trenz.ai_video.write"}},"/open/v1/ai/search/image":{"post":{"description":"Aggregated multi-source image search.","operationId":"trenz-ai-image-search","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"limit":{"default":20,"description":"Result size limit, max 100","type":"integer"},"offset":{"default":0,"description":"Pagination offset","type":"integer"},"query":{"description":"Search keyword","type":"string"}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":500,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"description":"Image list","items":{"properties":{"author":{"type":"string"},"description":{"type":"string"},"height":{"type":"integer"},"id":{"type":"string"},"source":{"type":"string"},"thumbnail_url":{"type":"string"},"url":{"type":"string"},"width":{"type":"integer"}},"type":"object"},"type":"array"},"total":{"description":"Total count","type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Aggregated Image Search","tags":["Content/Material Search"],"x-billing-mode":"per_call","x-coin-cost":500,"x-scope":"trenz.ai.read"}},"/open/v1/ai/search/material":{"post":{"description":"Aggregated multi-source creative search (video and image).","operationId":"trenz-ai-material-search","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"limit":{"default":20,"description":"Result size limit, max 100","type":"integer"},"offset":{"default":0,"description":"Pagination offset","type":"integer"},"query":{"description":"Search keyword","type":"string"}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":500,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"description":"Creative list","items":{"properties":{"duration":{"type":"number"},"height":{"type":"integer"},"id":{"type":"string"},"media_type":{"type":"string"},"preview_url":{"type":"string"},"source":{"type":"string"},"thumbnail_url":{"type":"string"},"title":{"type":"string"},"width":{"type":"integer"}},"type":"object"},"type":"array"},"total":{"description":"Total count","type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Aggregated Material Search","tags":["Content/Material Search"],"x-billing-mode":"per_call","x-coin-cost":500,"x-scope":"trenz.ai.read"}},"/open/v1/ai/videos/clone":{"post":{"description":"Video clone generation.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-video-clone","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"product_description":{"description":"Product description (selling points, use cases)","maxLength":500,"type":"string"},"product_image":{"description":"Product image info (click to expand for details)","properties":{"os_bucket":{"description":"Bucket name (the `s3_bucket` returned by 'Generate Presigned Upload URL' under the 'General' category)","type":"string"},"os_key":{"description":"Object key (the `object_key` returned by 'Generate Presigned Upload URL' under the 'General' category)","type":"string"},"storage_type":{"default":"tos","description":"Storage type (s3/tos)","type":"string"}},"required":["os_bucket","os_key"],"type":"object"},"reference_video":{"description":"Reference video (TikTok or uploaded, click to expand for details)","properties":{"country_code":{"description":"Country code","type":"string"},"os_bucket":{"description":"Bucket name (the `s3_bucket` returned by 'Generate Presigned Upload URL' under the 'General' category; one of `bucket_name` or `video_id` is required)","type":"string"},"os_key":{"description":"Object key (the `object_key` returned by 'Generate Presigned Upload URL' under the 'General' category; one of `object_key` or `video_id` is required)","type":"string"},"storage_type":{"default":"tos","description":"Storage type","type":"string"},"video_id":{"description":"TikTok video ID","type":"string"}},"type":"object"},"sora2_config":{"description":"Sora2 config (click to expand for details)","properties":{"aspect_ratio":{"description":"Video ratio","enum":["9:16","16:9"],"type":"string"},"language":{"description":"Language code","type":"string"},"model_type":{"default":"third_party_and_official","description":"Scheduling strategy","type":"string"}},"required":["aspect_ratio","language"],"type":"object"}},"required":["product_image","product_description","reference_video","sora2_config"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1000,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"task_id":{"description":"Async task ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Video Clone","tags":["Content/AI Video"],"x-billing-mode":"async_on_complete","x-coin-cost":1000,"x-scope":"trenz.ai.write"}},"/open/v1/ai/videos/content-analysis":{"post":{"description":"AI content analysis of a video.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-video-content-analysis","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"video_id":{"description":"Video ID","type":"string"}},"required":["video_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1000,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"task_id":{"description":"Async task ID","type":"string"},"video_id":{"description":"Video ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Video Content Analysis","tags":["Content/AI Analysis"],"x-billing-mode":"async_on_complete","x-coin-cost":1000,"x-scope":"trenz.ai.write"}},"/open/v1/ai/videos/grok/generate":{"post":{"description":"Grok-model image-to-video generation, supporting multiple aspect ratios and durations.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-ai-grok-generate","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"aspect_ratio":{"default":"9:16","description":"Aspect ratio","enum":["9:16","16:9"],"type":"string"},"country_code":{"default":"th","description":"Country code","type":"string"},"duration":{"default":5,"description":"Video duration (seconds)","maximum":15,"minimum":2,"type":"integer"},"image":{"description":"Image info (required, image-to-video, click to expand for details)","properties":{"url":{"description":"Image URL (any publicly accessible image URL is supported)","type":"string"}},"type":"object"},"language":{"default":"default","description":"Language","type":"string"},"model":{"default":"grok","description":"Model name","type":"string"},"prompt":{"description":"Video generation prompt","type":"string"}},"required":["prompt"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1500,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"job_id":{"description":"Async task ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Grok Video Generation","tags":["Content/AI Video"],"x-billing-mode":"async_on_complete","x-coin-cost":1500,"x-scope":"trenz.ai.write"}},"/open/v1/ai/videos/scripts/breakdown":{"post":{"description":"Structured breakdown of a video script.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-video-scripts-breakdown","parameters":[{"description":"Language","in":"query","name":"language","schema":{"default":"en","type":"string"}},{"description":"Country code","in":"query","name":"country_code","schema":{"default":"us","type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"video_id":{"description":"Video ID","type":"string"}},"required":["video_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1000,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"task_id":{"description":"Async task ID","type":"string"},"video_id":{"description":"Video ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Video Script Breakdown","tags":["Content/AI Analysis"],"x-billing-mode":"async_on_complete","x-coin-cost":1000,"x-scope":"trenz.ai.write"}},"/open/v1/ai/videos/scripts/breakdown-v2":{"post":{"description":"Structured breakdown of a video script (V2, enhanced).\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-video-scripts-breakdown-v2","parameters":[{"description":"Language","in":"query","name":"language","schema":{"default":"en","type":"string"}},{"description":"Country code","in":"query","name":"country_code","schema":{"default":"us","type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"is_regenerate":{"default":false,"description":"Whether to force regeneration","type":"boolean"},"video_id":{"description":"Video ID","type":"string"}},"required":["video_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1000,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"task_id":{"description":"Async task ID","type":"string"},"video_id":{"description":"Video ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Video Script Breakdown V2","tags":["Content/AI Analysis"],"x-billing-mode":"async_on_complete","x-coin-cost":1000,"x-scope":"trenz.ai.write"}},"/open/v1/ai/videos/scripts/storyboard":{"post":{"description":"Structured breakdown of video storyboard.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-video-scripts-storyboard","parameters":[{"description":"Language","in":"query","name":"language","schema":{"default":"en","type":"string"}},{"description":"Country code","in":"query","name":"country_code","schema":{"default":"us","type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"video_id":{"description":"Video ID","type":"string"}},"required":["video_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1000,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"task_id":{"description":"Async task ID","type":"string"},"video_id":{"description":"Video ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Video Storyboard Breakdown","tags":["Content/AI Analysis"],"x-billing-mode":"async_on_complete","x-coin-cost":1000,"x-scope":"trenz.ai.write"}},"/open/v1/ai/videos/sora2-pro/generate":{"post":{"description":"Sora2 Pro-model video generation with high-quality output.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-ai-sora2pro-generate","parameters":[{"description":"Country code","in":"query","name":"country_code","schema":{"default":"us","type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"aspect_ratio":{"default":"portrait","description":"Video ratio","enum":["portrait","landscape","9:16","16:9"],"type":"string"},"image":{"description":"Image info (optional, click to expand for details)","properties":{"url":{"description":"Image URL (any publicly accessible image URL is supported)","type":"string"}},"type":"object"},"model":{"default":"sora-2-pro-25s-yijia","description":"Model name","type":"string"},"prompt":{"description":"Video generation prompt","type":"string"}},"required":["prompt"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":3000,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"job_id":{"description":"Async task ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Sora2 Pro Video Generation","tags":["Content/AI Video"],"x-billing-mode":"async_on_complete","x-coin-cost":3000,"x-scope":"trenz.ai.write"}},"/open/v1/ai/videos/sora2/generate":{"post":{"description":"Sora2-model video generation, supporting text-to-video and image-to-video.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-ai-sora2-generate","parameters":[{"description":"Country code","in":"query","name":"country_code","schema":{"default":"us","type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"aspect_ratio":{"default":"portrait","description":"Video ratio","enum":["portrait","landscape","9:16","16:9"],"type":"string"},"image":{"description":"Image info (optional, click to expand for details)","properties":{"url":{"description":"Image URL (any publicly accessible image URL is supported)","type":"string"}},"type":"object"},"model":{"default":"sora-2","description":"Model name","type":"string"},"prompt":{"description":"Video generation prompt","type":"string"}},"required":["prompt"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":2000,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"job_id":{"description":"Async task ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Sora2 Video Generation","tags":["Content/AI Video"],"x-billing-mode":"async_on_complete","x-coin-cost":2000,"x-scope":"trenz.ai.write"}},"/open/v1/ai/videos/super-resolution":{"post":{"description":"Video super-resolution enhancement.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-video-super-resolution","parameters":[{"description":"Country code","in":"query","name":"country_code","schema":{"default":"th","type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"url":{"description":"Video URL","type":"string"}},"required":["url"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1000,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"task_id":{"description":"Async task ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Video Super Resolution","tags":["Content/AI Video"],"x-billing-mode":"async_on_complete","x-coin-cost":1000,"x-scope":"trenz.ai.write"}},"/open/v1/ai/videos/talking-photo":{"post":{"description":"Generate a talking-head video from a photo and a script (OmniHuman).\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-video-talking-photo","parameters":[{"description":"Language","in":"query","name":"language","schema":{"default":"zh","type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"long_limit":{"default":750,"description":"Long script character limit","type":"integer"},"short_limit":{"default":150,"description":"Short script character limit","type":"integer"},"url":{"description":"Person photo URL (any publicly accessible image URL is supported)","type":"string"},"video_script_content":{"description":"Voiceover script content","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1500,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"job_id":{"description":"Async task ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Talking Photo Video Generation","tags":["Content/Avatar"],"x-billing-mode":"async_on_complete","x-coin-cost":1500,"x-scope":"trenz.ai.write"}},"/open/v1/ai/videos/transcription":{"post":{"description":"Transcribe speech in a video to text.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-video-transcription","parameters":[{"description":"Country code","in":"query","name":"country_code","schema":{"default":"us","type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"video_id":{"description":"Video ID","type":"string"}},"required":["video_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1000,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"task_id":{"description":"Async task ID","type":"string"},"timestamp_ms":{"description":"Timestamp (ms)","type":"integer"},"video_id":{"description":"Video ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Video Transcription","tags":["Content/Tools"],"x-billing-mode":"async_on_complete","x-coin-cost":1000,"x-scope":"trenz.ai.write"}},"/open/v1/ai/videos/veo3/generate":{"post":{"description":"Veo 3.1-model video generation with multi-image input support.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-ai-veo3-generate","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"aspect_ratio":{"default":"portrait","description":"Video ratio","type":"string"},"country_code":{"default":"th","description":"Country code","type":"string"},"duration":{"default":8,"description":"Video duration (seconds)","enum":[5,8],"type":"integer"},"image":{"description":"Single image (optional, legacy format, click to expand for details)","properties":{"url":{"description":"Image URL (any publicly accessible image URL is supported)","type":"string"}},"type":"object"},"images":{"description":"Image info array (optional, multi-image)","items":{"properties":{"url":{"description":"Image URL (any publicly accessible image URL is supported)","type":"string"}},"type":"object"},"type":"array"},"language":{"default":"default","description":"Language","type":"string"},"model":{"default":"veo3.1","description":"Model name","type":"string"},"prompt":{"description":"Video generation prompt","type":"string"}},"required":["prompt"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1500,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"job_id":{"description":"Async task ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Veo3 Video Generation","tags":["Content/AI Video"],"x-billing-mode":"async_on_complete","x-coin-cost":1500,"x-scope":"trenz.ai.write"}},"/open/v1/ai/videos/wan26/generate":{"post":{"description":"Wan2.6-model image-to-video generation, supporting 720p / 1080p.\n\nAsync endpoint, returns `task_id`. Use `GET /open/v1/tasks/{task_id}` to poll task status and result.","operationId":"trenz-ai-wan26-generate","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"country_code":{"default":"th","description":"Country code","type":"string"},"duration":{"default":15,"description":"Video duration (seconds)","enum":[5,10,15],"type":"integer"},"image":{"description":"Image info (required, image-to-video, click to expand for details)","properties":{"url":{"description":"Image URL (any publicly accessible image URL is supported)","type":"string"}},"required":[],"type":"object"},"language":{"default":"default","description":"Language","type":"string"},"model":{"default":"wan2.6","description":"Model name","type":"string"},"prompt":{"description":"Video generation prompt","type":"string"},"resolution":{"default":"720p","description":"Video resolution","enum":["720p","1080p"],"type":"string"}},"required":["prompt","image"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1500,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"job_id":{"description":"Async task ID","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Wan2.6 Video Generation","tags":["Content/AI Video"],"x-billing-mode":"async_on_complete","x-coin-cost":1500,"x-scope":"trenz.ai.write"}},"/open/v1/creatives/search":{"get":{"description":"Search TikTok ad creatives / video creatives, with filters and sort on category, region, AIGC flag and more.","operationId":"trenz-creatives-search","parameters":[{"description":"Creative category ID","in":"query","name":"category","required":false,"schema":{"type":"string"}},{"description":"Country code (us/th/jp/vn etc.)","in":"query","name":"country","required":false,"schema":{"type":"string"}},{"description":"Whether has linked products","in":"query","name":"has_product","required":false,"schema":{"type":"boolean"}},{"description":"Whether is AI-generated content","in":"query","name":"is_aigc","required":false,"schema":{"type":"boolean"}},{"description":"Whether is sponsored content","in":"query","name":"is_sponsored","required":false,"schema":{"type":"boolean"}},{"description":"Search keyword","in":"query","name":"keyword","required":false,"schema":{"type":"string"}},{"description":"Page number, default 1","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},{"description":"Page size, default 20, max 20","in":"query","name":"page_size","required":false,"schema":{"default":20,"maximum":20,"type":"integer"}},{"description":"Sort field, format: field:asc|desc. Allowed fields: engagement, gmv, gpm, likes, plays. Default: gmv:desc","in":"query","name":"sort","required":false,"schema":{"default":"gmv:desc","enum":["engagement","gmv","gpm","likes","plays"],"type":"string"}},{"description":"Routing parameter: routes to different backends by country value","in":"query","name":"country","required":true,"schema":{"enum":["br","de","es","fr","gb","id","it","jp","mx","my","ph","sg","th","us","vn"],"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"items":{"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Creative Search","tags":["Data/Creatives"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.creative.read"}},"/open/v1/creatives/{id}":{"get":{"description":"Get TikTok creative details with video metrics, creator info, linked products, and optional content analysis and embedding.","operationId":"trenz-creative-detail","parameters":[{"description":"Routing parameter: routes to different backends by country value","in":"query","name":"country","required":true,"schema":{"enum":["br","de","es","fr","gb","id","it","jp","mx","my","ph","sg","th","us","vn"],"type":"string"}},{"description":"Include related resources, comma-separated (values: analysis(Analytics data), embedding(Embedding data))","in":"query","name":"include","required":false,"schema":{"type":"string"}},{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"items":{"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Creative Detail","tags":["Data/Creatives"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.creative.read"}},"/open/v1/creators/search":{"get":{"description":"Search TikTok creators with multi-dimensional filters on followers, GMV, engagement rate, etc.","operationId":"trenz-creators-search","parameters":[{"description":"Creator category ID","in":"query","name":"category","required":false,"schema":{"type":"string"}},{"description":"Whether has contact info","in":"query","name":"has_contact","required":false,"schema":{"type":"boolean"}},{"description":"Search keyword","in":"query","name":"keyword","required":false,"schema":{"type":"string"}},{"description":"Max average views","in":"query","name":"max_avg_views","required":false,"schema":{"type":"number"}},{"description":"Max engagement rate (0-1)","in":"query","name":"max_engagement","required":false,"schema":{"type":"number"}},{"description":"Max followers","in":"query","name":"max_followers","required":false,"schema":{"type":"number"}},{"description":"30-day max GMV (USD)","in":"query","name":"max_gmv_30d","required":false,"schema":{"type":"number"}},{"description":"Min average views","in":"query","name":"min_avg_views","required":false,"schema":{"type":"number"}},{"description":"Min engagement rate (0-1)","in":"query","name":"min_engagement","required":false,"schema":{"type":"number"}},{"description":"Min followers","in":"query","name":"min_followers","required":false,"schema":{"type":"number"}},{"description":"30-day min GMV (USD)","in":"query","name":"min_gmv_30d","required":false,"schema":{"type":"number"}},{"description":"Page number, default 1","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},{"description":"Page size, default 20, max 20","in":"query","name":"page_size","required":false,"schema":{"default":20,"maximum":20,"type":"integer"}},{"description":"Sort field, format: field:asc|desc. Allowed fields: avg_views, engagement, follower_growth_7d, followers, gmv_30d, video_gmv_30d. Default: gmv_30d:desc","in":"query","name":"sort","required":false,"schema":{"default":"gmv_30d:desc","enum":["avg_views","engagement","follower_growth_7d","followers","gmv_30d","video_gmv_30d"],"type":"string"}},{"description":"Routing parameter: routes to different backends by country value","in":"query","name":"country","required":true,"schema":{"enum":["br","de","es","fr","gb","id","it","jp","mx","my","ph","sg","th","us","vn"],"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"items":{"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Creator Search","tags":["Data/Creators"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.creators.read"}},"/open/v1/creators/{id}":{"get":{"description":"Get TikTok creator details with video list and shoppable products.","operationId":"trenz-creators-detail","parameters":[{"description":"Routing parameter: routes to different backends by country value","in":"query","name":"country","required":true,"schema":{"enum":["br","de","es","fr","gb","id","it","jp","mx","my","ph","sg","th","us","vn"],"type":"string"}},{"description":"Include related resources, comma-separated (values: products(Linked products), videos(Linked videos))","in":"query","name":"include","required":false,"schema":{"type":"string"}},{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"items":{"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Creator Detail","tags":["Data/Creators"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.creators.read"}},"/open/v1/lives/search":{"get":{"description":"Search TikTok commerce live streams with filters on sales, GMV, audience count, etc.","operationId":"trenz-lives-search","parameters":[{"description":"Streamer category ID","in":"query","name":"category","required":false,"schema":{"type":"string"}},{"description":"Whether is a commerce live","in":"query","name":"is_commercial","required":false,"schema":{"type":"boolean"}},{"description":"Whether currently live-streaming","in":"query","name":"is_living","required":false,"schema":{"type":"boolean"}},{"description":"Search keyword","in":"query","name":"keyword","required":false,"schema":{"type":"string"}},{"description":"Max audience","in":"query","name":"max_audience","required":false,"schema":{"type":"number"}},{"description":"Max GMV (USD)","in":"query","name":"max_gmv","required":false,"schema":{"type":"number"}},{"description":"Max sales","in":"query","name":"max_sold","required":false,"schema":{"type":"number"}},{"description":"Min audience","in":"query","name":"min_audience","required":false,"schema":{"type":"number"}},{"description":"Min GMV (USD)","in":"query","name":"min_gmv","required":false,"schema":{"type":"number"}},{"description":"Min sales","in":"query","name":"min_sold","required":false,"schema":{"type":"number"}},{"description":"Page number, default 1","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},{"description":"Page size, default 20, max 20","in":"query","name":"page_size","required":false,"schema":{"default":20,"maximum":20,"type":"integer"}},{"description":"Product category ID","in":"query","name":"product_category","required":false,"schema":{"type":"string"}},{"description":"Sort field, format: field:asc|desc. Allowed fields: audience, gmv, peak_audience, sold, start_time. Default: gmv:desc","in":"query","name":"sort","required":false,"schema":{"default":"gmv:desc","enum":["audience","gmv","peak_audience","sold","start_time"],"type":"string"}},{"description":"Routing parameter: routes to different backends by country value","in":"query","name":"country","required":true,"schema":{"enum":["br","de","es","fr","gb","id","it","jp","mx","my","ph","sg","th","us","vn"],"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"items":{"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Live Search","tags":["Data/Lives"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.lives.read"}},"/open/v1/lives/{id}":{"get":{"description":"Get TikTok live stream details, including basics, core metrics, trends, linked products, and similar lives.","operationId":"trenz-lives-detail","parameters":[{"description":"Routing parameter: routes to different backends by country value","in":"query","name":"country","required":true,"schema":{"enum":["br","de","es","fr","gb","id","it","jp","mx","my","ph","sg","th","us","vn"],"type":"string"}},{"description":"Include related resources, comma-separated (values: core(Core metrics), products(Linked products), similar(Similar lives), trend(Trend data))","in":"query","name":"include","required":false,"schema":{"type":"string"}},{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"items":{"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Live Detail","tags":["Data/Lives"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.lives.read"}},"/open/v1/products/search":{"get":{"description":"Search TikTok products with multi-dimensional filters on keyword, category, price, sales, etc.","operationId":"trenz-products-search","parameters":[{"description":"Product category ID (numeric), can be obtained from the `l1_category` field in search results","in":"query","name":"category","required":false,"schema":{"type":"string"}},{"description":"Whether has free shipping","in":"query","name":"free_shipping","required":false,"schema":{"type":"boolean"}},{"description":"Search keyword","in":"query","name":"keyword","required":false,"schema":{"type":"string"}},{"description":"Max price (USD)","in":"query","name":"max_price","required":false,"schema":{"type":"number"}},{"description":"Max rating (0-5)","in":"query","name":"max_rating","required":false,"schema":{"type":"number"}},{"description":"30-day max sales","in":"query","name":"max_sold_30d","required":false,"schema":{"type":"number"}},{"description":"7-day max sales","in":"query","name":"max_sold_7d","required":false,"schema":{"type":"number"}},{"description":"Min price (USD)","in":"query","name":"min_price","required":false,"schema":{"type":"number"}},{"description":"Min rating (0-5)","in":"query","name":"min_rating","required":false,"schema":{"type":"number"}},{"description":"30-day min sales","in":"query","name":"min_sold_30d","required":false,"schema":{"type":"number"}},{"description":"7-day min sales","in":"query","name":"min_sold_7d","required":false,"schema":{"type":"number"}},{"description":"Page number, default 1","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},{"description":"Page size, default 20, max 20","in":"query","name":"page_size","required":false,"schema":{"default":20,"maximum":20,"type":"integer"}},{"description":"Seller type: 1=Overseas Non-brand, 2=Local, 3=Brand, 4=Non-brand","in":"query","name":"seller_type","required":false,"schema":{"type":"string"}},{"description":"Sort field, format: field:asc|desc. Allowed fields: daily_sold, gmv_30d, gmv_7d, price, rating, sold_30d, sold_7d. Default: gmv_7d:desc","in":"query","name":"sort","required":false,"schema":{"default":"gmv_7d:desc","enum":["daily_sold","gmv_30d","gmv_7d","price","rating","sold_30d","sold_7d"],"type":"string"}},{"description":"Routing parameter: routes to different backends by country value","in":"query","name":"country","required":true,"schema":{"enum":["br","de","es","fr","gb","id","it","jp","mx","my","ph","sg","th","us","vn"],"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"items":{"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Product Search","tags":["Data/Products"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.products.read"}},"/open/v1/products/{id}":{"get":{"description":"Get TikTok product details with linked videos, creators, and reviews.","operationId":"trenz-products-detail","parameters":[{"description":"Routing parameter: routes to different backends by country value","in":"query","name":"country","required":true,"schema":{"enum":["br","de","es","fr","gb","id","it","jp","mx","my","ph","sg","th","us","vn"],"type":"string"}},{"description":"Include related resources, comma-separated (values: creators(Linked creators), reviews(Product reviews), videos(Linked videos))","in":"query","name":"include","required":false,"schema":{"type":"string"}},{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"items":{"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Product Detail","tags":["Data/Products"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.products.read"}},"/open/v1/sellers/search":{"get":{"description":"Search TikTok sellers with multi-dimensional filters on category, rating, sales, etc.","operationId":"trenz-sellers-search","parameters":[{"description":"Seller primary category ID","in":"query","name":"category","required":false,"schema":{"type":"string"}},{"description":"Search keyword","in":"query","name":"keyword","required":false,"schema":{"type":"string"}},{"description":"7-day max sales amount (USD)","in":"query","name":"max_gmv_7d","required":false,"schema":{"type":"number"}},{"description":"Max seller rating","in":"query","name":"max_rating","required":false,"schema":{"type":"number"}},{"description":"7-day max sales","in":"query","name":"max_sold_7d","required":false,"schema":{"type":"number"}},{"description":"7-day min sales amount (USD)","in":"query","name":"min_gmv_7d","required":false,"schema":{"type":"number"}},{"description":"Min seller rating","in":"query","name":"min_rating","required":false,"schema":{"type":"number"}},{"description":"7-day min sales","in":"query","name":"min_sold_7d","required":false,"schema":{"type":"number"}},{"description":"Page number, default 1","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},{"description":"Page size, default 20, max 20","in":"query","name":"page_size","required":false,"schema":{"default":20,"maximum":20,"type":"integer"}},{"description":"Seller type: 1=Overseas Non-brand, 2=Local, 3=Brand, 4=Non-brand","in":"query","name":"seller_type","required":false,"schema":{"type":"string"}},{"description":"Sort field, format: field:asc|desc. Allowed fields: gmv_7d, product_count, rating, sold_7d, total_gmv, total_sold. Default: gmv_7d:desc","in":"query","name":"sort","required":false,"schema":{"default":"gmv_7d:desc","enum":["gmv_7d","product_count","rating","sold_7d","total_gmv","total_sold"],"type":"string"}},{"description":"Routing parameter: routes to different backends by country value","in":"query","name":"country","required":true,"schema":{"enum":["br","de","es","fr","gb","id","it","jp","mx","my","ph","sg","th","us","vn"],"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"items":{"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Seller Search","tags":["Data/Sellers"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.sellers.read"}},"/open/v1/sellers/{id}":{"get":{"description":"Get TikTok seller details with product list and linked creators.","operationId":"trenz-sellers-detail","parameters":[{"description":"Routing parameter: routes to different backends by country value","in":"query","name":"country","required":true,"schema":{"enum":["br","de","es","fr","gb","id","it","jp","mx","my","ph","sg","th","us","vn"],"type":"string"}},{"description":"Include related resources, comma-separated (values: creators(Linked creators), products(Linked products))","in":"query","name":"include","required":false,"schema":{"type":"string"}},{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"items":{"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Seller Detail","tags":["Data/Sellers"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.sellers.read"}},"/open/v1/social/accounts/list":{"post":{"description":"List social accounts (including followers, engagement metrics, etc.).","operationId":"trenz-social-accounts-list","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"group_id":{"description":"Group filter: numeric ID = specific group, \"ungrouped\" = ungrouped, empty = all","type":"string"},"keyword":{"type":"string"},"page":{"default":1,"type":"integer"},"page_size":{"default":20,"type":"integer"},"platform":{"type":"string"},"sort_by":{"default":"display_time","type":"string"},"sort_order":{"default":"desc","type":"string"},"status":{"type":"string"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"accounts":{"items":{"properties":{"account_type":{"description":"Account type: business/creator","type":"string"},"avatar_url":{"description":"Avatar URL","type":"string"},"created_at":{"description":"Bound at (Unix timestamp)","type":"integer"},"display_name":{"description":"Display name","type":"string"},"engagement_rate":{"description":"Engagement rate (%)","type":"number"},"followers":{"description":"Followers","type":"integer"},"gmv":{"description":"GMV (tiktok-shop-pc only)","type":"number"},"gmv_currency":{"description":"GMV currency","type":"string"},"id":{"description":"Account ID","type":"integer"},"last_posted_at":{"description":"Last published at (Unix timestamp)","type":"integer"},"orders":{"description":"Orders","type":"integer"},"platform":{"description":"Platform: tiktok/tiktok-shop-pc/instagram/youtube/facebook","type":"string"},"post_activity":{"description":"Last 14-day publishing activity (index 0 = 14 days ago, 13 = today)","items":{"type":"integer"},"type":"array"},"refresh_token_expires_at":{"description":"OAuth token expires at (Unix timestamp)","type":"integer"},"region":{"description":"Region (tiktok-shop-pc)","type":"string"},"remark":{"description":"User remark","type":"string"},"scheduled_posts":{"description":"Pending-publish video count","type":"integer"},"status":{"description":"Status: active/expired/revoked","type":"string"},"total_comments":{"description":"Total comments","type":"integer"},"total_likes":{"description":"Total likes","type":"integer"},"total_posts":{"description":"Published video count","type":"integer"},"total_shares":{"description":"Total shares","type":"integer"},"total_views":{"description":"Total views","type":"integer"},"username":{"description":"Username","type":"string"}},"type":"object"},"type":"array"},"total":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Social Account List","tags":["Social/1.Account Management"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/analytics/overview":{"post":{"description":"Get a social account analytics overview, including views, engagement, and commerce aggregates.","operationId":"trenz-social-analytics-overview","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_types":{"description":"Account type filter","items":{"type":"string"},"type":"array"},"end_date":{"description":"End date YYYY-MM-DD","type":"string"},"platform_account_ids":{"description":"Account filter","items":{"type":"integer"},"type":"array"},"platforms":{"description":"Platform filter","items":{"type":"string"},"type":"array"},"start_date":{"description":"Start date YYYY-MM-DD","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"end_date":{"type":"string"},"start_date":{"type":"string"},"summary":{"properties":{"avg_anchor_display_rate":{"description":"Average anchor display rate","type":"number"},"avg_click_through_rate":{"description":"Average CTR","type":"number"},"comments_growth":{"description":"Comments growth","type":"integer"},"engagement_rate":{"type":"number"},"engagement_rate_change":{"description":"Engagement rate change","type":"number"},"engagements_growth":{"description":"Engagement growth","type":"integer"},"gmv_currency":{"description":"GMV currency","type":"string"},"likes_growth":{"type":"integer"},"platform_breakdown":{"description":"Per-platform breakdown","items":{"properties":{"comments":{"type":"integer"},"gmv":{"type":"number"},"likes":{"type":"integer"},"orders":{"type":"integer"},"platform":{"type":"string"},"shares":{"type":"integer"},"videos":{"type":"integer"},"views":{"type":"integer"}},"type":"object"},"type":"array"},"shares_growth":{"description":"Shares growth","type":"integer"},"total_accounts":{"type":"integer"},"total_comments":{"type":"integer"},"total_engagements":{"description":"Total engagement","type":"integer"},"total_gmv":{"type":"number"},"total_items_sold":{"description":"Units sold","type":"integer"},"total_likes":{"type":"integer"},"total_orders":{"type":"integer"},"total_posts":{"description":"Total post count","type":"integer"},"total_shares":{"type":"integer"},"total_videos":{"type":"integer"},"total_views":{"type":"integer"},"views_growth":{"type":"integer"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Analytics Overview","tags":["Social/5.Analytics"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/analytics/shop-videos":{"post":{"description":"List TikTok Shop shoppable videos with their commerce metrics.","operationId":"trenz-social-analytics-shop-videos","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_types":{"description":"Account type list","items":{"type":"string"},"type":"array"},"date_range":{"description":"Date range","enum":["7d","14d","30d"],"type":"string"},"limit":{"description":"Page size","type":"integer"},"offset":{"description":"Offset","type":"integer"},"platform_account_ids":{"description":"Platform account ID list","items":{"type":"integer"},"type":"array"},"sort_by":{"description":"Sort: gmv/orders/items_sold/published_at","type":"string"},"sort_order":{"description":"Sort direction: desc/asc","type":"string"}},"required":["date_range"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":2,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"total_count":{"type":"integer"},"videos":{"items":{"properties":{"cover_url":{"type":"string"},"gmv":{"type":"number"},"gmv_currency":{"type":"string"},"items_sold":{"type":"integer"},"orders":{"type":"integer"},"platform_account_id":{"type":"integer"},"platform_url":{"type":"string"},"platform_video_id":{"type":"string"},"published_at":{"type":"integer"},"video_title":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Shoppable Video List","tags":["Social/5.Analytics"],"x-billing-mode":"per_call","x-coin-cost":2,"x-scope":"trenz.social.read"}},"/open/v1/social/analytics/shop-videos/detail":{"post":{"description":"Get daily commerce metrics and linked products for a shoppable video.","operationId":"trenz-social-analytics-shop-video-detail","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"platform_account_id":{"description":"Shop account ID","type":"integer"},"platform_video_id":{"description":"Platform video ID","type":"string"}},"required":["platform_video_id","platform_account_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"daily_metrics":{"items":{"properties":{"anchor_display_rate":{"description":"Anchor display rate","type":"number"},"click_through_rate":{"description":"Click-through rate","type":"number"},"gmv":{"type":"number"},"gmv_currency":{"type":"string"},"items_sold":{"type":"integer"},"metric_date":{"type":"string"},"orders":{"type":"integer"}},"type":"object"},"type":"array"},"products":{"items":{"properties":{"product_id":{"type":"string"},"product_title":{"type":"string"}},"type":"object"},"type":"array"},"video":{"properties":{"cover_url":{"type":"string"},"platform_video_id":{"type":"string"},"video_title":{"type":"string"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Shoppable Video Detail","tags":["Social/5.Analytics"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/analytics/top-accounts":{"post":{"description":"Rank top accounts by metric.","operationId":"trenz-social-analytics-top-accounts","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_types":{"description":"Account type list","items":{"type":"string"},"type":"array"},"end_date":{"description":"End date YYYY-MM-DD","type":"string"},"limit":{"description":"Result size, default 10","type":"integer"},"metric":{"description":"Sort metric: views/likes/comments/shares/gmv","type":"string"},"platforms":{"description":"Platform list, e.g. [\"tiktok\"]","items":{"type":"string"},"type":"array"},"start_date":{"description":"Start date YYYY-MM-DD","type":"string"}},"required":["metric"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"accounts":{"items":{"properties":{"avatar_url":{"type":"string"},"display_name":{"type":"string"},"metric_growth":{"type":"integer"},"metric_value":{"type":"integer"},"platform":{"type":"string"},"platform_account_id":{"type":"integer"},"video_count":{"type":"integer"}},"type":"object"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Top Accounts Ranking","tags":["Social/5.Analytics"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/analytics/top-products":{"post":{"description":"Rank top products by sales metric.","operationId":"trenz-social-analytics-top-products","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_types":{"description":"Account type list","items":{"type":"string"},"type":"array"},"end_date":{"description":"End date YYYY-MM-DD","type":"string"},"limit":{"description":"Result size, default 10","type":"integer"},"metric":{"description":"Sort metric: gmv/orders/video_count","type":"string"},"platform_account_ids":{"description":"Account ID list","items":{"type":"integer"},"type":"array"},"start_date":{"description":"Start date YYYY-MM-DD","type":"string"}},"required":["metric"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"products":{"items":{"properties":{"image_url":{"type":"string"},"platform_product_id":{"type":"string"},"price_amount":{"type":"number"},"price_currency":{"type":"string"},"product_id":{"type":"integer"},"title":{"type":"string"},"total_gmv":{"type":"number"},"total_items_sold":{"type":"integer"},"total_orders":{"type":"integer"},"video_count":{"type":"integer"}},"type":"object"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Top Products Ranking","tags":["Social/5.Analytics"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/analytics/top-videos":{"post":{"description":"Rank top videos by metric.","operationId":"trenz-social-analytics-top-videos","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_types":{"description":"Account type list","items":{"type":"string"},"type":"array"},"end_date":{"description":"End date YYYY-MM-DD","type":"string"},"limit":{"description":"Result size, default 10","type":"integer"},"metric":{"description":"Sort metric: views/likes/comments/shares","type":"string"},"platform_account_ids":{"description":"Account ID list","items":{"type":"integer"},"type":"array"},"platforms":{"description":"Platform list","items":{"type":"string"},"type":"array"},"start_date":{"description":"Start date YYYY-MM-DD","type":"string"}},"required":["metric"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"videos":{"items":{"properties":{"account_avatar_url":{"description":"Account avatar URL","type":"string"},"account_display_name":{"description":"Account display name","type":"string"},"anchor_display_rate":{"description":"Anchor display rate","type":"number"},"click_through_rate":{"description":"Click-through rate","type":"number"},"comment_count":{"type":"integer"},"cover_url":{"type":"string"},"gmv_amount":{"description":"GMV amount","type":"number"},"gmv_currency":{"description":"GMV currency","type":"string"},"item_sold_count":{"description":"Units sold","type":"integer"},"like_count":{"type":"integer"},"metric_growth":{"description":"Metric growth","type":"integer"},"order_count":{"description":"Orders","type":"integer"},"platform":{"type":"string"},"platform_account_id":{"type":"integer"},"platform_url":{"type":"string"},"platform_video_id":{"type":"string"},"product_id":{"description":"Linked product ID","type":"string"},"product_image_url":{"description":"Linked product image URL","type":"string"},"product_title":{"description":"Linked product name","type":"string"},"published_at":{"type":"integer"},"region":{"description":"Region","type":"string"},"share_count":{"type":"integer"},"video_title":{"type":"string"},"view_count":{"type":"integer"}},"type":"object"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Top Videos Ranking","tags":["Social/5.Analytics"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/analytics/trend":{"post":{"description":"Get time-series trend data for a specified metric.","operationId":"trenz-social-analytics-trend","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_types":{"description":"Account type list","items":{"type":"string"},"type":"array"},"end_date":{"description":"End date YYYY-MM-DD","type":"string"},"granularity":{"description":"Time granularity: day/week","type":"string"},"metric":{"description":"Metric: views/likes/comments/shares/followers","type":"string"},"platform_account_ids":{"description":"Account ID list","items":{"type":"integer"},"type":"array"},"platforms":{"description":"Platform list","items":{"type":"string"},"type":"array"},"start_date":{"description":"Start date YYYY-MM-DD","type":"string"},"value_mode":{"description":"Numeric mode","type":"string"}},"required":["metric"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"growth_rate":{"type":"number"},"total_growth":{"type":"number"},"trend_data":{"items":{"properties":{"date":{"type":"string"},"growth":{"type":"number"},"value":{"type":"number"}},"type":"object"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Analytics Trend","tags":["Social/5.Analytics"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/comments/create":{"post":{"description":"Post a new comment under a video as the bound account.","operationId":"trenz-social-comments-create","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"platform_account_id":{"description":"Platform account ID","type":"integer"},"platform_video_id":{"description":"Platform video ID","type":"string"},"text":{"description":"Comment content","type":"string"}},"required":["platform_account_id","platform_video_id","text"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":2,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"comment":{"properties":{"author":{"properties":{"display_name":{"type":"string"},"username":{"type":"string"}},"type":"object"},"like_count":{"description":"Likes","type":"integer"},"platform":{"description":"Platform","type":"string"},"platform_comment_id":{"type":"string"},"platform_video_id":{"description":"Platform video ID","type":"string"},"published_at":{"type":"integer"},"reply_count":{"description":"Reply count","type":"integer"},"text":{"type":"string"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Create Comment","tags":["Social/4.Comment Management"],"x-billing-mode":"per_call","x-coin-cost":2,"x-scope":"trenz.social.write"}},"/open/v1/social/comments/delete":{"post":{"description":"Delete a comment on the platform and update local state.","operationId":"trenz-social-comments-delete","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"platform_account_id":{"description":"Platform account ID","type":"integer"},"platform_comment_id":{"description":"Comment ID","type":"string"},"platform_video_id":{"description":"Platform video ID","type":"string"}},"required":["platform_account_id","platform_video_id","platform_comment_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":2,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"comment":{"properties":{"is_deleted":{"type":"boolean"},"platform":{"description":"Platform","type":"string"},"platform_comment_id":{"type":"string"},"text":{"description":"Comment content","type":"string"}},"type":"object"},"success":{"type":"boolean"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Delete Comment","tags":["Social/4.Comment Management"],"x-billing-mode":"per_call","x-coin-cost":2,"x-scope":"trenz.social.write"}},"/open/v1/social/comments/like":{"post":{"description":"Like or unlike a comment on the platform.","operationId":"trenz-social-comments-like","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"Action: like/unlike","type":"string"},"platform_account_id":{"description":"Platform account ID","type":"integer"},"platform_comment_id":{"description":"Comment ID","type":"string"},"platform_video_id":{"description":"Platform video ID","type":"string"}},"required":["platform_account_id","platform_video_id","platform_comment_id","action"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":2,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"comment":{"properties":{"is_liked":{"type":"boolean"},"like_count":{"type":"integer"},"platform":{"description":"Platform","type":"string"},"platform_comment_id":{"type":"string"},"text":{"description":"Comment content","type":"string"}},"type":"object"},"success":{"type":"boolean"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Like Comment","tags":["Social/4.Comment Management"],"x-billing-mode":"per_call","x-coin-cost":2,"x-scope":"trenz.social.write"}},"/open/v1/social/comments/managed":{"post":{"description":"Query synced comments from the local database with multi-dimensional filters.","operationId":"trenz-social-comments-managed-list","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"ai_intent":{"description":"AI intent filter: purchase/support/feedback/general","type":"string"},"ai_priority":{"description":"AI priority filter: high/medium/low","type":"string"},"engaged":{"description":"Whether interacted","type":"boolean"},"include_replies":{"description":"Whether to include replies","type":"boolean"},"is_deleted":{"description":"Whether deleted","type":"boolean"},"is_hidden":{"description":"Whether hidden","type":"boolean"},"is_read":{"description":"Whether read","type":"boolean"},"keyword":{"description":"Search keyword","type":"string"},"limit":{"default":20,"description":"Page size","type":"integer"},"max_replies":{"description":"Max replies returned per comment","type":"integer"},"page":{"default":1,"description":"Page number","type":"integer"},"platform_account_ids":{"description":"Account ID list","items":{"type":"integer"},"type":"array"},"platform_video_id":{"description":"Video ID (filter comments for a specific video)","type":"string"},"platforms":{"description":"Platform list","items":{"type":"string"},"type":"array"},"published_after":{"description":"Publish time start (Unix timestamp)","type":"integer"},"published_before":{"description":"Publish time end (Unix timestamp)","type":"integer"},"sort_by":{"description":"Sort field","type":"string"},"sort_order":{"description":"Sort direction asc/desc","type":"string"},"view_mode":{"description":"View mode","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"comments":{"items":{"properties":{"ai_intent":{"description":"AI intent classification","type":"string"},"ai_priority":{"description":"AI priority classification","type":"string"},"author":{"properties":{"avatar_url":{"type":"string"},"display_name":{"type":"string"},"username":{"type":"string"}},"type":"object"},"id":{"type":"integer"},"is_deleted":{"description":"Whether deleted","type":"boolean"},"is_liked":{"description":"Whether liked","type":"boolean"},"is_owner_replied":{"description":"Whether replied","type":"boolean"},"is_read":{"type":"boolean"},"is_self_comment":{"description":"Whether it is the user's own comment","type":"boolean"},"like_count":{"type":"integer"},"platform":{"description":"Platform","type":"string"},"platform_comment_id":{"type":"string"},"platform_video_id":{"type":"string"},"published_at":{"type":"integer"},"reply_count":{"type":"integer"},"text":{"type":"string"}},"type":"object"},"type":"array"},"limit":{"type":"integer"},"page":{"type":"integer"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Managed Comment List","tags":["Social/4.Comment Management"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/comments/managed/replies":{"post":{"description":"List synced replies for a comment.","operationId":"trenz-social-comments-managed-replies","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"is_deleted":{"description":"Whether deleted","type":"boolean"},"is_hidden":{"description":"Whether hidden","type":"boolean"},"limit":{"description":"Page size","type":"integer"},"page":{"description":"Page number","type":"integer"},"platform_account_id":{"description":"Platform account ID","type":"integer"},"platform_comment_id":{"description":"Parent comment ID","type":"string"}},"required":["platform_account_id","platform_comment_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"limit":{"type":"integer"},"page":{"type":"integer"},"replies":{"items":{"properties":{"author":{"properties":{"avatar_url":{"type":"string"},"display_name":{"type":"string"},"username":{"type":"string"}},"type":"object"},"id":{"type":"integer"},"is_deleted":{"description":"Whether deleted","type":"boolean"},"is_liked":{"description":"Whether liked","type":"boolean"},"like_count":{"type":"integer"},"platform":{"description":"Platform","type":"string"},"platform_comment_id":{"type":"string"},"published_at":{"type":"integer"},"text":{"type":"string"}},"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Managed Reply List","tags":["Social/4.Comment Management"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/comments/query":{"post":{"description":"Query a video's comments in real time.","operationId":"trenz-social-comments-query","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"cursor":{"description":"Pagination cursor","type":"string"},"limit":{"description":"Page size, max 50","type":"integer"},"platform_account_id":{"description":"Platform account ID","type":"integer"},"platform_video_id":{"description":"Platform video ID","type":"string"},"sort_by":{"description":"Sort: published_at/like_count","type":"string"},"sort_order":{"description":"Sort direction: asc/desc","type":"string"}},"required":["platform_account_id","platform_video_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"comments":{"items":{"properties":{"ai_intent":{"description":"AI intent classification","type":"string"},"ai_priority":{"description":"AI priority classification","type":"string"},"author":{"properties":{"avatar_url":{"type":"string"},"display_name":{"type":"string"},"username":{"type":"string"}},"type":"object"},"is_deleted":{"description":"Whether deleted","type":"boolean"},"is_hidden":{"type":"boolean"},"is_liked":{"description":"Whether liked","type":"boolean"},"is_owner_replied":{"description":"Whether replied","type":"boolean"},"is_read":{"description":"Whether read","type":"boolean"},"is_self_comment":{"description":"Whether it is the user's own comment","type":"boolean"},"like_count":{"type":"integer"},"platform":{"description":"Platform","type":"string"},"platform_comment_id":{"type":"string"},"published_at":{"type":"integer"},"reply_count":{"type":"integer"},"text":{"type":"string"}},"type":"object"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"type":"string"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Real-time Comment Query","tags":["Social/4.Comment Management"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/comments/replies":{"post":{"description":"List replies under a specific comment.","operationId":"trenz-social-comments-replies","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"cursor":{"description":"Pagination cursor","type":"string"},"limit":{"description":"Page size","type":"integer"},"page":{"description":"Page number","type":"integer"},"platform":{"description":"Platform: tiktok/youtube/instagram","type":"string"},"platform_account_id":{"description":"Platform account ID","type":"integer"},"platform_comment_id":{"description":"Parent comment ID","type":"string"}},"required":["platform_account_id","platform_comment_id","platform"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"has_more":{"type":"boolean"},"limit":{"type":"integer"},"next_cursor":{"type":"string"},"page":{"type":"integer"},"replies":{"items":{"properties":{"author":{"properties":{"avatar_url":{"type":"string"},"display_name":{"type":"string"},"username":{"type":"string"}},"type":"object"},"is_deleted":{"description":"Whether deleted","type":"boolean"},"is_liked":{"description":"Whether liked","type":"boolean"},"is_self_comment":{"description":"Whether it is the user's own comment","type":"boolean"},"like_count":{"type":"integer"},"platform":{"description":"Platform","type":"string"},"platform_comment_id":{"type":"string"},"published_at":{"type":"integer"},"text":{"type":"string"}},"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Comment Replies","tags":["Social/4.Comment Management"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/comments/reply":{"post":{"description":"Reply to a comment as the bound account.","operationId":"trenz-social-comments-reply","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"platform_account_id":{"description":"Platform account ID","type":"integer"},"platform_comment_id":{"description":"Comment ID","type":"string"},"platform_video_id":{"description":"Platform video ID","type":"string"},"text":{"description":"Reply content","type":"string"}},"required":["platform_account_id","platform_video_id","platform_comment_id","text"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":2,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"reply":{"properties":{"author":{"properties":{"display_name":{"type":"string"},"username":{"type":"string"}},"type":"object"},"like_count":{"description":"Likes","type":"integer"},"platform":{"description":"Platform","type":"string"},"platform_comment_id":{"type":"string"},"published_at":{"type":"integer"},"text":{"type":"string"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Reply to Comment","tags":["Social/4.Comment Management"],"x-billing-mode":"per_call","x-coin-cost":2,"x-scope":"trenz.social.write"}},"/open/v1/social/comments/sync":{"post":{"description":"Sync comments from the platform into the local database.","operationId":"trenz-social-comments-sync","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"platform_account_id":{"description":"Platform account ID","type":"integer"},"platform_video_id":{"description":"Optional: sync a specific video only","type":"string"}},"required":["platform_account_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":2,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"comments_synced":{"type":"integer"},"errors":{"type":"integer"},"replies_synced":{"type":"integer"},"videos_processed":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Sync Comments","tags":["Social/4.Comment Management"],"x-billing-mode":"per_call","x-coin-cost":2,"x-scope":"trenz.social.write"}},"/open/v1/social/hashtag/suggestions":{"post":{"description":"Get popular TikTok hashtag suggestions for a given keyword.","operationId":"trenz-social-hashtag-suggestions","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"keyword":{"description":"Search keyword (word)","type":"string"},"language":{"description":"Language code, default en","type":"string"}},"required":["keyword"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"from_cache":{"type":"boolean"},"suggestions":{"items":{"properties":{"name":{"description":"Hashtag name","type":"string"},"view_count":{"description":"Views","type":"integer"}},"type":"object"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Hashtag Suggestions","tags":["Social/6.Creation Tools"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/music/recently-used":{"post":{"description":"List recently used music tracks.","operationId":"trenz-social-music-recently-used","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"keyword":{"description":"Search keyword","type":"string"},"limit":{"description":"Page size","type":"integer"},"page":{"description":"Page number","type":"integer"},"platform_account_id":{"description":"Filter account","type":"integer"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"limit":{"type":"integer"},"music_list":{"items":{"properties":{"artist":{"type":"string"},"commercial_music_id":{"description":"Commercial music ID","type":"string"},"commercial_music_name":{"type":"string"},"duration":{"type":"integer"},"genres":{"items":{"type":"string"},"type":"array"},"id":{"type":"integer"},"platform_account_id":{"description":"Account ID that uses this music","type":"integer"},"preview_url":{"type":"string"},"song_clip_id":{"type":"string"},"thumbnail_url":{"type":"string"},"used_at":{"type":"integer"}},"type":"object"},"type":"array"},"page":{"type":"integer"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Recently Used Music","tags":["Social/6.Creation Tools"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/music/search":{"post":{"description":"Search popular TikTok music with filters on keyword and type.","operationId":"trenz-social-music-search","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"country_code":{"description":"Country code, default US","type":"string"},"date_range":{"description":"Time range: 1DAY/7DAY/30DAY","type":"string"},"genre":{"description":"Music type","type":"string"},"keyword":{"description":"Search keyword","type":"string"},"limit":{"description":"Page size, max 100","type":"integer"},"page":{"description":"Page number","type":"integer"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"limit":{"type":"integer"},"music_list":{"items":{"properties":{"artist":{"type":"string"},"commercial_music_id":{"description":"Commercial music ID","type":"string"},"commercial_music_name":{"type":"string"},"country_code":{"description":"Country code","type":"string"},"duration":{"type":"integer"},"genres":{"items":{"type":"string"},"type":"array"},"id":{"type":"integer"},"preview_url":{"type":"string"},"rank_position":{"type":"integer"},"song_clip_id":{"type":"string"},"thumbnail_url":{"type":"string"}},"type":"object"},"type":"array"},"page":{"type":"integer"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Popular Music Search","tags":["Social/6.Creation Tools"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/plans/precheck":{"post":{"description":"Trigger a TikTok Shop quality precheck for a publish plan.","operationId":"trenz-social-plans-precheck","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"publication_id":{"description":"Plan ID","type":"integer"}},"required":["publication_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":2,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"record":{"properties":{"created_at":{"type":"integer"},"id":{"type":"integer"},"publication_id":{"type":"integer"},"status":{"type":"string"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Trigger Quality Precheck","tags":["Social/2.Video Publishing"],"x-billing-mode":"per_call","x-coin-cost":2,"x-scope":"trenz.social.write"}},"/open/v1/social/plans/precheck-records":{"post":{"description":"Get the quality-precheck history for a publish plan.","operationId":"trenz-social-plans-precheck-records","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"publication_id":{"description":"Publish plan ID","type":"integer"}},"required":["publication_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"records":{"items":{"properties":{"created_at":{"type":"integer"},"error_message":{"type":"string"},"id":{"type":"integer"},"publication_id":{"type":"integer"},"result":{"description":"JSON: {issues, quality_score}","type":"string"},"status":{"description":"pending/processing/passed/failed/error/timeout","type":"string"},"updated_at":{"type":"integer"}},"type":"object"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Precheck Record List","tags":["Social/2.Video Publishing"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/platform-accounts/detail":{"post":{"description":"Get details for a single social platform account.","operationId":"trenz-social-platform-account-detail","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_id":{"description":"Platform account ID","type":"integer"}},"required":["account_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"account":{"properties":{"account_type":{"type":"string"},"avatar_url":{"type":"string"},"created_at":{"type":"integer"},"display_name":{"type":"string"},"id":{"type":"integer"},"platform":{"type":"string"},"platform_account_id":{"type":"string"},"region":{"description":"Account region","type":"string"},"remark":{"type":"string"},"scopes":{"items":{"type":"string"},"type":"array"},"status":{"type":"string"},"updated_at":{"type":"integer"},"username":{"type":"string"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Social Account Detail","tags":["Social/1.Account Management"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/platform-accounts/disconnect":{"post":{"description":"Disconnect a social platform account.","operationId":"trenz-social-platform-account-disconnect","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_id":{"description":"ID of the account to disconnect","format":"int32","type":"integer"}},"required":["account_id"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Disconnect Social Account","tags":["Social/1.Account Management"],"x-billing-mode":"per_call","x-coin-cost":2,"x-scope":"trenz.social.write"}},"/open/v1/social/platform-accounts/refresh-token":{"post":{"description":"Manually refresh the OAuth token of a social account.","operationId":"trenz-social-platform-token-refresh","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_id":{"description":"ID of the social account to refresh","format":"int32","type":"integer"}},"required":["account_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"account":{"description":"Refreshed social account info","properties":{"account_type":{"description":"Account type: business or creator","type":"string"},"avatar_url":{"description":"Avatar URL","type":"string"},"created_at":{"description":"Bound at (Unix timestamp)","format":"int64","type":"integer"},"display_name":{"description":"Display name","type":"string"},"group_id":{"description":"Account group ID","type":"integer"},"group_name":{"description":"Account group name","type":"string"},"id":{"description":"Account ID","format":"int32","type":"integer"},"is_tiktok_correlated":{"description":"Whether a TikTok account with the same name is linked (tiktok-shop-pc only)","type":"boolean"},"platform":{"description":"Social platform","type":"string"},"platform_account_id":{"description":"Platform-side account ID","type":"string"},"region":{"description":"TikTok Shop region","type":"string"},"remark":{"description":"User remark","type":"string"},"scopes":{"description":"OAuth scope list","items":{"type":"string"},"type":"array"},"status":{"description":"Account status: active / expired / revoked","type":"string"},"updated_at":{"description":"Updated at (Unix timestamp)","format":"int64","type":"integer"},"username":{"description":"Username","type":"string"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Refresh Social Token","tags":["Social/1.Account Management"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.write"}},"/open/v1/social/platform-accounts/update-remark":{"post":{"description":"Update the user-defined remark on a social platform account.","operationId":"trenz-social-platform-account-update-remark","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_id":{"description":"Platform account ID","type":"integer"},"remark":{"description":"Remark content, max 500 characters","type":"string"}},"required":["account_id","remark"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":2,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"account":{"properties":{"display_name":{"type":"string"},"id":{"type":"integer"},"remark":{"type":"string"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Update Account Remark","tags":["Social/1.Account Management"],"x-billing-mode":"per_call","x-coin-cost":2,"x-scope":"trenz.social.write"}},"/open/v1/social/publish/cancel":{"post":{"description":"Cancel a specific publish task.","operationId":"trenz-social-publish-cancel","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"publication_id":{"description":"Publish task ID","type":"integer"}},"required":["publication_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":2,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Cancel Individual Publish","tags":["Social/2.Video Publishing"],"x-billing-mode":"per_call","x-coin-cost":2,"x-scope":"trenz.social.write"}},"/open/v1/social/publish/session":{"post":{"description":"Query the progress of a video publish session.","operationId":"trenz-social-publish-session","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"session_token":{"description":"Publish session token","type":"string"}},"required":["session_token"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"publications":{"items":{"properties":{"id":{"type":"integer"},"platform_url":{"type":"string"},"platform_video_id":{"type":"string"},"progress_percentage":{"type":"integer"},"stage":{"type":"string"},"status":{"type":"string"}},"type":"object"},"type":"array"},"session":{"properties":{"completed_at":{"description":"Completed at (Unix timestamp)","type":"integer"},"completed_publications":{"type":"integer"},"failed_publications":{"type":"integer"},"id":{"type":"integer"},"session_token":{"type":"string"},"started_at":{"type":"integer"},"status":{"type":"string"},"total_publications":{"type":"integer"},"video_id":{"type":"integer"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Publish Session Status","tags":["Social/2.Video Publishing"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/publish/session/cancel":{"post":{"description":"Cancel an entire video publish session.","operationId":"trenz-social-publish-session-cancel","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"session_token":{"description":"Publish session token","type":"string"}},"required":["session_token"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":2,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Cancel Publish Session","tags":["Social/2.Video Publishing"],"x-billing-mode":"per_call","x-coin-cost":2,"x-scope":"trenz.social.write"}},"/open/v1/social/publish/upload-and-publish":{"post":{"description":"One-step upload-and-publish a video to multiple social platforms.","operationId":"trenz-social-publish-upload","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"bucket_key":{"description":"Object key (the `object_key` returned by 'Generate Presigned Upload URL' under the 'General' category)","type":"string"},"bucket_name":{"description":"Bucket name (the `s3_bucket` returned by 'Generate Presigned Upload URL' under the 'General' category)","type":"string"},"content_type":{"default":"video","description":"Content type: video or image","type":"string"},"cover_bucket_key":{"description":"Cover image object key (the `object_key` returned by 'Generate Presigned Upload URL' under the 'General' category, optional)","type":"string"},"cover_bucket_name":{"description":"Cover image bucket name (the `s3_bucket` returned by 'Generate Presigned Upload URL' under the 'General' category, optional)","type":"string"},"dry_run":{"default":false,"description":"Dry-run publish (does not actually publish to the platform)","type":"boolean"},"duration":{"description":"Video duration (seconds, optional)","type":"number"},"file_size":{"description":"File size (bytes, optional)","type":"integer"},"media_items":{"description":"Media item list (for carousel and other multi-file publishing scenarios. When `media_items` is set, `bucket_name`/`bucket_key` are not required)","items":{"properties":{"bucket_key":{"description":"Object key","type":"string"},"bucket_name":{"description":"Bucket name","type":"string"},"order":{"description":"Sort index","type":"integer"}},"required":["bucket_name","bucket_key","order"],"type":"object"},"type":"array"},"publications":{"description":"Publish target list (can publish to multiple accounts at once)","items":{"properties":{"description":{"description":"Video description","type":"string"},"platform_account_id":{"description":"Target social account ID","type":"integer"},"platform_config":{"description":"Platform-specific publishing config (click to expand for details)","properties":{"privacy":{"description":"Privacy setting. TikTok: PUBLIC_TO_EVERYONE (default) / MUTUAL_FOLLOW_FRIENDS / FOLLOWER_OF_CREATOR / SELF_ONLY; YouTube: public / private (default) / unlisted","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY","public","private","unlisted"],"type":"string"},"product_id":{"description":"Linked product ID","type":"string"},"product_title":{"description":"Linked product name","type":"string"}},"title":"Platform publishing config","type":"object"},"scheduled_at":{"description":"Scheduled publish timestamp (Unix seconds)","type":"integer"},"tags":{"description":"Tag list","items":{"type":"string"},"type":"array"},"title":{"description":"Video title","type":"string"}},"required":["platform_account_id","title"],"type":"object"},"type":"array"},"source_id":{"description":"Source ID","type":"string"},"source_type":{"description":"Source type","type":"string"},"video_description":{"description":"Video description","type":"string"},"video_title":{"description":"Video title","type":"string"}},"required":["video_title","publications"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":10,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"session_token":{"type":"string"},"skipped_accounts":{"items":{"type":"string"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Upload and Publish Video","tags":["Social/2.Video Publishing"],"x-billing-mode":"per_call","x-coin-cost":10,"x-scope":"trenz.social.write"}},"/open/v1/social/tiktok-shop/products":{"post":{"description":"Get the unified TikTok Shop product list, auto-routing between showcase and shop sources.","operationId":"trenz-social-tiktok-shop-products","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_id":{"description":"Platform account ID","type":"integer"},"data_source":{"description":"Data source: shop/showcase","type":"string"},"origin":{"description":"Source: LIVE/SHOWCASE","type":"string"},"page_size":{"description":"Page size, 1-20","type":"integer"},"page_token":{"description":"Pagination token","type":"string"},"sort_field":{"description":"Sort field: PRODUCT_ID/PRICE/SALE","type":"string"},"sort_order":{"description":"Sort direction: DESC/ASC","type":"string"},"title_keyword":{"description":"Product title search","type":"string"}},"required":["account_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"creator_type":{"type":"string"},"data_source":{"type":"string"},"next_page_token":{"type":"string"},"products":{"items":{"properties":{"added_status":{"type":"string"},"brand_name":{"description":"Brand name","type":"string"},"commission":{"description":"Commission info","properties":{"amount":{"type":"string"},"rate":{"type":"number"}},"type":"object"},"detail_link":{"description":"Product detail URL","type":"string"},"id":{"type":"string"},"images":{"items":{"properties":{"height":{"type":"integer"},"url":{"type":"string"},"width":{"type":"integer"}},"type":"object"},"type":"array"},"inventory_status":{"description":"Stock status","type":"string"},"is_hidden":{"description":"Whether hidden","type":"boolean"},"price":{"properties":{"amount":{"type":"string"},"currency":{"type":"string"}},"type":"object"},"review_status":{"description":"Review status","type":"string"},"sale_regions":{"description":"Sales region","items":{"type":"string"},"type":"array"},"sales_count":{"description":"Sales","type":"integer"},"shop_name":{"description":"Seller name","type":"string"},"source":{"description":"Product source","type":"string"},"title":{"type":"string"}},"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"TikTok Shop Product List","tags":["Social/7.TikTok Shop"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/tiktok-shop/showcase/add":{"post":{"description":"Add a product to the TikTok Shop creator showcase.","operationId":"trenz-social-tiktok-shop-showcase-add","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"account_id":{"description":"Platform account ID","type":"integer"},"add_type":{"description":"Add mode: PRODUCT_ID/PRODUCT_LINK","type":"string"},"product_ids":{"description":"Product ID list, max 20","items":{"type":"string"},"type":"array"},"product_link":{"description":"Product URL","type":"string"}},"required":["account_id","add_type"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":2,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"errors":{"items":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"product_id":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Add Product to Showcase","tags":["Social/7.TikTok Shop"],"x-billing-mode":"per_call","x-coin-cost":2,"x-scope":"trenz.social.write"}},"/open/v1/social/tiktok/qrcode":{"post":{"description":"Get a TikTok QR code for login. After scanning and authorizing, you must poll the \"TikTok QR Code Status Check\" endpoint every 2-3 seconds until it returns status=confirmed to complete binding.","operationId":"trenz-social-tiktok-qrcode","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"connector":{"description":"Must be trenz","enum":["trenz"],"type":"string"},"state":{"description":"CSRF protection state parameter","type":"string"}},"required":["connector"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"scan_qrcode_url":{"type":"string"},"token":{"type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"TikTok QR Code Login","tags":["Social/1.Account Management"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.write"}},"/open/v1/social/tiktok/qrcode/check":{"post":{"description":"Poll the TikTok QR code login status.","operationId":"trenz-social-tiktok-qrcode-check","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"connector":{"description":"Must be trenz","enum":["trenz"],"type":"string"},"token":{"description":"Token obtained from 'TikTok QR Code Login'","type":"string"}},"required":["connector","token"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"account":{"description":"Account info returned on successful binding (when `status=confirmed` and connection succeeds)","properties":{"account_type":{"description":"Account type: business/creator","type":"string"},"avatar_url":{"description":"Avatar URL","type":"string"},"created_at":{"description":"Bound at (Unix timestamp)","type":"integer"},"display_name":{"description":"Display name","type":"string"},"id":{"description":"Account ID","type":"integer"},"platform":{"description":"Platform","type":"string"},"platform_account_id":{"description":"Platform-side account ID","type":"string"},"region":{"description":"TikTok Shop region","type":"string"},"scopes":{"description":"OAuth scope","items":{"type":"string"},"type":"array"},"status":{"description":"Account status: active/expired/revoked","type":"string"},"username":{"description":"Username","type":"string"}},"type":"object"},"client_ticket":{"description":"Client ticket string","type":"string"},"code":{"type":"string"},"redirect_uri":{"type":"string"},"state":{"description":"CSRF state parameter (returned when `status=confirmed`)","type":"string"},"status":{"description":"new/expired/scanned/confirmed/utilised","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"TikTok QR Code Status Check","tags":["Social/1.Account Management"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.write"}},"/open/v1/social/upload/presigned-url":{"post":{"description":"Generate an S3 presigned upload URL for direct client-side file upload.","operationId":"trenz-social-upload-presigned-url","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"content_type":{"description":"MIME type, e.g. image/jpeg","type":"string"},"expires_in":{"description":"Expiration time (seconds), default 3600","type":"integer"},"file_name":{"description":"File name (with extension)","type":"string"},"region":{"description":"Storage region: tos or aws, default tos","type":"string"}},"required":["file_name"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"cdn_url":{"description":"CDN URL","type":"string"},"object_key":{"description":"S3 object key","type":"string"},"presigned_url":{"description":"Presigned upload URL","type":"string"},"s3_bucket":{"description":"S3 bucket name","type":"string"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Generate Presigned Upload URL","tags":["File Upload"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/videos":{"post":{"description":"List a user's videos with pagination and status filtering.","operationId":"trenz-social-videos-list","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"content_type":{"description":"Content type: video/image","type":"string"},"include_details":{"description":"Whether to include publishing details","type":"boolean"},"include_presigned_urls":{"description":"Whether to include presigned URL","type":"boolean"},"limit":{"description":"Page size","type":"integer"},"page":{"description":"Page number","type":"integer"},"publish_time_after":{"description":"Publish time start (Unix timestamp)","type":"integer"},"publish_time_before":{"description":"Publish time end (Unix timestamp)","type":"integer"},"status":{"description":"Status filter","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"limit":{"type":"integer"},"page":{"type":"integer"},"total_count":{"type":"integer"},"videos":{"items":{"properties":{"aspect_ratio":{"type":"string"},"content_type":{"type":"string"},"cover_url":{"description":"Cover image URL","type":"string"},"created_at":{"type":"integer"},"description":{"type":"string"},"duration":{"type":"number"},"id":{"type":"integer"},"media_items":{"description":"Media item list","items":{"properties":{"bucket_key":{"type":"string"},"bucket_name":{"type":"string"},"order":{"type":"integer"}},"type":"object"},"type":"array"},"publications":{"description":"Publishing details list","items":{"properties":{"error_message":{"type":"string"},"id":{"type":"integer"},"platform":{"type":"string"},"platform_account_id":{"type":"integer"},"platform_url":{"type":"string"},"platform_video_id":{"type":"string"},"published_at":{"type":"integer"},"status":{"type":"string"}},"type":"object"},"type":"array"},"source_type":{"description":"Source type","type":"string"},"status":{"type":"string"},"title":{"type":"string"},"updated_at":{"type":"integer"}},"type":"object"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Publishing Record List","tags":["Social/3.Video Management"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/videos/check-info":{"post":{"description":"Validate a video against the rules of each target platform before publishing.","operationId":"trenz-social-video-check-info","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"bucket_name":{"description":"Bucket name (the `s3_bucket` returned by 'Generate Presigned Upload URL' under the 'General' category)","type":"string"},"object_key":{"description":"Object key (the `object_key` returned by 'Generate Presigned Upload URL' under the 'General' category)","type":"string"}},"required":["bucket_name","object_key"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"platform_rules":{"additionalProperties":{"type":"object"},"description":"Per-platform video rule info","type":"object"},"validation_results":{"additionalProperties":{"properties":{"errors":{"items":{"properties":{"field":{"type":"string"},"reason":{"type":"string"}},"type":"object"},"type":"array"},"is_valid":{"type":"boolean"}},"type":"object"},"description":"Per-platform validation result","type":"object"},"video_metadata":{"properties":{"bit_rate":{"description":"Bitrate (bps)","type":"integer"},"codec_name":{"type":"string"},"duration":{"type":"number"},"file_size":{"type":"integer"},"frame_rate":{"type":"number"},"height":{"type":"integer"},"width":{"type":"integer"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Validate Video Info","tags":["Social/3.Video Management"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/videos/detail":{"post":{"description":"Get details for a single video and its publishing records.","operationId":"trenz-social-video-detail","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"include_presigned_url":{"description":"Whether to include presigned URL","type":"boolean"},"video_id":{"description":"Video ID","type":"integer"}},"required":["video_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"presigned_url":{"type":"string"},"publications":{"items":{"properties":{"error_message":{"description":"Error message","type":"string"},"id":{"type":"integer"},"platform":{"description":"Platform","type":"string"},"platform_account_id":{"description":"Platform account ID","type":"integer"},"platform_url":{"type":"string"},"platform_video_id":{"type":"string"},"progress_percentage":{"description":"Progress percentage","type":"integer"},"published_at":{"type":"integer"},"stage":{"description":"Publishing stage","type":"string"},"status":{"type":"string"}},"type":"object"},"type":"array"},"video":{"properties":{"aspect_ratio":{"type":"string"},"content_type":{"type":"string"},"description":{"type":"string"},"duration":{"type":"number"},"file_size":{"type":"integer"},"id":{"type":"integer"},"status":{"type":"string"},"title":{"type":"string"}},"type":"object"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Publishing Record Detail","tags":["Social/3.Video Management"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/social/videos/platform":{"post":{"description":"List videos published to the platform along with their metrics.","operationId":"trenz-social-platform-videos","parameters":[{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"filter":{"description":"Filters (click to expand for details)","properties":{"published_after":{"description":"Publish time start (Unix timestamp)","type":"integer"},"published_before":{"description":"Publish time end (Unix timestamp)","type":"integer"},"search_keyword":{"description":"Search keyword","type":"string"},"sort_by":{"description":"Sort field","type":"string"},"sort_order":{"description":"Sort direction (asc/desc)","type":"string"}},"type":"object"},"include_presigned_urls":{"description":"Whether to include presigned URL","type":"boolean"},"limit":{"description":"Page size","type":"integer"},"page":{"description":"Page number","type":"integer"},"platform_account_id":{"description":"Platform account ID","type":"integer"}},"required":["platform_account_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":1,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"last_synced_at":{"type":"integer"},"limit":{"type":"integer"},"page":{"type":"integer"},"total_count":{"type":"integer"},"videos":{"items":{"properties":{"cover_url":{"type":"string"},"duration":{"description":"Video duration (seconds)","type":"number"},"media_type":{"description":"Media type","type":"string"},"metrics":{"properties":{"comment_count":{"type":"integer"},"like_count":{"type":"integer"},"play_count":{"type":"integer"},"share_count":{"type":"integer"}},"type":"object"},"metrics_updated_at":{"description":"Metric updated at (Unix timestamp)","type":"integer"},"platform":{"type":"string"},"platform_url":{"type":"string"},"platform_video_id":{"type":"string"},"publication_id":{"type":"integer"},"published_at":{"type":"integer"},"video_id":{"type":"integer"},"video_title":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Platform Video Metrics List","tags":["Social/3.Video Management"],"x-billing-mode":"per_call","x-coin-cost":1,"x-scope":"trenz.social.read"}},"/open/v1/tasks/{task_id}":{"get":{"description":"Query the status and result of an async task. Failed tasks are auto-refunded, status becomes refunded.","operationId":"task-status","parameters":[{"description":"Async task ID (returned by async endpoints)","in":"path","name":"task_id","required":true,"schema":{"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"status":"completed","task_id":"task_abc123"},"request_id":"req_abc123"},"schema":{"properties":{"data":{"properties":{"error_message":{"description":"Error message (only when refunded)","type":"string"},"result":{"description":"Task result (only when completed)","type":"object"},"status":{"description":"Task status","enum":["pending","running","completed","refunded"],"type":"string"},"task_id":{"description":"Task ID","type":"string"}},"required":["task_id","status"],"type":"object"},"request_id":{"type":"string"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Query async task status","tags":["Async Tasks"],"x-billing-mode":"free","x-coin-cost":0}},"/open/v1/videos/search":{"get":{"description":"Search TikTok shoppable videos with multi-dimensional filters on views, GMV, engagement rate, etc.","operationId":"trenz-videos-search","parameters":[{"description":"Video category ID","in":"query","name":"category","required":false,"schema":{"type":"string"}},{"description":"Whether is a commerce video","in":"query","name":"is_commercial","required":false,"schema":{"type":"boolean"}},{"description":"Search keyword","in":"query","name":"keyword","required":false,"schema":{"type":"string"}},{"description":"Max engagement rate (0-1)","in":"query","name":"max_engagement","required":false,"schema":{"type":"number"}},{"description":"30-day max GMV (USD)","in":"query","name":"max_gmv_30d","required":false,"schema":{"type":"number"}},{"description":"Max likes","in":"query","name":"max_likes","required":false,"schema":{"type":"number"}},{"description":"Max views","in":"query","name":"max_views","required":false,"schema":{"type":"number"}},{"description":"Min engagement rate (0-1)","in":"query","name":"min_engagement","required":false,"schema":{"type":"number"}},{"description":"30-day min GMV (USD)","in":"query","name":"min_gmv_30d","required":false,"schema":{"type":"number"}},{"description":"Min likes","in":"query","name":"min_likes","required":false,"schema":{"type":"number"}},{"description":"Min views","in":"query","name":"min_views","required":false,"schema":{"type":"number"}},{"description":"Page number, default 1","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},{"description":"Page size, default 20, max 20","in":"query","name":"page_size","required":false,"schema":{"default":20,"maximum":20,"type":"integer"}},{"description":"Sort field, format: field:asc|desc. Allowed fields: engagement, gmv_30d, launch_time, likes, sold_30d, views. Default: views:desc","in":"query","name":"sort","required":false,"schema":{"default":"views:desc","enum":["engagement","gmv_30d","launch_time","likes","sold_30d","views"],"type":"string"}},{"description":"Routing parameter: routes to different backends by country value","in":"query","name":"country","required":true,"schema":{"enum":["br","de","es","fr","gb","id","it","jp","mx","my","ph","sg","th","us","vn"],"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"items":{"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Video Search","tags":["Data/Videos"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.videos.read"}},"/open/v1/videos/{id}":{"get":{"description":"Get TikTok video details with linked products.","operationId":"trenz-videos-detail","parameters":[{"description":"Routing parameter: routes to different backends by country value","in":"query","name":"country","required":true,"schema":{"enum":["br","de","es","fr","gb","id","it","jp","mx","my","ph","sg","th","us","vn"],"type":"string"}},{"description":"Include related resources, comma-separated (values: products(Linked products))","in":"query","name":"include","required":false,"schema":{"type":"string"}},{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Your API Key","in":"header","name":"X-API-Key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{},"request_id":"req_abc123","usage":{"coin_cost":5,"remaining_balance":9999}},"schema":{"properties":{"data":{"properties":{"items":{"items":{"type":"object"},"type":"array"},"total_count":{"type":"integer"}},"type":"object"},"request_id":{"type":"string"},"usage":{"$ref":"#/components/schemas/UsageInfo"}},"required":["data","request_id"],"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"example":{"code":"BAD_REQUEST","message":"Invalid request parameters","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad request"},"401":{"content":{"application/json":{"example":{"code":"AUTH_INVALID_KEY","message":"The API key provided is invalid or has been revoked","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"example":{"code":"INSUFFICIENT_BALANCE","message":"Your account balance is insufficient for this request","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Insufficient balance"},"403":{"content":{"application/json":{"example":{"code":"FORBIDDEN_SCOPE","message":"Your API key does not have permission to access this resource","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"example":{"code":"ROUTE_NOT_FOUND","message":"The requested resource was not found","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Not found"},"429":{"content":{"application/json":{"example":{"code":"RATE_LIMITED","message":"Too many requests, please try again later","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Rate limit exceeded"},"500":{"content":{"application/json":{"example":{"code":"INTERNAL_ERROR","message":"An unexpected error occurred on the server","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Internal server error"},"502":{"content":{"application/json":{"example":{"code":"BACKEND_ERROR","message":"The upstream service returned an invalid response","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Bad gateway"},"503":{"content":{"application/json":{"example":{"code":"BACKEND_UNAVAILABLE","message":"The upstream service is temporarily unavailable","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Service unavailable"},"504":{"content":{"application/json":{"example":{"code":"BACKEND_TIMEOUT","message":"The upstream service did not respond in time","request_id":"req_example"},"schema":{"$ref":"#/components/schemas/APIError"}}},"description":"Gateway timeout"}},"summary":"Video Detail","tags":["Data/Videos"],"x-billing-mode":"per_call","x-coin-cost":5,"x-scope":"trenz.videos.read"}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"servers":[{"description":"Production","url":"https://openapi.gateway.trenz.ai"}],"tags":[{"name":"Ads/Accounts"},{"name":"Ads/Campaigns"},{"name":"Ads/Landing Pages"},{"name":"Ads/Leads \u0026 Reports"},{"description":"## Async Task Workflow\n\n1. Submit the task (e.g. POST /open/v1/ai/videos/content-analysis) → returns `task_id`\n2. Poll status: GET /open/v1/tasks/{task_id}\n   - status=\"running\" → keep polling (recommended interval 3-5 sec)\n   - status=\"success\" → the `result` field contains the full result\n   - status=\"failed\" → the `error_message` field contains the error details\n3. Successful task results are persisted and can be retrieved again at any time\n\n\u003e All AI analysis and AI generation endpoints are async.\n\u003e They return `task_id` immediately without blocking.","name":"Async Tasks"},{"name":"Content/AI Analysis"},{"name":"Content/AI Copywriting"},{"description":"All `*_url` fields in this section require publicly accessible URLs. To upload local files, first call the 'Generate Presigned Upload URL' endpoint under 'File Upload'.","name":"Content/AI Image"},{"description":"All `*_url` fields in this section require publicly accessible URLs. To upload local files, first call the 'Generate Presigned Upload URL' endpoint under 'File Upload'.","name":"Content/AI Video"},{"description":"All `*_url` fields in this section require publicly accessible URLs. To upload local files, first call the 'Generate Presigned Upload URL' endpoint under 'File Upload'.","name":"Content/Avatar"},{"name":"Content/Material Search"},{"name":"Content/Tools"},{"description":"## Parameters\n\n### Ad Type Reference\n\nAllowed values for `ad_type`:\n\n| Value | Ad Type |\n|-------|---------|\n| 1 | TikTok Shop Ads |\n| 2 | Independent Site Ads |\n| 3 | App Ads |\n| 4 | Game Ads |\n| 5 | Brand Ads |\n| 6 | Lead Ads |\n| 7 | Engagement Ads |\n\n## Product Category ID Reference\n\nThe `category` parameter is the ad's associated product category ID:\n\n| Category ID | Category |\n|-------------|----------|\n| 601450 | Beauty \u0026 Personal Care |\n| 601152 | Womenswear \u0026 Underwear |\n| 700645 | Health |\n| 603014 | Sports \u0026 Outdoor |\n| 601739 | Phones \u0026 Electronics |\n| 600942 | Home Appliances |\n| 824328 | Menswear \u0026 Underwear |\n| 605248 | Fashion Accessories |\n| 700437 | Food \u0026 Beverages |\n| 600001 | Household Products |\n| 604453 | Furniture |\n| 600024 | Kitchenware |\n| 600154 | Home Textiles |\n| 824584 | Luggage \u0026 Bags |\n| 604206 | Toys \u0026 Hobbies |\n| 601352 | Shoes |\n| 604579 | Tools \u0026 Hardware |\n| 604968 | Home Improvement |\n| 602118 | Pet Supplies |\n| 601755 | Computers \u0026 Office |\n| 602284 | Baby \u0026 Maternity |\n| 605196 | Automotive \u0026 Motorcycle |\n| 951432 | Collectibles |\n| 801928 | Books, Magazines \u0026 Audio/Video |\n| 953224 | Jewelry \u0026 Accessories |\n| 856720 | Pre-Owned Goods |\n| 802184 | Kids' Fashion |\n\n\u003e These are Level-1 categories. Passing a Level-1 ID filters all ads in that category.","name":"Data/Ads"},{"description":"## Parameters\n\n- `country`: Country code. Allowed values: us, th, my, vn, mx, de, fr, it, es, jp, br, gb, ph, sg, id\n\n## Product Category ID Reference\n\nThe `category` parameter is the creative's associated product category ID:\n\n| Category ID | Category |\n|-------------|----------|\n| 601450 | Beauty \u0026 Personal Care |\n| 601152 | Womenswear \u0026 Underwear |\n| 700645 | Health |\n| 603014 | Sports \u0026 Outdoor |\n| 601739 | Phones \u0026 Electronics |\n| 600942 | Home Appliances |\n| 824328 | Menswear \u0026 Underwear |\n| 605248 | Fashion Accessories |\n| 700437 | Food \u0026 Beverages |\n| 600001 | Household Products |\n| 604453 | Furniture |\n| 600024 | Kitchenware |\n| 600154 | Home Textiles |\n| 824584 | Luggage \u0026 Bags |\n| 604206 | Toys \u0026 Hobbies |\n| 601352 | Shoes |\n| 604579 | Tools \u0026 Hardware |\n| 604968 | Home Improvement |\n| 602118 | Pet Supplies |\n| 601755 | Computers \u0026 Office |\n| 602284 | Baby \u0026 Maternity |\n| 605196 | Automotive \u0026 Motorcycle |\n| 951432 | Collectibles |\n| 801928 | Books, Magazines \u0026 Audio/Video |\n| 953224 | Jewelry \u0026 Accessories |\n| 856720 | Pre-Owned Goods |\n| 802184 | Kids' Fashion |\n\n\u003e These are Level-1 categories. Passing a Level-1 ID filters all creatives in that category.","name":"Data/Creatives"},{"description":"## Parameters\n\n- `category`: Creator category ID. Creator categories differ from product categories — they are content-niche tags. No list is provided yet; we recommend first searching without this parameter and then using the `category_label` field from the response for further filtering.\n- `has_contact`: Whether the creator has public contact info (true/false), filters creators with public email or social handles.","name":"Data/Creators"},{"description":"## Parameters\n\n- `category`: Streamer category ID; uses the same taxonomy as creator categories. No list is provided yet; we recommend first searching without this parameter.\n- `is_living`: Whether currently live-streaming (true/false)\n- `is_commercial`: Whether this is a commerce live stream (true/false)\n\n## Product Category ID Reference\n\nThe `product_category` parameter is the product category ID for commerce lives:\n\n| Category ID | Category |\n|-------------|----------|\n| 601450 | Beauty \u0026 Personal Care |\n| 601152 | Womenswear \u0026 Underwear |\n| 700645 | Health |\n| 603014 | Sports \u0026 Outdoor |\n| 601739 | Phones \u0026 Electronics |\n| 600942 | Home Appliances |\n| 824328 | Menswear \u0026 Underwear |\n| 605248 | Fashion Accessories |\n| 700437 | Food \u0026 Beverages |\n| 600001 | Household Products |\n| 604453 | Furniture |\n| 600024 | Kitchenware |\n| 600154 | Home Textiles |\n| 824584 | Luggage \u0026 Bags |\n| 604206 | Toys \u0026 Hobbies |\n| 601352 | Shoes |\n| 604579 | Tools \u0026 Hardware |\n| 604968 | Home Improvement |\n| 602118 | Pet Supplies |\n| 601755 | Computers \u0026 Office |\n| 602284 | Baby \u0026 Maternity |\n| 605196 | Automotive \u0026 Motorcycle |\n| 951432 | Collectibles |\n| 801928 | Books, Magazines \u0026 Audio/Video |\n| 953224 | Jewelry \u0026 Accessories |\n| 856720 | Pre-Owned Goods |\n| 802184 | Kids' Fashion |\n\n\u003e These are Level-1 categories. Passing a Level-1 ID filters all lives in that category.","name":"Data/Lives"},{"description":"## Product Category ID Reference\n\nThe `category` parameter in search endpoints takes a numeric category ID. Below is the TikTok Level-1 category list:\n\n| Category ID | Category |\n|-------------|----------|\n| 601450 | Beauty \u0026 Personal Care |\n| 601152 | Womenswear \u0026 Underwear |\n| 700645 | Health |\n| 603014 | Sports \u0026 Outdoor |\n| 601739 | Phones \u0026 Electronics |\n| 600942 | Home Appliances |\n| 824328 | Menswear \u0026 Underwear |\n| 605248 | Fashion Accessories |\n| 700437 | Food \u0026 Beverages |\n| 600001 | Household Products |\n| 604453 | Furniture |\n| 600024 | Kitchenware |\n| 600154 | Home Textiles |\n| 824584 | Luggage \u0026 Bags |\n| 604206 | Toys \u0026 Hobbies |\n| 601352 | Shoes |\n| 604579 | Tools \u0026 Hardware |\n| 604968 | Home Improvement |\n| 602118 | Pet Supplies |\n| 601755 | Computers \u0026 Office |\n| 602284 | Baby \u0026 Maternity |\n| 605196 | Automotive \u0026 Motorcycle |\n| 951432 | Collectibles |\n| 801928 | Books, Magazines \u0026 Audio/Video |\n| 953224 | Jewelry \u0026 Accessories |\n| 856720 | Pre-Owned Goods |\n| 802184 | Kids' Fashion |\n\n\u003e These are Level-1 categories. Passing a Level-1 ID filters all products under that category.","name":"Data/Products"},{"description":"## Parameters\n\n- `seller_type`: Seller type (1=Overseas Non-Brand, 2=Local, 3=Brand, 4=Non-Brand)\n\n## Product Category ID Reference\n\nThe `category` parameter is the seller's primary product category ID; it uses the same taxonomy as product search:\n\n| Category ID | Category |\n|-------------|----------|\n| 601450 | Beauty \u0026 Personal Care |\n| 601152 | Womenswear \u0026 Underwear |\n| 700645 | Health |\n| 603014 | Sports \u0026 Outdoor |\n| 601739 | Phones \u0026 Electronics |\n| 600942 | Home Appliances |\n| 824328 | Menswear \u0026 Underwear |\n| 605248 | Fashion Accessories |\n| 700437 | Food \u0026 Beverages |\n| 600001 | Household Products |\n| 604453 | Furniture |\n| 600024 | Kitchenware |\n| 600154 | Home Textiles |\n| 824584 | Luggage \u0026 Bags |\n| 604206 | Toys \u0026 Hobbies |\n| 601352 | Shoes |\n| 604579 | Tools \u0026 Hardware |\n| 604968 | Home Improvement |\n| 602118 | Pet Supplies |\n| 601755 | Computers \u0026 Office |\n| 602284 | Baby \u0026 Maternity |\n| 605196 | Automotive \u0026 Motorcycle |\n| 951432 | Collectibles |\n| 801928 | Books, Magazines \u0026 Audio/Video |\n| 953224 | Jewelry \u0026 Accessories |\n| 856720 | Pre-Owned Goods |\n| 802184 | Kids' Fashion |\n\n\u003e These are Level-1 categories. Passing a Level-1 ID filters all sellers primarily in that category.","name":"Data/Sellers"},{"description":"## Parameters\n\n- `is_commercial`: Whether this is a commerce video (true/false)\n\n## Product Category ID Reference\n\nThe `category` parameter is the video's associated product category ID:\n\n| Category ID | Category |\n|-------------|----------|\n| 601450 | Beauty \u0026 Personal Care |\n| 601152 | Womenswear \u0026 Underwear |\n| 700645 | Health |\n| 603014 | Sports \u0026 Outdoor |\n| 601739 | Phones \u0026 Electronics |\n| 600942 | Home Appliances |\n| 824328 | Menswear \u0026 Underwear |\n| 605248 | Fashion Accessories |\n| 700437 | Food \u0026 Beverages |\n| 600001 | Household Products |\n| 604453 | Furniture |\n| 600024 | Kitchenware |\n| 600154 | Home Textiles |\n| 824584 | Luggage \u0026 Bags |\n| 604206 | Toys \u0026 Hobbies |\n| 601352 | Shoes |\n| 604579 | Tools \u0026 Hardware |\n| 604968 | Home Improvement |\n| 602118 | Pet Supplies |\n| 601755 | Computers \u0026 Office |\n| 602284 | Baby \u0026 Maternity |\n| 605196 | Automotive \u0026 Motorcycle |\n| 951432 | Collectibles |\n| 801928 | Books, Magazines \u0026 Audio/Video |\n| 953224 | Jewelry \u0026 Accessories |\n| 856720 | Pre-Owned Goods |\n| 802184 | Kids' Fashion |\n\n\u003e These are Level-1 categories. Passing a Level-1 ID filters all videos in that category.","name":"Data/Videos"},{"name":"File Upload"},{"description":"You must bind at least one social account before using any social media feature. TikTok QR-code login is currently supported.\n\nOnce bound, call 'Social Account List' to view all connected accounts with their status and metrics.","name":"Social/1.Account Management"},{"description":"One-step publishing via 'Upload and Publish Video', with support for immediate and scheduled publishing across multiple accounts.\n\n## Prerequisite: Bind a Social Account\n\nYou must bind at least one social account before publishing. Go to 'Social/1.Account Management' and use 'TikTok QR Code Login' + 'TikTok QR Code Status' for QR-based binding.\n\nOnce bound, retrieve the `id` field from 'Social Account List' — this is the `platform_account_id` required by the publishing endpoint below.\n\n---\n\n## Step 1: Upload File\n\n### 1.1 Call 'Generate Presigned Upload URL' to get a temporary upload URL (this endpoint is under 'File Upload')\n\n```bash\ncurl -X POST \"https://openapi.gateway.trenz.com/open/v1/social/upload/presigned-url\" \\\n  -H \"X-API-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"file_name\": \"my_video.mp4\"}'\n```\n\nResponse example:\n```json\n{\n  \"data\": {\n    \"presigned_url\": \"https://data-datanebula-object.tos-ap-southeast-1.volces.com/upload/my_video.mp4_xxx?...\",\n    \"object_key\": \"upload/my_video.mp4_xxx\",\n    \"s3_bucket\": \"data-datanebula-object\",\n    \"cdn_url\": \"https://oss-data.trenz.ai/upload%2Fmy_video.mp4_xxx?...\"\n  }\n}\n```\n\n\u003e Record the returned `object_key` and `s3_bucket` — they are needed in the following steps.\n\n### 1.2 Upload the file to presigned_url via PUT\n\n```bash\ncurl -X PUT \"{presigned_url}\" \\\n  -H \"Content-Type: video/mp4\" \\\n  --data-binary @my_video.mp4\n```\n\n\u003e presigned_url is valid for 1 hour. File size limits depend on the target platform (TikTok max 4GB, YouTube max 256GB, Instagram Reels max 1GB).\n\n---\n\n## Step 2: Validate Video Info (Recommended)\n\nAfter upload, call 'Validate Video Info' to check that the video matches the target platform's spec (resolution, duration, bitrate, etc.) and avoid publishing failures:\n\n```bash\ncurl -X POST \"https://openapi.gateway.trenz.com/open/v1/social/videos/check-info\" \\\n  -H \"X-API-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"bucket_name\": \"data-datanebula-object\", \"bucket_key\": \"upload/my_video.mp4_xxx\"}'\n```\n\n\u003e This endpoint checks encoding, resolution, duration, etc. against the requirements of TikTok, YouTube, Instagram and other platforms.\n\n---\n\n## Step 3: Call 'Upload and Publish Video'\n\n```bash\ncurl -X POST \"https://openapi.gateway.trenz.com/open/v1/social/publish/upload-and-publish\" \\\n  -H \"X-API-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"video_title\": \"My Video\",\n    \"video_description\": \"Check this out!\",\n    \"bucket_name\": \"data-datanebula-object\",\n    \"bucket_key\": \"upload/my_video.mp4_xxx\",\n    \"publications\": [\n      {\n        \"platform_account_id\": 4687,\n        \"title\": \"Check out this video!\",\n        \"platform_config\": \"{\\\"privacy\\\":\\\"PUBLIC_TO_EVERYONE\\\"}\"\n      }\n    ]\n  }'\n```\n\n\u003e `bucket_name` = the `s3_bucket` returned in Step 1, `bucket_key` = the `object_key` returned in Step 1.\n\u003e Supports publishing to multiple accounts in parallel via the `publications` array. The returned `session_token` is used to poll publishing progress.\n\n### Scheduled Publishing\n\nSet `scheduled_at` (Unix seconds) in each `publications` entry to schedule publishing. Each account can have its own schedule:\n\n```json\n{\n  \"video_title\": \"My Video\",\n  \"bucket_name\": \"data-datanebula-object\",\n  \"bucket_key\": \"upload/my_video.mp4_xxx\",\n  \"publications\": [\n    {\n      \"platform_account_id\": 4687,\n      \"title\": \"Publish now\",\n      \"platform_config\": \"{\\\"privacy\\\":\\\"PUBLIC_TO_EVERYONE\\\"}\"\n    },\n    {\n      \"platform_account_id\": 5678,\n      \"title\": \"Publish tomorrow\",\n      \"scheduled_at\": 1774100400,\n      \"platform_config\": \"{\\\"share_to_feed\\\":true}\"\n    }\n  ]\n}\n```\n\n\u003e `scheduled_at` must fall within 5 minutes to 90 days from now. Omit or set to 0 for immediate publishing; values under 5 minutes are auto-demoted to immediate.\n\u003e Scheduled publications can be rescheduled via the 'Reschedule' endpoint.\n\n---\n\n## Step 4: Poll 'Publish Session Status'\n\n```bash\ncurl -X POST \"https://openapi.gateway.trenz.com/open/v1/social/publish/session\" \\\n  -H \"X-API-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"session_token\": \"127169e7-35e3-40...\"}'\n```\n\n\u003e Recommended poll interval: 3–5 seconds. Repeat until status is completed or failed.\n\n### Cancel Publishing (Optional)\n\n- 'Cancel Publish Session' cancels an in-progress session: `POST /open/v1/social/publish/session/cancel`\n- 'Cancel Individual Publish' cancels a submitted publication: `POST /open/v1/social/publish/cancel`","name":"Social/2.Video Publishing"},{"name":"Social/3.Video Management"},{"name":"Social/4.Comment Management"},{"name":"Social/5.Analytics"},{"name":"Social/6.Creation Tools"},{"name":"Social/7.TikTok Shop"}],"x-tagGroups":[{"name":"Data","tags":["Data/Ads","Data/Creatives","Data/Creators","Data/Lives","Data/Products","Data/Sellers","Data/Videos"]},{"name":"Content","tags":["Content/AI Analysis","Content/AI Copywriting","Content/AI Image","Content/AI Video","Content/Avatar","Content/Material Search","Content/Tools"]},{"name":"Social","tags":["Social/1.Account Management","Social/2.Video Publishing","Social/3.Video Management","Social/4.Comment Management","Social/5.Analytics","Social/6.Creation Tools","Social/7.TikTok Shop"]},{"name":"Ads","tags":["Ads/Accounts","Ads/Campaigns","Ads/Landing Pages","Ads/Leads \u0026 Reports"]},{"name":"General","tags":["Async Tasks","File Upload"]}]}