Vantage RuntimeAI · Adopt

RuntimeAI v1 API

HTTP API for agent evaluations: quote cost and readiness, submit parallel sim runs (up to five models), and poll for scorecards. The playground uses 12 turns per run by default. All routes live under /api/runtimeai/v1.

Trial sandbox

Try the API

Run the quote → submit → poll flow in your browser. Paste your rai_live_… key (request one if needed). Step 1 needs no key. When results appear, use Download JSON and Download PDF in the results table.

Saved in this browser only (localStorage).

GET 1. Health No API key

          
GET 2. List scenarios

          
GET 3. Estimate cost

Select up to 5 models, then estimate cost for the scenario.


          
POST 4. Run evaluation Starts real LLM run

Complete step 3 to review models and estimated cost.


            
            
            

          

Reference

Base URL

EnvironmentBase URL
Production https://www.vantageai.cc/api/runtimeai/v1

Workflow

1. QUOTE POST /evaluations/quote → quote_id + cost estimates (15 min TTL) 2. SUBMIT POST /evaluations → evaluation_id + run ids (202 Accepted) 3. POLL GET /evaluations/{id} → repeat every 3–5 s until not "running" 4. RESULTS scores + download links in the poll response (JSON ?download=1, PDF)

You must quote before submit. Each quote_id is one-time use. The quote_id comes from the quote response — not generated client-side. Use your personal rai_live_… key as TOKEN below (request one via Request API key). Operators may use RUNTIMEAI_API_TOKEN instead.

Authentication

All routes except GET /health and the key-request endpoints require a Bearer token.

Get a key (recommended)

Request API key by email

  1. Open /runtimeai/api/request-key and enter your email.
  2. Click the confirmation link in your inbox (valid 48 hours).
  3. Receive your personal rai_live_… key by email — one key per email address.
Authorization: Bearer rai_live_…

Missing or invalid tokens return 401 with code UNAUTHORIZED.

Operator key management

Master RUNTIMEAI_API_TOKEN works on all routes and is required to manually create or revoke keys in the operator UI.

MethodHow
Self-serve (customers) /runtimeai/api/request-key — email confirm → key emailed
Web UI (operators) /runtimeai/api/keys — master token, label, copy key once
CLI (Render shell) python -m runtimeai_api.keys_cli create --label "Customer"
API POST /api/runtimeai/v1/admin/api-keys with master Bearer token

Error envelope

{
  "error": "Human-readable message",
  "code": "QUOTE_EXPIRED",
  "details": {}
}

Endpoints

GET/health

Unauthenticated smoke check. Returns ok, product, version, api_path.

GET/scenarios/catalog

Public scenario metadata (no auth) — same fields as /scenarios. Used by the docs playground and landing UI.

GET/scenarios

Lists RuntimeAI public catalog scenarios (id, title, roles, default_persona). Routing scenarios are runnable by id but omitted from the public list; numbers start at 1 for visible scenarios.

GET/models

Lists trial sample models made available as part of your trial for a scenario. Pick up to five for a parallel comparison quote.

POST/evaluations/quote

Check readiness and cost before submit. Returns quote_id (15-minute TTL), per-model ready / unavailable status, and summary.est_cost_usd_total. In the docs playground, step 4 quotes automatically when you click Run.

{
  "scenario_id": "support_escalation_v1",
  "models": ["openai/gpt-4o-mini"],
  "turns": 12,
  "provider": "openrouter",
  "preflight": false
}

models: 1–5 unique ids from GET /models. turns: 1–24 (playground default 12). preflight: optional probe (slower).

POST/evaluations202

Submit after quote. confirm must be true. Starts parallel agent runs. Returns evaluation_id, runs[], poll_url, and quoted cost. Optional results_email sends a summary when the evaluation finishes (no need to keep polling).

{
  "quote_id": "qt_…",
  "confirm": true,
  "callback_url": null,
  "results_email": "you@example.com"
}

GET/evaluations/{evaluation_id}

Poll every 3–5 seconds. Aggregate status: running, completed, partial, or failed. When ended, each run includes score and links.scorecard (JSON file download) and links.pdf (PDF download). With 2+ models, top-level links.comparison and links.comparison_pdf point to the consolidated batch report. In the playground above, use Download JSON / Download PDF after polling — those buttons use your browser session automatically.

GET/evaluations/{evaluation_id}/comparison

Bearer-authenticated JSON comparison (best for curl, Python, and Postman). Same payload as the batch comparison report. Available when aggregate status is not running and the evaluation has 2+ models.

GET/evaluations/{evaluation_id}/comparison.pdf

Bearer-authenticated PDF comparison download. Returns application/pdf with an attachment filename.

GET/api/run/{session_id}/scorecard

Per-run scorecard JSON (browser or script). Add ?download=1 to receive a .json file (Content-Disposition: attachment). Without download=1, returns JSON when the client sends Accept: application/json. Requires the same browser viewer session as the playground (fd_viewer_runtimeai cookie) or a signed-in RuntimeAI profile — not the API Bearer token.

GET/api/run/{session_id}/scorecard.pdf

Per-run scorecard PDF (score breakdown + transcript). Use from the same browser session as the evaluation, or download via the playground Download PDF button.

GET/api/run/batch/{evaluation_id}/comparison

Side-by-side JSON comparison at the site root (not under /api/runtimeai/v1). Add ?download=1 for a .json file download. Lists each model with scores, dimensions, and per-model report links. Requires the same browser viewer session as the playground — use GET /evaluations/{id}/comparison with Bearer auth for scripts instead.

GET/api/run/batch/{evaluation_id}/comparison.pdf

Batch comparison PDF (summary table + dimension breakdown). Same browser-session rules as individual scorecard PDFs. For automation, prefer GET /evaluations/{id}/comparison.pdf with Bearer auth.

Quick start — curl

Set your base URL and token once (rai_live_… customer key or operator RUNTIMEAI_API_TOKEN):

export BASE='https://www.vantageai.cc/api/runtimeai/v1'
export TOKEN='rai_live_your_key_here'
curl -sS "$BASE/health" | python3 -m json.tool

Full quote → submit → poll (curl)

# 1. Quote
curl -sS -X POST "$BASE/evaluations/quote" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "scenario_id": "support_escalation_v1",
    "models": ["openai/gpt-4o-mini"],
    "turns": 12,
    "provider": "openrouter",
    "preflight": false
  }' | python3 -m json.tool

export QUOTE_ID='qt_from_response'

# 2. Submit (starts real LLM run — uses OpenRouter credits)
curl -sS -X POST "$BASE/evaluations" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"quote_id\":\"$QUOTE_ID\",\"confirm\":true}" | python3 -m json.tool

export EVAL_ID='evaluation_id_from_response'

# 3. Poll until status ≠ running
while true; do
  curl -sS "$BASE/evaluations/$EVAL_ID" \
    -H "Authorization: Bearer $TOKEN" | python3 -m json.tool
  sleep 5
done

# 4. Download reports (Bearer auth — works from curl/scripts)
curl -sS -o "comparison.json" \
  -H "Authorization: Bearer $TOKEN" \
  "$BASE/evaluations/$EVAL_ID/comparison"

curl -sS -o "runtimeai-comparison.pdf" \
  -H "Authorization: Bearer $TOKEN" \
  "$BASE/evaluations/$EVAL_ID/comparison.pdf"

# Per-run scorecard from poll response runs[].links (example RUN_ID)
curl -sS -o "scorecard.json" \
  -H "Accept: application/json" \
  "https://www.vantageai.cc/api/run/RUN_ID/scorecard?download=1"

curl -sS -o "scorecard.pdf" \
  "https://www.vantageai.cc/api/run/RUN_ID/scorecard.pdf"

Python example

Requires requests. Submit uses real OpenRouter credits when the server has OPENROUTER_API_KEY set.

import os
import time
import json
import requests
from pathlib import Path

BASE = os.environ.get(
    "RUNTIMEAI_API_BASE",
    "https://www.vantageai.cc/api/runtimeai/v1",
)
TOKEN = os.environ["RUNTIMEAI_API_TOKEN"]  # or rai_live_… customer key

def api(method: str, path: str, **kwargs):
    headers = {"Authorization": f"Bearer {TOKEN}"}
    if kwargs.get("json") is not None:
        headers["Content-Type"] = "application/json"
    url = f"{BASE}{path}"
    resp = requests.request(method, url, headers=headers, timeout=120, **kwargs)
    resp.raise_for_status()
    return resp.json()

# Smoke (no auth)
print(requests.get(f"{BASE}/health", timeout=30).json())

scenarios = api("GET", "/scenarios")
print("scenarios:", [s["id"] for s in scenarios["scenarios"]])

quote = api(
    "POST",
    "/evaluations/quote",
    json={
        "scenario_id": "support_escalation_v1",
        "models": ["openai/gpt-4o-mini"],
        "turns": 12,
        "provider": "openrouter",
        "preflight": False,
    },
)
quote_id = quote["quote_id"]
print("quote_id:", quote_id, "est_total:", quote["summary"]["est_cost_usd_total"])

submit = api(
    "POST",
    "/evaluations",
    json={"quote_id": quote_id, "confirm": True},
)
eval_id = submit["evaluation_id"]
print("evaluation_id:", eval_id)

while True:
    status = api("GET", f"/evaluations/{eval_id}")
    print("status:", status["status"], status.get("progress"))
    if status["status"] != "running":
        for run in status.get("runs", []):
            if run.get("links"):
                print("scorecard json:", run["links"].get("scorecard"))
                print("scorecard pdf:", run["links"].get("pdf"))
        if status.get("links"):
            print("comparison json:", status["links"].get("comparison"))
            print("comparison pdf:", status["links"].get("comparison_pdf"))
        break
    time.sleep(5)

# Download comparison reports with Bearer auth
cmp = requests.get(
    f"{BASE}/evaluations/{eval_id}/comparison",
    headers={"Authorization": f"Bearer {TOKEN}"},
    timeout=120,
)
cmp.raise_for_status()
Path("comparison.json").write_text(json.dumps(cmp.json(), indent=2), encoding="utf-8")

pdf = requests.get(
    f"{BASE}/evaluations/{eval_id}/comparison.pdf",
    headers={"Authorization": f"Bearer {TOKEN}"},
    timeout=120,
)
pdf.raise_for_status()
Path("runtimeai-comparison.pdf").write_bytes(pdf.content)

Postman

Download RuntimeAI-v1.postman_collection.json

Setup

  1. Open Postman → ImportFile → select the collection JSON (or use the download link above).
  2. Create environment RuntimeAI Production with variables:
VariableValueNotes
baseUrlhttps://www.vantageai.cc/api/runtimeai/v1No trailing slash
tokenYour RUNTIMEAI_API_TOKENMark as secret
quote_id(empty)Auto-filled by collection script after quote
evaluation_id(empty)Auto-filled after submit

Run in order

StepRequestAuthExpected
101 HealthNone200, ok: true
202 List scenariosBearer {{token}}Scenario list
303 Quote evaluationBearer200, quote_id (playground step 4 quotes on Run)
404 Submit evaluationBearer202, evaluation_id
505 Poll evaluation statusBearerRepeat until not running

Collection-level Bearer auth uses {{token}} — set it once in the environment. Typical completion time: 3–10 minutes for one model at 12 turns.

Postman troubleshooting

SymptomFix
401 Unauthorizedtoken must match server RUNTIMEAI_API_TOKEN exactly
404 on healthCheck RUNTIMEAI_API_ENABLED=1 and redeploy
410 Quote expiredQuote older than 15 min — run quote again
422 Quote consumedQuote already submitted — run quote again
403 on scorecard PDF/JSONUse playground Download buttons (browser session), Bearer /evaluations/{id}/comparison, or sign in on RuntimeAI before opening /api/run/… links
400 on submitBody must include "confirm": true

Error codes

HTTPcodeMeaning
400INVALID_REQUESTBad body, missing confirm, invalid scenario
401UNAUTHORIZEDMissing or wrong Bearer token
404NOT_FOUNDUnknown quote or evaluation id
409INVALID_REQUESTModels changed since quote
410QUOTE_EXPIREDQuote older than 15 minutes
422QUOTE_CONSUMEDQuote already used for submit
503PROVIDER_UNAVAILABLEMissing OpenRouter key or server issue

Related