LLMTest

API Reference

REST API for managing flows, benchmarks, and suggestions. All endpoints require a Bearer token.

Authentication

Include your API key in the Authorization header:

Authorization: Bearer your-llmt_-key-here

Endpoints

Status & Flows

GET /api/status

Get proxy status and activity summary

Returns: { flows, calls, spend, pendingSuggestions }
GET /api/flows

List all AI flows with cost and latency stats

Returns: Array of flow objects with flow, model, calls, avg_latency_ms, total_cost_usd

Suggestions

GET /api/suggestions

Get pending model-switch recommendations

Query params: status (optional: "pending", "accepted", "dismissed")
POST /api/suggestions/:id

Accept or dismiss a suggestion

action string required
"accept" or "dismiss"

Samples

GET /api/samples

List flows with sample counts and readiness

POST /api/samples

Seed test samples for a flow

flow string required
Flow name (e.g. "support-bot")
samples array required
Array of message arrays. Each sample is an array of {role, content} objects.
// Example
{
  "flow": "support-bot",
  "samples": [
    [
      { "role": "system", "content": "You are a helpful support agent." },
      { "role": "user", "content": "I can't log in to my account." }
    ],
    [
      { "role": "system", "content": "You are a helpful support agent." },
      { "role": "user", "content": "I want a refund for my last order." }
    ]
  ]
}

Benchmarks

POST /api/benchmark

Run a benchmark on a flow (SSE stream)

flow string required
Flow name to benchmark
currentModel string optional
Baseline model (auto-detected from traffic if omitted)
optimizeFor string optional
"cost", "quality", "speed", or "balanced" (default)
challengers string[] optional
Specific model IDs to test (auto-selected if omitted)
This endpoint returns an SSE stream. Events: progress (status updates), result (final results), error (if something fails). A heartbeat comment is sent every 15 seconds to keep the connection alive.

Models

GET /api/models/trending

Get new and trending models

Account

GET /api/account

Get account info and credit balance

Returns: { email, credits_usd, total_spent, api_key, created_at }
POST /api/feedback

Submit feedback

rating integer required
1-5 rating
comment string optional
Free-text feedback
agent_model string required
Model used by the agent (e.g. "claude-sonnet-4")
agent_environment string required
IDE/tool name (e.g. "cursor", "claude-code")
task_summary string optional
Brief description of what the agent was doing