API Reference

Panda World provides an OpenAI-compatible API. If you've used OpenAI before, you can start using Panda World by changing just thebase_url.

Base URL: https://api.relay-station.com/v1

Chat Completions

Creates a model response for the given chat conversation.

Endpoint

POST /v1/chat/completions

Request Body

ParameterTypeRequiredDescription
modelstringYesModel ID (e.g., deepseek-chat)
messagesarrayYesArray of message objects ({role, content})
streambooleanNoEnable SSE streaming (default: false)
max_tokensintegerNoMaximum tokens in the response
temperaturenumberNoSampling temperature (0-2, default: 1.0)
top_pnumberNoNucleus sampling parameter (0-1, default: 1.0)

Example Request

curl https://api.relay-station.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $RELAY_API_KEY" \
  -d '{
    "model": "deepseek-chat",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "What is the capital of France?"}
    ],
    "temperature": 0.7,
    "max_tokens": 200
  }'

Example Response

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1700000000,
  "model": "deepseek-chat",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The capital of France is Paris."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 20,
    "completion_tokens": 8,
    "total_tokens": 28
  }
}

Streaming (SSE)

Set stream: true to receive server-sent events. Each event is a data: {...} line with a delta:

curl https://api.relay-station.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $RELAY_API_KEY" \
  -d '{
    "model": "deepseek-chat",
    "messages": [{"role": "user", "content": "Count to 5."}],
    "stream": true
  }'

Streaming response format:

data: {"id":"...","object":"chat.completion.chunk","choices":[{"delta":{"content":"1"}}]}
data: {"id":"...","object":"chat.completion.chunk","choices":[{"delta":{"content":"2"}}]}
data: [DONE]

Models

List all available models.

Endpoint

GET /v1/models

Example

curl https://api.relay-station.com/v1/models \
  -H "Authorization: Bearer $RELAY_API_KEY"

User Balance

Check your current balance.

Endpoint

GET /v1/dashboard/billing

Example

curl https://api.relay-station.com/v1/dashboard/billing \
  -H "Authorization: Bearer $RELAY_API_KEY"

Response

{
  "balance": 42.50,
  "currency": "usd",
  "total_spent": 157.30
}

OpenAI Compatibility

Supported endpoints (all match OpenAI's interface):

  • POST /v1/chat/completions
  • POST /v1/completions (legacy)
  • GET /v1/models
  • GET /v1/models/:id

Unsupported: /v1/embeddings, /v1/images, /v1/audio, /v1/fine_tuning, /v1/moderations.