Get Playground Response

Test AI responses with custom model, prompt, and settings.

Test AI responses with custom settings — override the model, system prompt, temperature, and more without changing your project's saved configuration. Each call deducts credits based on the model used.

Authorization

Your API token must have one of the following:

  • Access Role: Owner, Editor, Viewer, or Trainer (broad access), OR
  • Fine-grained Permission: Debugging module with Read enabled

How to Use

  1. Call Create Playground Session to get a session_uid
  2. Call this API with the session_uid, your query, and optional agent_setting overrides
  3. Compare responses by changing model, system_prompt, or temperature across calls
POST
/playgroundAgentResponse

Authorization

bearerToken

AuthorizationBearer <token>

API token for YourGPT Public APIs. Create tokens in Settings > API Tokens in your YourGPT dashboard.

In: header

Request Body

application/json

project_uid*string

The project UID.

session_uid*unknown

Session UID from Create Playground Session.

query*string

The user query to test. Maximum 5000 characters.

agent_setting?

Override AI agent settings for this test.

previous_chat?

Previous messages for context. Maximum 50 items.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.yourgpt.ai/chatbot/v1/playgroundAgentResponse" \  -H "Content-Type: application/json" \  -d '{    "project_uid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",    "session_uid": "your_session_uid_here",    "query": "How do I get started with your product?"  }'
{
  "type": "RXSUCCESS",
  "message": "AI reply",
  "data": {
    "session_uid": 0,
    "message": "Hello! How can I help you?",
    "response_time": 2500,
    "total_credits": 1200
  }
}
{
  "type": "RXERROR",
  "message": "string"
}
{
  "type": "RXERROR",
  "message": "string"
}
{
  "type": "RXERROR",
  "message": "string"
}

Available Models

To get the list of supported models, call the Get Supported Models API:

curl -X POST https://api.yourgpt.ai/chatbot/v1/getSupportedModels \
  -H "Content-Type: application/json" \
  -d '{}'

Use the value field from the response as agent_setting.model. If not provided, the project's saved model is used.