Playground
Overview
The Playground is an interactive testing environment within the Wuliang AI console that lets you experiment with API endpoints without writing code. You can select models, configure request parameters, send requests, and view structured responses in real time. It is an essential tool for prototyping prompts, validating model behavior, and debugging API integrations.
Prerequisites
- A registered Wuliang AI account
- At least one active API Key. See Manage API Keys for instructions on creating a key.
- Your account has a positive balance
Access the Playground
In the console sidebar, navigate to Development > Playground.
The Playground interface loads with a clean request builder.
Select an API Interface
The left panel displays a grouped list of available API interfaces. These correspond to the endpoints documented in the API Reference.
Browse the interface groups (e.g., Chat Completions, Images Generations, Embeddings).
Click an interface to select it as the active endpoint for testing.
The request builder updates to show the parameters relevant to the selected interface.
Configure Request Parameters
Select a Model
Click the Model dropdown.
Choose a model from the list. Only models that support the selected interface are shown.
Select an API Key and Application
Click the API Key dropdown to select an active key.
The associated application is automatically selected based on the key.
TIP
Only active API Keys are shown in the dropdown. If you don't see your key, verify that it is enabled and belongs to an active application.
Build the Request Body
Depending on the selected interface, the request builder presents relevant input fields:
| Parameter | Description |
|---|---|
| Messages | Add system, user, and assistant messages for chat-based endpoints |
| Prompt | Text prompt for image generation and embedding endpoints |
| Temperature | Controls randomness (0-2, default 1) |
| Max Tokens | Maximum tokens to generate in the response |
| Top P | Nucleus sampling threshold (0-1, default 1) |
| Stream | Toggle streaming response mode |
Fill in the required parameters for your test.
Adjust optional parameters to fine-tune the request.
Send a Request
Click the Send button to execute the request.
The response appears in the output panel on the right.
View Structured Response
The response panel displays the API response in a structured format:
- Status - HTTP status code and success indicator
- Content - The generated text or result
- Usage - Token consumption (input, output, total)
- Latency - Response time in milliseconds
- Model - The model that processed the request
- Finish Reason - Why generation stopped (stop, length, etc.)
Streaming Mode
When streaming is enabled, the response panel shows tokens as they are generated in real time, simulating the experience of a streaming API call.
View Code Examples
After sending a request, you can view equivalent code snippets for direct integration:
Click the Code tab or button in the response area.
Browse code examples in multiple languages (Python, Node.js, cURL).
Copy the code snippet to use in your application.
Call History
The Playground maintains a history of your previous requests within the current session.
Click the History panel or tab.
Browse previous requests with their parameters and responses.
Click any history entry to reload its parameters into the request builder.
Prompt Optimization
The Playground includes a prompt optimization feature that helps you improve your prompts for better results.
Enter your initial prompt in the request builder.
Click the Optimize button.
Review the optimized prompt suggestion and apply it if desired.
Notes
- Playground requests count toward your account usage and billing just like regular API calls.
- The Playground uses your selected API Key for authentication, so all rate limits and budget restrictions apply.
- Call history is stored locally in your browser and is not persisted across sessions or devices.
- For production use, always transition from Playground testing to proper SDK integration.
Related Documentation
- Manage API Keys - Create and configure API Keys
- Make API Calls - Comprehensive guide to calling the API
- Models & Pricing - Browse available models and pricing
- API Docs Browser - Browse complete API documentation