cURL Examples

Use cURL to test the API directly from your terminal. Set your API key as an environment variable for convenience:

cURL
export PANDA_API_KEY="sk-your-key-here"

Chat Completion

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": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "What is the capital of France?"}
    ]
  }'

Streaming (SSE)

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": "Count to 10."}],
    "stream": true
  }'

List Models

cURL
curl https://api.pandaworld.space/v1/models \
  -H "Authorization: Bearer $PANDA_API_KEY" | jq .

Check Balance

cURL
curl https://api.pandaworld.space/v1/dashboard/billing \
  -H "Authorization: Bearer $PANDA_API_KEY" | jq .

Quick Test with a One-liner

cURL
curl -s 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":"Say hello"}]}' \
  | jq -r '.choices[0].message.content'