API Reference
Complete API reference for the Panda World OpenAI-compatible gateway.
Base URL: https://api.pandaworld.space/v1
Alternative endpoint: https://pandaworld.space/api/v1 (both work identically)
Chat Completions
Creates a model response for the given chat conversation.
Endpoint
POST /v1/chat/completionsRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Required | Model ID (e.g., deepseek-v4-flash), or use smart routing: "auto", "auto:cost", "auto:quality", "auto:speed" — automatically selects the best model for your request based on signal analysis |
messages | array | Required | Array of message objects ({role, content}) |
stream | boolean | Optional | Enable SSE streaming (default: false) |
max_tokens | integer | Optional | Maximum tokens in the response |
temperature | number | Optional | Sampling temperature (0-2, default: 1.0) |
top_p | number | Optional | Nucleus sampling parameter (0-1, default: 1.0) |
Example Request
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?"}
],
"temperature": 0.7,
"max_tokens": 200
}'Example Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1700000000,
"model": "deepseek-v4-flash",
"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.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 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 Request
curl https://api.pandaworld.space/v1/models \
-H "Authorization: Bearer $PANDA_API_KEY"User Balance
Check your current balance.
Endpoint
GET /v1/dashboard/billingExample Request
curl https://api.pandaworld.space/v1/dashboard/billing \
-H "Authorization: Bearer $PANDA_API_KEY"Example Response
{
"balance": 42.50,
"currency": "usd",
"total_spent": 157.30
}Image Generation
Generate images using text prompts with dedicated image generation models.
Endpoint
POST /v1/images/generationsRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Required | Model ID (e.g., wan-2.7-image, kolors) |
prompt | string | Required | Text description of the desired image |
n | integer | Optional | Number of images to generate (1-10, default: 1) |
size | string | Optional | Image size (e.g., "1024x1024"). Supported sizes depend on the model. |
Example Request
curl https://api.pandaworld.space/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $PANDA_API_KEY" \
-d {
"model": "wan-2.7-image",
"prompt": "A cute cat sitting on a window sill, digital art",
"n": 1,
"size": "1024x1024"
}Example Response
The response contains the generated image(s) as URLs in the data array.
{
"created": 1700000000,
"data": [
{
"url": "https://...",
"revised_prompt": "..."
}
]
}Video Generation
Generate videos from text or image prompts. Video generation is supported through the chat completions endpoint using dedicated video models. Streaming is not supported for video models — set stream to false.
Endpoint
POST /v1/chat/completionsRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Required | Model ID (e.g., wan-2.7-video) |
messages | array | Required | Array of message objects. Use a user message with your text prompt. For image-to-video, include an image URL in the message content. |
stream | boolean | Optional | Must be false for video models |
Example Request
curl https://api.pandaworld.space/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $PANDA_API_KEY" \
-d {
"model": "wan-2.7-video",
"messages": [
{"role": "user", "content": "A cinematic drone shot of a futuristic city at sunset, neon lights"}
],
"stream": false
}Note: Video generation is an asynchronous process. The API returns a completion response once the video is ready. Generation times vary by model and complexity (typically 30 seconds to several minutes).
OpenAI Compatibility
Supported endpoints (all match OpenAI's interface):
POST /v1/chat/completionsPOST /v1/completions(legacy)POST /v1/images/generationsGET /v1/modelsGET /v1/models/:id
Unsupported: /v1/embeddings, /v1/audio, /v1/fine_tuning, /v1/moderations.