{"openapi":"3.1.0","info":{"title":"DeepSeek via Locus x402","version":"1.0.0","description":"Frontier AI models — DeepSeek-V3 for fast chat and code, DeepSeek-R1 for deep chain-of-thought reasoning. OpenAI-compatible API format. Among the most capable and cost-efficient models available.","contact":{"email":"api@paywithlocus.com"},"x-guidance":"Use the documented POST operations for DeepSeek. 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://deepseek.x402.stage.paywithlocus.com"}],"x-agentcash-guidance":{"llmsTxtUrl":"https://stage.paywithlocus.com/x402/deepseek.md"},"x-service-info":{"categories":["ai"],"docs":{"homepage":"https://deepseek.com","apiReference":"https://api-docs.deepseek.com","llms":"https://stage.paywithlocus.com/x402/deepseek.md"}},"paths":{"/deepseek/chat":{"post":{"operationId":"deepseek_chat","summary":"Chat","description":"Create a chat completion using DeepSeek V4 Flash or V4 Pro, with optional thinking mode. OpenAI-compatible request/response format.","tags":["AI / LLM"],"security":[],"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.001000"},"protocols":[{"x402":{}}],"x-locus":{"network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","scheme":"upto","pricing":"metered","authorization":"maximum","settlement":"actual-usage","pricingVersion":"deepseek-2026-08-04-v1","estimatedCost":"Usage-based; the 402 challenge advertises the authorization maximum"}},"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":{"type":"string","description":"Metered x402 model: deepseek-v4-flash or deepseek-v4-pro"},"messages":{"description":"Array of message objects: [{\"role\":\"system\"|\"user\"|\"assistant\",\"content\":\"...\"}]","type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"text":{"type":"string"},"image_url":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":true}},"required":["type"],"additionalProperties":true}},{"type":"null"}]},"name":{"type":"string"},"tool_call_id":{"type":"string"},"tool_calls":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["role"],"additionalProperties":true}},"max_tokens":{"type":"number","description":"Maximum tokens to generate (up to 384000). Required to bound metered x402 authorization."},"temperature":{"type":"number","description":"Sampling temperature 0–2. Default: 1. Lower = more deterministic."},"stream":{"type":"boolean","description":"Streaming is not currently supported through public x402. Omit or use false."},"top_p":{"type":"number","description":"Nucleus sampling parameter. Default: 1."},"stop":{"type":"string","description":"Stop sequence(s) — string or array of strings."}},"required":["model","messages","max_tokens"],"additionalProperties":true},"example":{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"Reply with exactly the word PONG."}],"max_tokens":128}}}},"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":{"choices":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"message":{"type":"object","additionalProperties":true,"properties":{"content":{"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"}}}},"/deepseek/fim":{"post":{"operationId":"deepseek_fim","summary":"Fill-In-the-Middle (FIM)","description":"Code completion with fill-in-the-middle — provide a code prefix and optional suffix, and DeepSeek fills in the middle. Ideal for copilot-style code generation. Metered x402 supports deepseek-v4-pro.","tags":["AI / LLM"],"security":[],"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.001000"},"protocols":[{"x402":{}}],"x-locus":{"network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","scheme":"upto","pricing":"metered","authorization":"maximum","settlement":"actual-usage","pricingVersion":"deepseek-2026-08-04-v1","estimatedCost":"Usage-based; the 402 challenge advertises the authorization maximum"}},"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":{"type":"string","description":"Must be deepseek-v4-pro for metered x402 FIM"},"prompt":{"type":"string","description":"The code prefix to complete"},"suffix":{"type":"string","description":"The code suffix (text after the cursor). DeepSeek fills between prompt and suffix."},"max_tokens":{"type":"number","description":"Maximum tokens to generate (up to 384000). Required to bound metered x402 authorization."},"temperature":{"type":"number","description":"Sampling temperature. Default: 1."}},"required":["model","prompt","max_tokens"],"additionalProperties":true},"example":{"model":"deepseek-v4-pro","prompt":"def add(a, b):\n    ","suffix":"\n","max_tokens":64}}}},"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":{"choices":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"text":{"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"}}}},"/deepseek/list-models":{"post":{"operationId":"deepseek_list_models","summary":"List Models","description":"List available DeepSeek models with owner and availability information.","tags":["AI / LLM"],"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 fee only"}},"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":{},"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":{"data":{"type":"array","items":{"type":"object","additionalProperties":true}}},"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"}}}}}}