快速开始

在 30 秒内开始使用 Panda World。你只需要两样东西:一个 API 密钥和端点 URL。

基础地址: https://api.pandaworld.space/v1

1

1. 获取 API 密钥

  1. 在仪表盘注册
  2. 前往 API 密钥 → 创建密钥
  3. 复制 sk-... 密钥(关闭后不再显示)
2

2. 发起第一个请求

替换代码中的模型 ID、API 密钥和消息内容。推荐从 deepseek-v4-flash 开始,它在速度、质量和成本之间取得了最佳平衡。

cURL
curl https://api.pandaworld.space/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PANDA_API_KEY" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [
      {"role": "user", "content": "Hello! Say hello back in Chinese."}
    ]
  }'
Python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.pandaworld.space/v1",
    api_key="sk-your-key-here"
)

response = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Hello! Say hello back in Chinese."}]
)

print(response.choices[0].message.content)
# => "你好!很高兴见到你!"
Node.js
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.pandaworld.space/v1",
  apiKey: "sk-your-key-here",
});

const response = await client.chat.completions.create({
  model: "deepseek-v4-flash",
  messages: [{ role: "user", content: "Hello! Say hello back in Chinese." }],
});

console.log(response.choices[0].message.content);
// => "你好!很高兴见到你!"

Example Response

The API returns a JSON response — the model's reply is in choices[0].message.content:

JSON
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "model": "deepseek-v4-flash",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "你好!很高兴见到你!"
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 14,
    "completion_tokens": 9,
    "total_tokens": 23
  }
}

💡 Tip: You can change the model parameter to any supported model. See Models & Pricing for the full list.

3

3. 查看使用量

访问使用量仪表盘查看请求历史、Token 数量和剩余余额。

下一步