Playground
Interactive prompt testing with real-time streaming, multi-model comparison, and run history.
Enterprise feature
Overview
The Playground lets you test prompts against any configured provider directly through Ingate. It supports real-time SSE streaming, side-by-side model comparison, parameter tuning, and automatic run history persistence.
Run a Prompt
/api/v1/playground/runExecute a prompt. Supports streaming via SSE. Requires member role.
curl -X POST https://api.ingateai.com/api/v1/playground/run \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"provider": "openai",
"model": "gpt-4o-mini",
"prompt_text": "Explain quantum computing in one sentence.",
"parameters": {"temperature": 0.7, "max_tokens": 100},
"stream": false
}'Streaming Mode
Set stream: true to receive SSE (Server-Sent Events) chunks in real time. The response streams data: events for each token, an event: done when complete, and event: error on failure.
Prompt from Registry
You can reference a prompt from the registry by ID and provide variables:
{
"provider": "openai",
"model": "gpt-4o",
"prompt_id": "billing/invoice-parser",
"variables": {"invoice_text": "Order #1234\nTotal: $99.00"},
"stream": true
}Compare Models
/api/v1/playground/compareRun the same prompt against 2–3 targets simultaneously with multiplexed SSE.
curl -X POST https://api.ingateai.com/api/v1/playground/compare \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"prompt_text": "Explain quantum computing in one sentence.",
"targets": [
{"provider": "openai", "model": "gpt-4o"},
{"provider": "anthropic", "model": "claude-3-5-sonnet-20241022"},
{"provider": "openai", "model": "gpt-4o-mini"}
],
"parameters": {"temperature": 0.7}
}'The SSE stream uses indexed events so you can tell which target each chunk belongs to:
event: chunk:0
data: {"index": 0, "content": "Quantum computing"}
event: chunk:1
data: {"index": 1, "content": "Quantum computing uses"}
event: done:0
data: {"index": 0, "done": true, "stats": {"tokens_in": 12, "tokens_out": 25, "latency_ms": 890}}
event: done:1
data: {"index": 1, "done": true, "stats": {"tokens_in": 12, "tokens_out": 30, "latency_ms": 1200}}Run History
/api/v1/playground/historyPaginated list of previous playground runs.
Every playground execution is automatically saved with prompt text, response, token counts, cost, and latency. Use limit and offset for pagination.
Save as Prompt Version
/api/v1/playground/save-versionSave a playground result as a new prompt version in the registry.
{
"namespace": "support",
"slug": "greeting",
"content": "You are a helpful support agent. Greet the user warmly."
}Available Providers
/api/v1/playground/providersList providers available for playground use.
Iterate fast