{"openapi":"3.1.0","info":{"title":"PipDepot API","description":"\nPipDepot marketplace API.\n\n**License validation** (`/api/v1/license/validate`) is public and meant to be called from MT5 Expert Advisors via\n`WebRequest`. **Seller endpoints** (`/api/v1/seller/*`) require an `X-API-Key` header created in the seller dashboard.\n\nTrading involves substantial risk of loss. Nothing returned by this API is financial advice.\n","version":"1.0.0"},"paths":{"/api/v1/license/validate":{"post":{"tags":["licenses"],"summary":"Validate License Post","description":"Validate a license key (JSON body). Call from MT5 with `WebRequest(\"POST\", ...)`.","operationId":"validate_license_post_api_v1_license_validate_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["licenses"],"summary":"Validate License Get","description":"Same as POST but with query parameters. `format=text` returns a pipe-separated line that is trivial to parse in MQL5.","operationId":"validate_license_get_api_v1_license_validate_get","parameters":[{"name":"key","in":"query","required":true,"schema":{"type":"string","description":"License key","title":"Key"},"description":"License key"},{"name":"product","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product"}},{"name":"account","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(json|text)$","default":"json","title":"Format"}}],"responses":{"200":{"description":"JSON, or `VALID|expires` / `INVALID|reason` when format=text","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products":{"get":{"tags":["catalog"],"summary":"Api Products","description":"Public catalog of approved listings.","operationId":"api_products_api_v1_products_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"category","in":"query","required":false,"schema":{"type":"string","default":"","title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/seller/products":{"get":{"tags":["seller"],"summary":"Api Seller Products","description":"Your listings (requires X-API-Key).","operationId":"api_seller_products_api_v1_seller_products_get","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/seller/licenses":{"get":{"tags":["seller"],"summary":"Api Seller Licenses","description":"Licenses sold for your products (requires X-API-Key). Buyer emails are not exposed.","operationId":"api_seller_licenses_api_v1_seller_licenses_get","parameters":[{"name":"product","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/seller/licenses/revoke":{"post":{"tags":["seller"],"summary":"Api Seller Revoke","description":"Revoke a license for one of your products (requires X-API-Key).","operationId":"api_seller_revoke_api_v1_seller_licenses_revoke_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/listing-writer":{"post":{"tags":["ai"],"summary":"Ai Listing","description":"Generate a product description from bullet points (sellers only; uses OPENAI_* env or a template fallback).","operationId":"ai_listing_api_ai_listing_writer_post","parameters":[{"name":"X-CSRF-Token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Csrf-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListingIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/chat":{"post":{"tags":["ai"],"summary":"Ai Chat","description":"Shopping assistant that recommends listings from the catalog.","operationId":"ai_chat_api_ai_chat_post","parameters":[{"name":"X-CSRF-Token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Csrf-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ChatIn":{"properties":{"message":{"type":"string","title":"Message"},"history":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"History","default":[]}},"type":"object","required":["message"],"title":"ChatIn"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ListingIn":{"properties":{"name":{"type":"string","title":"Name"},"category":{"type":"string","title":"Category","default":"ea"},"bullets":{"type":"string","title":"Bullets"}},"type":"object","required":["name","bullets"],"title":"ListingIn"},"RevokeIn":{"properties":{"license_key":{"type":"string","title":"License Key"}},"type":"object","required":["license_key"],"title":"RevokeIn"},"ValidateIn":{"properties":{"license_key":{"type":"string","title":"License Key","examples":["PD-ABCDE-FGHJK-LMNPQ-RSTUV-WXYZ2"]},"product":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product","description":"Product slug or numeric id the EA belongs to"},"account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account","description":"MT5 account login (binds the license to accounts up to max_accounts)"}},"type":"object","required":["license_key"],"title":"ValidateIn"},"ValidateOut":{"properties":{"valid":{"type":"boolean","title":"Valid"},"reason":{"type":"string","title":"Reason"},"product":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"accounts_used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Accounts Used"},"max_accounts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Accounts"},"server_time":{"type":"string","title":"Server Time"}},"type":"object","required":["valid","reason","server_time"],"title":"ValidateOut"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}