miMiMo-V2.6-FlashDDeepSeek-V4.1-FlashZGLM-5.3-FlashQQwen3.8-FlashmiMiMo-V2.6-ProLimited-Time Discount
miMiMo-V2.6-FlashDDeepSeek-V4.1-FlashZGLM-5.3-FlashQQwen3.8-FlashmiMiMo-V2.6-ProLimited-Time Discount
miMiMo-V2.6-FlashDDeepSeek-V4.1-FlashZGLM-5.3-FlashQQwen3.8-FlashmiMiMo-V2.6-ProLimited-Time Discount

Chat Completions API

DeepNexus exposes an OpenAI-compatible API. Any SDK or tool that supports a custom OpenAI base URL works unchanged.

ItemValue
Base URLhttp://localhost:3000/v1
ProtocolOpenAI Chat Completions
Formatapplication/json, UTF-8
StreamingServer-Sent Events (text/event-stream)

Authentication

Create a key on the API page and send it in either header:

Authorization: Bearer sk-dn-...
x-api-key: sk-dn-...

Endpoints

MethodPathDescription
GET/modelsList models with pricing, context window and capabilities
GET/balanceBalance and plan of the account that owns the key
POST/chat/completionsChat completion, streaming or non-streaming

Create a chat completion

POST http://localhost:3000/v1/chat/completions

FieldTypeDescription
modelstringModel ID from Language Models, or auto
messagesarrayConversation messages: system, user, assistant, tool
streambooleanStream tokens as SSE. Default false
temperaturenumberSampling temperature, 0 – 2
top_pnumberNucleus sampling
max_tokensintegerMaximum output tokens
tools / tool_choicearray / stringFunction calling, on models that support it
response_formatobject{"type": "json_object"} for JSON mode

Other OpenAI parameters are forwarded to the upstream model as-is.

Example

curl http://localhost:3000/v1/chat/completions \
  -H "Authorization: Bearer $DEEPNEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [
      {"role": "system", "content": "You are a concise assistant."},
      {"role": "user", "content": "What is x402?"}
    ],
    "stream": true
  }'

Response

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "deepseek-v4.1-flash",
  "choices": [{ "index": 0, "message": { "role": "assistant", "content": "..." }, "finish_reason": "stop" }],
  "usage": { "prompt_tokens": 24, "completion_tokens": 85, "total_tokens": 109 }
}

When model is auto, the model field of the response shows the model that actually served the request.

Streaming

Each event is a chat.completion.chunk with a delta. The stream ends with data: [DONE].

data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"x402 is"}}]}

data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":" an open"}}]}

data: [DONE]

Images

Models with vision support accept OpenAI-style image parts:

{
  "role": "user",
  "content": [
    { "type": "text", "text": "What is in this picture?" },
    { "type": "image_url", "image_url": { "url": "data:image/png;base64,..." } }
  ]
}

List models

curl http://localhost:3000/v1/models -H "Authorization: Bearer $DEEPNEXUS_API_KEY"

Errors

Errors use the OpenAI error shape: {"error": {"message": "..."}}. Upstream errors are passed through with their original status.

StatusMeaning
400Invalid request or unknown model
401Missing or invalid API key
402Insufficient balance — top up
5xxUpstream provider error — safe to retry with backoff
Chat Completions API · DeepNexus