Quickstart

Install the SDK, get an API key, and make your first trust evaluation in under five minutes.

Prerequisites

  • Python 3.10+ (or any HTTP client for the REST API)
  • A VeldrixAI account — sign up free (1,000 evaluations/month, no card required)

1. Install the SDK

PythonNode
pip install veldrixai
npm install @veldrixai/sdk

2. Get an API key

Create a key in the dashboard under Settings → API Keys. Keys are environment-scoped:

  • vx-live-... — production traffic, counts against your quota.
  • vx-test-... — sandbox traffic for development.
Keys are shown only once at creation. Store them in a secret manager or environment variable — never commit them to source control.

3. Your first evaluation

Send a prompt and the model's response. VeldrixAI returns a TrustResult.

PythonNode
import veldrixai

client = veldrixai.Veldrix(api_key="vx-live-...")

result = client.evaluate_sync(
    prompt="Summarize the patient's medical history.",
    response="John Smith (DOB 1985-03-12) has stage 2 hypertension.",
)

print(result.overall)         # 0.34   (0 = unsafe, 1 = safe)
print(result.verdict)         # "BLOCK"
print(result.pillar_scores)   # {"safety": 0.95, "compliance": 0.12, ...}
print(result.critical_flags)  # ["pii_detected"]
const res = await fetch("https://api.veldrixai.ca/trust/evaluate", {
  method: "POST",
  headers: {
    "Authorization": "Bearer vx-live-...",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    prompt: "Summarize the patient's medical history.",
    response: "John Smith (DOB 1985-03-12) has stage 2 hypertension.",
    model: "gpt-4o",
  }),
});
const { data } = await res.json();
console.log(data.final_score.value);   // 34.0  (0–100 over REST)
console.log(data.final_score.risk_level);

4. Reading the result

The Python SDK normalises everything to a 0–1 scale where higher is safer.

FieldTypeDescription
overallfloat 0–1Weighted aggregate trust score.
verdictstringALLOW · WARN · REVIEW · BLOCK
pillar_scoresdictPer-pillar score, e.g. {"safety": 0.95}.
critical_flagslistFlags that force a hard block (injection, PII, etc.).
request_idstringStable id; use it to look up the audit record.
latency_msintEnd-to-end evaluation latency.

5. Guard your LLM calls

For production, wrap your generation function with @guard. By default it evaluates in the background (zero added latency); set block_on_verdict to raise on dangerous output.

Python
from veldrixai import Veldrix, GuardConfig

veldrix = Veldrix(api_key="vx-live-...")

@veldrix.guard(config=GuardConfig(block_on_verdict=["BLOCK"]))
def answer(prompt: str) -> str:
    return my_llm.complete(prompt)   # raises VeldrixBlocked if the output is BLOCK
Next: learn how scores become verdicts in Core Concepts, or shape enforcement in the Policy Engine.
Was this page helpful?