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

cURL
POST /v1/chat/completions

Request Body

ParameterTypeRequiredDescription
modelstringRequiredModel 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
messagesarrayRequiredArray of message objects ({role, content})
streambooleanOptionalEnable SSE streaming (default: false)
max_tokensintegerOptionalMaximum tokens in the response
temperaturenumberOptionalSampling temperature (0-2, default: 1.0)
top_pnumberOptionalNucleus sampling parameter (0-1, default: 1.0)

Example Request

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?"}
    ],
    "temperature": 0.7,
    "max_tokens": 200
  }'

Example Response

JSON
{
  "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
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:

cURL
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

cURL
GET /v1/models

Example Request

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

User Balance

Check your current balance.

Endpoint

cURL
GET /v1/dashboard/billing

Example Request

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

Example Response

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

Image Generation

Generate images using text prompts with dedicated image generation models.

Endpoint

cURL
POST /v1/images/generations

Request Body

ParameterTypeRequiredDescription
modelstringRequiredModel ID (e.g., wan-2.7-image, kolors)
promptstringRequiredText description of the desired image
nintegerOptionalNumber of images to generate (1-10, default: 1)
sizestringOptionalImage size (e.g., "1024x1024"). Supported sizes depend on the model.

Example Request

cURL
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.

JSON
{
  "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

cURL
POST /v1/chat/completions

Request Body

ParameterTypeRequiredDescription
modelstringRequiredModel ID (e.g., wan-2.7-video)
messagesarrayRequiredArray of message objects. Use a user message with your text prompt. For image-to-video, include an image URL in the message content.
streambooleanOptionalMust be false for video models

Example Request

cURL
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/completions
  • POST /v1/completions (legacy)
  • POST /v1/images/generations
  • GET /v1/models
  • GET /v1/models/:id

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