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/completionsRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID (e.g., deepseek-chat) |
messages | array | Yes | Array of message objects ({role, content}) |
stream | boolean | No | Enable SSE streaming (default: false) |
max_tokens | integer | No | Maximum tokens in the response |
temperature | number | No | Sampling temperature (0-2, default: 1.0) |
top_p | number | No | Nucleus 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/modelsExample
curl https://api.relay-station.com/v1/models \
-H "Authorization: Bearer $RELAY_API_KEY"User Balance
Check your current balance.
Endpoint
GET /v1/dashboard/billingExample
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/completionsPOST /v1/completions(legacy)GET /v1/modelsGET /v1/models/:id
Unsupported: /v1/embeddings, /v1/images, /v1/audio, /v1/fine_tuning, /v1/moderations.