{"openapi":"3.1.0","info":{"title":"DarkSeek API","version":"0.1.0","description":"DarkSeek developer-preview contract. A schema is not a deployment-readiness claim. Custom domains and public account/credit integration are launch gates. Independently operated."},"servers":[{"url":"https://api.darkseeks.com/v1","description":"Canonical public API; DNS and public inference remain launch gates"}],"security":[{"BearerAuth":[]}],"tags":[{"name":"Models"},{"name":"Generation"}],"paths":{"/models":{"get":{"operationId":"listModels","tags":["Models"],"summary":"List available DarkSeek models","responses":{"200":{"description":"Configured model catalogue","content":{"application/json":{"schema":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Admission limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}},"503":{"description":"Unavailable or unconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/chat/completions":{"post":{"operationId":"createChatCompletion","tags":["Generation"],"summary":"Generate a text chat completion","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"Chat completion or SSE stream; read [DONE] before claiming completion","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"choices":{"type":"array","items":{"type":"object"}},"usage":{"$ref":"#/components/schemas/Usage"}}}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Browser origin rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Admission limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}},"502":{"description":"Upstream transport/protocol failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Unavailable or unconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Inference deadline exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/completions":{"post":{"operationId":"createTextCompletion","tags":["Generation"],"summary":"Continue one text prompt (not FIM)","description":"FIM suffix completion is not certified and is rejected. One bounded text result with checked finish reason and usage. Public inference is not yet enabled. Private origin weight metadata is removed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompletionRequest"}}}},"responses":{"200":{"description":"Text completion or SSE. Length means the output ceiling was reached. Stream success requires finish, final usage, [DONE] and clean EOF; trailing errors are not success.","content":{"application/json":{"schema":{"type":"object"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Browser origin rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Admission limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}},"502":{"description":"Upstream transport/protocol failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Unavailable or unconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Inference deadline exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages":{"post":{"operationId":"createMessage","tags":["Generation"],"summary":"Create a bounded Messages-format generation","description":"Native gateway + real GPU JSON/SSE and tool-result canary verified locally. Public inference is not yet enabled. No images, server tools, beta/cache/storage controls or guaranteed thinking budgets.","security":[{"SDKKey":[]},{"BearerAuth":[]}],"parameters":[{"name":"anthropic-version","in":"header","required":true,"schema":{"const":"2023-06-01"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesRequest"}}}},"responses":{"200":{"description":"Assistant message or Messages SSE lifecycle. Success requires message_delta then message_stop, not [DONE].","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesError"}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesError"}}}},"403":{"description":"Browser origin rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesError"}}}},"413":{"description":"Request too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesError"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesError"}}}},"429":{"description":"Admission limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesError"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}},"502":{"description":"Upstream transport/protocol failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesError"}}}},"503":{"description":"Unavailable or unconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesError"}}}},"504":{"description":"Inference deadline exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesError"}}}}}}},"/responses":{"post":{"operationId":"createResponse","tags":["Generation"],"summary":"Create a stateless Responses-format generation","description":"Official SDK JSON/SSE/custom-tool round trip/strict JSON/incomplete-status canary passed locally through real account admission, signed native Go and physical inference. Public inference is not yet enabled. Store and background are forced false; stored references, opaque state, hosted tools, files and images are rejected. Installed origin fails a one-token output budget.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesRequest"}}}},"responses":{"200":{"description":"Stateless result or checked SSE lifecycle. response.incomplete is not response.completed; errors/truncation are not success. No [DONE].","content":{"application/json":{"schema":{"type":"object"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Browser origin rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Admission limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"}}}},"502":{"description":"Upstream transport/protocol failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Unavailable or unconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Inference deadline exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"SDKKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Messages only: an account-owned DarkSeek key. Do not combine with Authorization."},"BearerAuth":{"type":"http","scheme":"bearer","description":"An account-owned DarkSeek API key, not a DeepSeek credential. Verified email and an enabled inference allowance are required. Public production inference is not open yet."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","message"],"properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}}}}},"MessagesError":{"type":"object","required":["type","error"],"properties":{"type":{"const":"error"},"error":{"type":"object","required":["type","message"],"properties":{"type":{"enum":["invalid_request_error","authentication_error","permission_error","request_too_large","rate_limit_error","overloaded_error","api_error"]},"code":{"type":"string"},"message":{"type":"string"}}}}},"MessagesRequest":{"type":"object","additionalProperties":false,"required":["model","messages","max_tokens"],"properties":{"model":{"const":"darkseek-v4.1"},"max_tokens":{"type":"integer","minimum":1,"maximum":384000,"default":384000,"description":"Required; bounded by the Models response deployment ceiling."},"stream":{"type":"boolean","default":false},"system":{"oneOf":[{"type":"string","minLength":1},{"type":"array","minItems":1,"maxItems":512,"items":{"type":"object","additionalProperties":false,"required":["type","text"],"properties":{"type":{"const":"text"},"text":{"type":"string","minLength":1}}}}]},"messages":{"type":"array","minItems":1,"maxItems":512,"description":"Start with a user entry. Resolve every preceding tool call once in the next user entry before generating.","items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["role","content"],"properties":{"role":{"const":"user"},"content":{"oneOf":[{"type":"string","minLength":1},{"type":"array","minItems":1,"maxItems":512,"items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["type","text"],"properties":{"type":{"const":"text"},"text":{"type":"string","minLength":1}}},{"type":"object","additionalProperties":false,"required":["type","tool_use_id"],"properties":{"type":{"const":"tool_result"},"tool_use_id":{"type":"string","minLength":1},"content":{"oneOf":[{"type":"string"},{"type":"array","minItems":1,"maxItems":512,"items":{"type":"object","additionalProperties":false,"required":["type","text"],"properties":{"type":{"const":"text"},"text":{"type":"string","minLength":1}}}}]},"is_error":{"type":"boolean"}}}]}}]}}},{"type":"object","additionalProperties":false,"required":["role","content"],"properties":{"role":{"const":"assistant"},"content":{"oneOf":[{"type":"string","minLength":1},{"type":"array","minItems":1,"maxItems":512,"items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["type","text"],"properties":{"type":{"const":"text"},"text":{"type":"string","minLength":1}}},{"type":"object","additionalProperties":false,"required":["type","id","name","input"],"properties":{"type":{"const":"tool_use"},"id":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$"},"input":{"type":"object"}}},{"type":"object","additionalProperties":false,"required":["type","thinking"],"properties":{"type":{"const":"thinking"},"thinking":{"type":"string","minLength":1},"signature":{"type":"string","description":"Optional unsigned local reasoning is not an Anthropic-verifiable signature."}}}]}}]}}}]}},"temperature":{"type":"number","minimum":0,"maximum":1},"top_p":{"type":"number","minimum":0,"maximum":1},"top_k":{"type":"integer","minimum":1,"maximum":1000},"stop_sequences":{"type":"array","maxItems":4,"items":{"type":"string","minLength":1,"maxLength":1024}},"thinking":{"type":"object","additionalProperties":false,"required":["type"],"properties":{"type":{"enum":["disabled","adaptive"]}},"description":"No guaranteed per-thinking budget, display suppression or signed Anthropic reasoning."},"tools":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["name","input_schema"],"properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$"},"description":{"type":"string","maxLength":16384},"input_schema":{"type":"object","required":["type"],"properties":{"type":{"const":"object"}}}}}},"tool_choice":{"type":"object","additionalProperties":false,"required":["type"],"properties":{"type":{"enum":["auto","any","tool","none"]},"name":{"type":"string"},"disable_parallel_tool_use":{"type":"boolean"}},"description":"A named tool must exist in tools. Forced tools cannot be combined with adaptive thinking."}}},"ResponsesRequest":{"type":"object","additionalProperties":false,"required":["model","input"],"properties":{"model":{"const":"darkseek-v4.1"},"input":{"oneOf":[{"type":"string","minLength":1},{"type":"array","minItems":1,"maxItems":512,"items":{"type":"object"},"description":"Complete text/reasoning/custom-function transcript; no stored references, encrypted state, files or images."}]},"instructions":{"type":"string"},"max_output_tokens":{"type":"integer","minimum":1,"maximum":384000,"default":384000,"description":"Live native gateway maximum and omitted-field default: 384000 tokens. Output includes reasoning once. Explicit smaller limits are preserved. Full-length 384K generation has not been certified."},"stream":{"type":"boolean","default":false},"store":{"const":false,"default":false,"description":"Forced false upstream even when omitted."},"background":{"const":false,"default":false},"truncation":{"const":"disabled"},"temperature":{"type":"number","minimum":0,"maximum":2},"top_p":{"type":"number","minimum":0,"maximum":1},"frequency_penalty":{"type":"number","minimum":-2,"maximum":2},"presence_penalty":{"type":"number","minimum":-2,"maximum":2},"stop":{"oneOf":[{"type":"string"},{"type":"array","minItems":1,"maxItems":4,"items":{"type":"string"}}]},"tools":{"type":"array","maxItems":64,"items":{"type":"object","required":["type","name"],"additionalProperties":false,"properties":{"type":{"const":"function"},"name":{"type":"string"},"description":{"type":"string"},"parameters":{"type":"object"},"strict":{"type":"boolean"}}}},"tool_choice":{"oneOf":[{"enum":["auto","none","required"]},{"type":"object","required":["type","name"],"additionalProperties":false,"properties":{"type":{"const":"function"},"name":{"type":"string"}}}]},"parallel_tool_calls":{"type":"boolean"},"text":{"type":"object","description":"format: text, json_object, or json_schema with name/schema/strict. No remote schema references."},"reasoning":{"type":"object","additionalProperties":false,"properties":{"effort":{"enum":["none","low","high","max"]},"summary":{"enum":["auto","concise","detailed"]}}},"metadata":{"type":"object","maxProperties":16,"additionalProperties":{"type":"string","maxLength":512}}}},"CompletionRequest":{"type":"object","additionalProperties":false,"required":["model","prompt"],"description":"Text continuation only. FIM suffix is rejected, not silently ignored.","properties":{"model":{"const":"darkseek-v4.1"},"prompt":{"type":"string","minLength":1},"max_tokens":{"type":"integer","minimum":1,"maximum":384000,"default":384000,"description":"Deployment-specific ceiling; default policy is 384000; smaller explicit limits are preserved."},"stream":{"type":"boolean","default":false},"temperature":{"type":"number","minimum":0,"maximum":2},"top_p":{"type":"number","minimum":0,"maximum":1},"frequency_penalty":{"type":"number","minimum":-2,"maximum":2},"presence_penalty":{"type":"number","minimum":-2,"maximum":2},"n":{"const":1},"best_of":{"const":1},"seed":{"type":"integer"},"echo":{"const":false},"logprobs":{"type":"null"},"stop":{"oneOf":[{"type":"string","minLength":1,"maxLength":1024},{"type":"array","minItems":1,"maxItems":4,"items":{"type":"string","minLength":1,"maxLength":1024}}]},"stream_options":{"type":"object","additionalProperties":false,"properties":{"include_usage":{"type":"boolean","description":"Native Go always requests final usage for validation."}}}}},"Message":{"type":"object","required":["id","type","role","model","content","usage","stop_reason"],"properties":{"id":{"type":"string"},"type":{"const":"message"},"role":{"const":"assistant"},"model":{"const":"darkseek-v4.1"},"content":{"type":"array","items":{"type":"object"}},"stop_reason":{"enum":["end_turn","max_tokens","stop_sequence","tool_use"]},"stop_sequence":{"type":["string","null"]},"usage":{"type":"object","required":["input_tokens","output_tokens"],"properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0}}}}},"Model":{"type":"object","required":["id","object","owned_by"],"properties":{"id":{"const":"darkseek-v4.1"},"object":{"const":"model"},"owned_by":{"const":"darkseek"},"name":{"type":"string"},"max_output_tokens":{"type":"integer"},"output_modalities":{"type":"array","items":{"const":"text"}},"fim_supported":{"const":false,"description":"Current deployment capability, not a claim that this model can never support FIM."}}},"ChatRequest":{"type":"object","required":["model","messages"],"properties":{"model":{"const":"darkseek-v4.1"},"messages":{"type":"array","minItems":1,"items":{"type":"object","required":["role","content"],"properties":{"role":{"enum":["system","user","assistant","tool","developer"]},"content":{"type":"string"}}}},"max_tokens":{"type":"integer","minimum":1,"maximum":384000,"default":384000,"description":"Deployment-specific ceiling; query Models and account limits. Default output policy is 384000 tokens; explicit smaller limits are preserved."},"reasoning_effort":{"enum":["none","low","high","max"],"description":"V4.1 encoder tiers: low=50, high=75, max=100; none disables thinking. Not a token-budget guarantee."},"stream":{"type":"boolean","default":false},"temperature":{"type":"number","minimum":0,"maximum":2},"n":{"const":1}}},"Usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer","minimum":0},"completion_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0}}}}}}