Skip to main content

Developer Integration Guide – TRACE Metrics API

You ship metrics — we return a Responsible-AI score and PDF/JSON report, aligned to NIST pillars and industry risk thresholds.

Updated yesterday

Evaluate your ML or LLM models in one step

Submit a single JSON or CSV payload with your metrics — get back a Responsible-AI score and audit-ready PDF/JSON report aligned with NIST pillars and industry thresholds.

Overview

  • Input: One evaluation JSON envelope (or batch/CSV)

  • Platform actions:

    1. Validates structure and metadata

    2. Infers risk pillar (e.g. fairness, safety)

    3. Applies thresholds by use-case and industry

    4. Returns audit-ready report

Base URL

https://api.cognitiveview.com

How to get your subscription key

To use the TRACE Metrics API, you need a subscription key:

  1. Sign in to CognitiveView

  2. Go to System Settings in the main menu

  3. Find the section labeled API Access or Subscription Key

    • If you already have a key, copy it

    • If not, click Generate Key to create one

  4. Copy and store this key securely

    • Use it in the Authorization header of all API requests

⚠️ Never share or commit your subscription key to public repositories.


Authentication

Add your subscription key as a Bearer token in the Authorization header:

Ocp-Apim-Subscription-Key: your-subscription-key

Content-Type

  • application/json — for JSON submissions

  • multipart/form-data — when uploading CSV files

Endpoint

Method

Endpoint

Purpose

POST

/metrics

Submit metrics and receive Responsible-AI evaluation

Upload via curl

curl -H "Ocp-Apim-Subscription-Key: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-X POST https://api.cognitiveview.com/metrics \
-d @cer.json

Submission Envelope (Minimal JSON)

payload={
"metric_metadata": {
"application_name": "chat-application",
"version": "1.0.0",
"provider": "deepeval",
"use_case": "transportation"
},
"metric_data": {
"deepeval": {
"AnswerRelevancyMetric": 85,
"ContextualPrecisionMetric": 92,
"ContextualRecallMetric": 78,
"ContextualRelevancyMetric": 88,
"ConversationCompletenessMetric": 95,
"ConversationRelevancyMetric": 82
}
}

Response:

Status

Meaning

Example

201 Created

Metrics ingested & report generated

json { "message": "Evaluation in progress.", "report_id": "abc123" }

400 Bad Request

Invalid data format

json { "error": "Invalid Request", "message": "The provided data format is invalid", "code": "INVALID_FORMAT", "timestamp": "2024-01-15T10:30:00Z" }

401 Unauthorized

Missing or invalid token

json { "error": "Unauthorized", "message": "Invalid or missing authorization token", "code": "UNAUTHORIZED", "timestamp": "2024-01-15T10:30:00Z" }

422 Unprocessable Entity

Validation error

json { "detail": [{ "loc": ["body", "metric_data", "accuracy"], "msg": "field required", "type": "value_error.missing" }] }

500 Internal Server Error

Metric ingestion failed

json { "error": "Internal Server Error", "message": "Metric ingestion failed", "code": "SERVER_ERROR", "timestamp": "2024-01-15T10:30:00Z" }

Python Client Example

import requests

# Replace this with your actual token and base URL
BASE_URL = "https://api.cognitiveview.com"
AUTH_TOKEN = "your-subscription-token"

url = f"{BASE_URL}/metrics"

headers = {
"Ocp-Apim-Subscription-Key": AUTH_TOKEN,
"Content-Type": "application/json"
}

payload = payload #see the submission envelope
response = requests.post(url, headers=headers, json=payload)

print(f"Status Code: {response.status_code}")


Additional resources
Explore example notebooks & sample code on our GitHub: see how to call the TRACE Metrics API step by step.
Questions? Reach out: support@cognitiveview.ai

Additional resources

  • Explore example notebooks & sample code on our GitHub: see how to call the TRACE Metrics API step by step.

Questions? Reach out: support@cognitiveview.ai

Did this answer your question?