Skip to content

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.

Playground overview

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

  1. In the console sidebar, navigate to Development > Playground.

    Navigate to Playground

  2. The Playground interface loads with a clean request builder.

    Playground loaded

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.

  1. Browse the interface groups (e.g., Chat Completions, Images Generations, Embeddings).

    Interface group list

  2. Click an interface to select it as the active endpoint for testing.

    Select an interface

  3. The request builder updates to show the parameters relevant to the selected interface.

    Request builder updated

Configure Request Parameters

Select a Model

  1. Click the Model dropdown.

    Model dropdown

  2. Choose a model from the list. Only models that support the selected interface are shown.

    Select a model

Select an API Key and Application

  1. Click the API Key dropdown to select an active key.

    API Key dropdown

  2. The associated application is automatically selected based on the key.

    Application auto-selected

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:

ParameterDescription
MessagesAdd system, user, and assistant messages for chat-based endpoints
PromptText prompt for image generation and embedding endpoints
TemperatureControls randomness (0-2, default 1)
Max TokensMaximum tokens to generate in the response
Top PNucleus sampling threshold (0-1, default 1)
StreamToggle streaming response mode

Request parameters form

  1. Fill in the required parameters for your test.

    Fill parameters

  2. Adjust optional parameters to fine-tune the request.

    Adjust optional parameters

Send a Request

  1. Click the Send button to execute the request.

    Click send button

  2. The response appears in the output panel on the right.

    View response

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

Structured response details

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.

Streaming response

View Code Examples

After sending a request, you can view equivalent code snippets for direct integration:

  1. Click the Code tab or button in the response area.

    Click code tab

  2. Browse code examples in multiple languages (Python, Node.js, cURL).

    Code examples

  3. Copy the code snippet to use in your application.

    Copy code

Call History

The Playground maintains a history of your previous requests within the current session.

  1. Click the History panel or tab.

    Click history tab

  2. Browse previous requests with their parameters and responses.

    Call history list

  3. Click any history entry to reload its parameters into the request builder.

    Reload from history

Prompt Optimization

The Playground includes a prompt optimization feature that helps you improve your prompts for better results.

  1. Enter your initial prompt in the request builder.

    Enter initial prompt

  2. Click the Optimize button.

    Click optimize button

  3. Review the optimized prompt suggestion and apply it if desired.

    Optimized prompt result

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.