{"openapi":"3.1.0","info":{"title":"Replicate via Locus x402","version":"1.0.0","description":"Run thousands of open-source AI models via API — image generation, language models, speech recognition, video, and more. Pay only for what you use.","contact":{"email":"api@paywithlocus.com"},"x-guidance":"Use the documented POST operations for Replicate. Send JSON matching each requestBody schema. Unpaid public x402 requests return an x402 v2 payment challenge; retry the same body with PAYMENT-SIGNATURE and the returned x-locus-request-id."},"servers":[{"url":"https://replicate.x402.paywithlocus.com"}],"x-agentcash-guidance":{"llmsTxtUrl":"https://paywithlocus.com/x402/replicate.md"},"x-service-info":{"categories":["ai","media"],"docs":{"homepage":"https://replicate.com","apiReference":"https://replicate.com/docs/reference/http","llms":"https://paywithlocus.com/x402/replicate.md"}},"paths":{"/replicate/run":{"post":{"operationId":"replicate_run","summary":"Run Model","description":"Run any public Replicate model synchronously. The request blocks until the prediction completes (up to 60 seconds). Returns output directly in the response. If the model takes longer than 60s the response will include a prediction ID you can check with get-prediction.","tags":["AI / Generative"],"security":[],"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.005000","max":"0.050000"},"protocols":[{"x402":{}}],"x-locus":{"network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","scheme":"exact","estimatedCost":"Model-dependent ($0.005–$0.05)"}},"parameters":[{"name":"x-locus-request-id","in":"header","required":false,"description":"UUID returned by the initial 402. Echo it on the paid retry and later recovery attempts.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model_owner":{"type":"string","description":"Model owner / namespace (e.g. 'black-forest-labs')"},"model_name":{"type":"string","description":"Model name (e.g. 'flux-schnell')"},"input":{"description":"Model input parameters as an object (e.g. { prompt: 'a cat' }). Schema varies per model — see model page on replicate.com.","type":"object","additionalProperties":true}},"required":["model_owner","model_name"],"additionalProperties":true},"example":{"model_owner":"black-forest-labs","model_name":"flux-schnell","input":{"prompt":"A small purple circle on a white background","num_outputs":1,"go_fast":true,"megapixels":"0.25"}}}}},"responses":{"200":{"description":"Successful response with PAYMENT-RESPONSE and durable request receipt","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"output":{"type":"array","items":{"type":"string"}},"status":{"type":"string"}},"description":"Partial response schema observed in an authenticated, semantically verified customer call. Only observed field types are described; optionality, other inputs and error states are not inferred."},"request":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"},"statusUrl":{"type":"string"}},"required":["id","statusUrl"],"additionalProperties":false},"payment":{"type":"object","properties":{"scheme":{"type":"string","enum":["exact","upto"]},"authorizedMaxUsdc":{"type":"string","pattern":"^\\d+\\.\\d{6}$"},"settledUsdc":{"type":"string","pattern":"^\\d+\\.\\d{6}$"},"capExhausted":{"type":"boolean"},"calculatedActualUsdc":{"type":"string","pattern":"^\\d+\\.\\d{6}$"},"usage":{}},"required":["scheme","authorizedMaxUsdc","settledUsdc"],"additionalProperties":false}},"required":["success","data","request","payment"],"additionalProperties":false}}}},"202":{"description":"The supplied request ID is already in progress"},"400":{"description":"Invalid request"},"402":{"description":"Payment Required"},"409":{"description":"Request ID conflict or terminal failed request"}}}},"/replicate/get-prediction":{"post":{"operationId":"replicate_get_prediction","summary":"Get Prediction","description":"Retrieve the status and output of a prediction by ID. The provider lookup is free; Locus charges its $0.003 platform fee. Use this to check results for models that exceeded the 60s synchronous timeout in the run endpoint.","tags":["AI / Generative"],"security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.003000"},"protocols":[{"x402":{}}],"x-locus":{"network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","scheme":"exact","estimatedCost":"$0.003 platform fee (upstream free)"}},"parameters":[{"name":"x-locus-request-id","in":"header","required":false,"description":"UUID returned by the initial 402. Echo it on the paid retry and later recovery attempts.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prediction_id":{"type":"string","description":"Prediction ID returned by the run endpoint"}},"required":["prediction_id"],"additionalProperties":true},"example":{"prediction_id":"<from replicate/run>"}}}},"responses":{"200":{"description":"Successful response with PAYMENT-RESPONSE and durable request receipt","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"output":{"type":"array","items":{"type":"string"}},"status":{"type":"string"}},"description":"Partial response schema observed in an authenticated, semantically verified customer call. Only observed field types are described; optionality, other inputs and error states are not inferred."},"request":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"},"statusUrl":{"type":"string"}},"required":["id","statusUrl"],"additionalProperties":false},"payment":{"type":"object","properties":{"scheme":{"type":"string","enum":["exact","upto"]},"authorizedMaxUsdc":{"type":"string","pattern":"^\\d+\\.\\d{6}$"},"settledUsdc":{"type":"string","pattern":"^\\d+\\.\\d{6}$"},"capExhausted":{"type":"boolean"},"calculatedActualUsdc":{"type":"string","pattern":"^\\d+\\.\\d{6}$"},"usage":{}},"required":["scheme","authorizedMaxUsdc","settledUsdc"],"additionalProperties":false}},"required":["success","data","request","payment"],"additionalProperties":false}}}},"202":{"description":"The supplied request ID is already in progress"},"400":{"description":"Invalid request"},"402":{"description":"Payment Required"},"409":{"description":"Request ID conflict or terminal failed request"}}}},"/replicate/get-model":{"post":{"operationId":"replicate_get_model","summary":"Get Model","description":"Retrieve metadata for a public Replicate model: description, hardware, latest version, run count, and links.","tags":["AI / Generative"],"security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.004000"},"protocols":[{"x402":{}}],"x-locus":{"network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","scheme":"exact","estimatedCost":"$0.001 + $0.003 fee"}},"parameters":[{"name":"x-locus-request-id","in":"header","required":false,"description":"UUID returned by the initial 402. Echo it on the paid retry and later recovery attempts.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model_owner":{"type":"string","description":"Model owner / namespace (e.g. 'black-forest-labs')"},"model_name":{"type":"string","description":"Model name (e.g. 'flux-schnell')"}},"required":["model_owner","model_name"],"additionalProperties":true},"example":{"model_owner":"black-forest-labs","model_name":"flux-schnell"}}}},"responses":{"200":{"description":"Successful response with PAYMENT-RESPONSE and durable request receipt","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","additionalProperties":true,"properties":{"name":{"type":"string"},"latest_version":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"}}}},"description":"Partial response schema observed in an authenticated, semantically verified customer call. Only observed field types are described; optionality, other inputs and error states are not inferred."},"request":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"},"statusUrl":{"type":"string"}},"required":["id","statusUrl"],"additionalProperties":false},"payment":{"type":"object","properties":{"scheme":{"type":"string","enum":["exact","upto"]},"authorizedMaxUsdc":{"type":"string","pattern":"^\\d+\\.\\d{6}$"},"settledUsdc":{"type":"string","pattern":"^\\d+\\.\\d{6}$"},"capExhausted":{"type":"boolean"},"calculatedActualUsdc":{"type":"string","pattern":"^\\d+\\.\\d{6}$"},"usage":{}},"required":["scheme","authorizedMaxUsdc","settledUsdc"],"additionalProperties":false}},"required":["success","data","request","payment"],"additionalProperties":false}}}},"202":{"description":"The supplied request ID is already in progress"},"400":{"description":"Invalid request"},"402":{"description":"Payment Required"},"409":{"description":"Request ID conflict or terminal failed request"}}}},"/replicate/list-models":{"post":{"operationId":"replicate_list_models","summary":"List Models","description":"Browse public Replicate models. Returns a paginated list with metadata. Use the cursor field for pagination.","tags":["AI / Generative"],"security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.004000"},"protocols":[{"x402":{}}],"x-locus":{"network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","scheme":"exact","estimatedCost":"$0.001 + $0.003 fee"}},"parameters":[{"name":"x-locus-request-id","in":"header","required":false,"description":"UUID returned by the initial 402. Echo it on the paid retry and later recovery attempts.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cursor":{"type":"string","description":"Pagination cursor from a previous list-models response"}},"additionalProperties":true},"example":{}}}},"responses":{"200":{"description":"Successful response with PAYMENT-RESPONSE and durable request receipt","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","additionalProperties":true,"properties":{"results":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"name":{"type":"string"}}}}},"description":"Partial response schema observed in an authenticated, semantically verified customer call. Only observed field types are described; optionality, other inputs and error states are not inferred."},"request":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"},"statusUrl":{"type":"string"}},"required":["id","statusUrl"],"additionalProperties":false},"payment":{"type":"object","properties":{"scheme":{"type":"string","enum":["exact","upto"]},"authorizedMaxUsdc":{"type":"string","pattern":"^\\d+\\.\\d{6}$"},"settledUsdc":{"type":"string","pattern":"^\\d+\\.\\d{6}$"},"capExhausted":{"type":"boolean"},"calculatedActualUsdc":{"type":"string","pattern":"^\\d+\\.\\d{6}$"},"usage":{}},"required":["scheme","authorizedMaxUsdc","settledUsdc"],"additionalProperties":false}},"required":["success","data","request","payment"],"additionalProperties":false}}}},"202":{"description":"The supplied request ID is already in progress"},"400":{"description":"Invalid request"},"402":{"description":"Payment Required"},"409":{"description":"Request ID conflict or terminal failed request"}}}}}}