Skip to content
POST/api/v1/demo-eval

Run a demo eval

Runs a fixed 10-case demo evaluation entirely in-process — no model is called; each case ships a canned output and only deterministic built-in scorers (contains, exact-match, json-valid, is-sql, is-html, word-count, length-check, levenshtein, regex-match, starts-with) are executed, and the run is recorded as model 'local-deterministic'. Requires an authenticated session (API keys are not accepted); rate-limited to 5/min per user. Needs a projectId from the body, ?projectId, or the caller's current project — 400 NO_PROJECT otherwise — and the caller must be a member of that project's org (403 otherwise). Persists an eval_runs row plus its eval_cases via the service-role client and returns the full run inline. Powers the in-app try-it-now demo.

Authentication

Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.

Response

200 example

{
  "success": true
}

All status codes

200Demo result.
400Bad Request — NO_PROJECT.
401Unauthorized.
403Forbidden — FORBIDDEN.
404Not Found — PROJECT_NOT_FOUND.
429Too Many Requests — RATE_LIMIT_EXCEEDED.
500Internal Server Error.

Code samples

cURL

curl -X POST \
  https://evalguard.ai/api/v1/demo-eval \
  -H "Authorization: Bearer $EVALGUARD_API_KEY"

TypeScript

// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:

const res = await fetch("https://evalguard.ai/api/v1/demo-eval", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}` },
});
console.log(res.status, await res.json());

Python

# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:

import os
import requests

headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}

response = requests.request("POST", "https://evalguard.ai/api/v1/demo-eval", headers=headers)
print(response.status_code, response.json())

Go

package main

import (
	"context"
	"fmt"
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequestWithContext(context.Background(), "POST", "https://evalguard.ai/api/v1/demo-eval", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
	resp, err := http.DefaultClient.Do(req)
	if err != nil { panic(err) }
	defer resp.Body.Close()
	fmt.Println(resp.Status)
}

Errors

400401403404429500

Other Evals endpoints