Quick Start: Your First Call

This page walks you through your first API call from scratch. The examples use the model deepseek-v4-flash (default group, pay-as-you-go, ¥1 input / ¥2 output per million tokens — one of the most economical chat models on this site).

Prerequisites

Before you start, make sure these three are ready:

  1. A registered account — if you don't have one yet, see Sign Up & Sign In
  2. Balance topped up — calls fail when the balance is insufficient; see Billing & Top-up
  3. An API Key created — you need a token starting with sk-; see API Key Management

Making the Call

The three examples below are logically identical: they ask deepseek-v4-flash "Who are you? Introduce yourself in one sentence." Pick your language and run it.

cURL
Python (openai)
Node.js (openai)
curl https://api-model.shuntianchuang.cn/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-your-token" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [
      { "role": "user", "content": "Who are you? Introduce yourself in one sentence." }
    ]
  }'
NOTE

This site is OpenAI-SDK compatible. With the official SDKs, just set base_url to https://api-model.shuntianchuang.cn/v1 and api_key to your token — no other code changes needed.

Expected Response

On success, a standard OpenAI-format JSON is returned:

{
  "id": "chatcmpl-xxxxxxxx",
  "object": "chat.completion",
  "created": 1760000000,
  "model": "deepseek-v4-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "I am an AI assistant..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 30,
    "total_tokens": 42
  }
}

Here choices[0].message.content is the model's answer, and usage is the token consumption of this call (the billing basis).

Common First-Call Failures

SymptomCauseFix
401 UnauthorizedWrong token, stray whitespace, or missing Authorization headerDouble-check the token and retry; see API Key Management
"insufficient quota"Account balance is 0 or the token's quota is used upTop up first, or check the token's quota settings
model not foundMisspelled model name, or the model isn't in your groupCopy the exact model name from the model plaza
Connection timeoutNetwork restrictionsCheck your local network or proxy settings

See Error Codes & Troubleshooting for the full error reference.

Next Steps