API Reference

Playground

Interactive, one-off prompt runs — separate from the Evaluations run history.

GET/api/playground/run

List past playground runs, newest first.

{
  "runs": [
    {
      "id": "play_0001",
      "model": "gpt-4o",
      "temperature": 0.7,
      "maxTokens": 512,
      "prompt": "Explain what a vector database is in two sentences.",
      "output": "Based on the available context, here's a concise answer...",
      "latencyMs": 842,
      "createdAt": "2026-07-16T22:25:00.000Z"
    }
  ]
}
POST/api/playground/run

Run a prompt and get a completion back.

Body fieldTypeRequired
promptstringyes
modelstringno — defaults to "gpt-4o"
temperaturenumberno — defaults to 0.7
maxTokensnumberno — defaults to 512
curl -X POST https://preview.devx-ai.xyz/api/playground/run \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "Summarize the benefits of RAG in one sentence.", "temperature": 0.9 }'

Returns 201 with { run }. 400 if prompt is empty.

Simulated latency, simulated output
The response includes a randomized latencyMs (300–1800ms) and the server actually sleeps for part of it, so it feels like a real network round-trip. The completion text itself is templated, not model-generated — see Playground concepts for why.

Data model

FieldTypeNotes
temperaturenumber0–1, echoed back but only mildly affects the canned output
latencyMsnumberRandomized per run, not measured from a real call