TrustModel SDK API

Programmatic access to AI model evaluation services

Getting Started

1. Get Your API Key

Generate an API key from your TrustModel dashboard under Keys (gear menu) or Developer → API Keys.

2. Authenticate Requests

Include your API key in the X-API-Key header:

X-API-Key: tm-{env}-{key_id}_{secret}

3. Find Your Organization ID

Your API key is bound to exactly one organization. Most SDK endpoints resolve it from the key automatically and need nothing extra, but a few surfaces — including the Agent Governance Platform's /api/v1/guardrails/* endpoints — require it explicitly via an X-Organization-ID header. Get it by calling /sdk/v1/ping/ with your API key:

curl /sdk/v1/ping/ -H "X-API-Key: YOUR_API_KEY"
# {"status": "ok", "message": "API key is valid", "organization_id": "..."}

Quick Example

Run an evaluation on a model:

curl -X POST /sdk/v1/evaluate/ \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_identifier": "gpt-4o",
    "vendor_identifier": "openai"
  }'

Get available model_identifier and vendor_identifier values from /sdk/v1/models/. Get configuration options (application types, categories, vendors) from /sdk/v1/config/.

Available Endpoints

Discovery

GET /sdk/v1/ping/

Health check - validate your API key and get your organization_id

GET /sdk/v1/config/

Get configuration options (application types, categories, vendors, defaults)

GET /sdk/v1/models/

List available AI models for evaluation

GET /sdk/v1/credits/

Check your credit balance

GET /sdk/v1/evaluation-run-templates/

List your saved evaluation templates

Evaluations

POST /sdk/v1/evaluate/

Create a new model evaluation

GET /sdk/v1/evaluations/

List your evaluations

GET /sdk/v1/evaluations/{id}/

Get evaluation details and scores

GET /sdk/v1/evaluations/{id}/status/

Check evaluation status

GET /sdk/v1/evaluations/{id}/result/

Get evaluation scores and HTML report

Custom Endpoints

POST /sdk/v1/validate-connection/

Test connection to a custom API endpoint

Batch Operations

POST /sdk/v1/batch-jobs/

Create a batch evaluation job

GET /sdk/v1/batch-jobs/

List your batch jobs

GET /sdk/v1/batch-jobs/{id}/

Get batch job details

Error Codes

View Full API Reference

Building an Agent Studio integration?

If you're integrating an agent-builder studio (CodeNow, Zapier, Agentforce, ServiceNow Studio, ...) with TrustModel's Agent Governance Platform, the SDK above is not the right surface. Use the partner-integration contract instead — lifecycle webhooks, Edge install hooks, and the deep-link / badge embed.