{"openapi":"3.1.0","info":{"title":"DeepSeek via Locus MPP","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."},"x-agentcash-guidance":{"llmsTxtUrl":"https://paywithlocus.com/mpp/deepseek.md"},"x-service-info":{"categories":["ai"],"docs":{"homepage":"https://deepseek.com","apiReference":"https://api-docs.deepseek.com","llms":"https://paywithlocus.com/mpp/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":{"intent":"charge","method":"tempo","amount":null,"currency":"0x20c000000000000000000000b9537d11c60e8b50","description":"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"},"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":{"intent":"charge","method":"tempo","amount":null,"currency":"0x20c000000000000000000000b9537d11c60e8b50","description":"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"},"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":{"intent":"charge","method":"tempo","amount":"3000","currency":"0x20c000000000000000000000b9537d11c60e8b50","description":"$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"},"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"}}}}}}