API Reference: Records

Endpoints for creating and retrieving decision records.

Base URL

Base URL: https://api.xase.ai/v1

Authentication

Authorization: Bearer xase_pk_...
# or
X-API-Key: xase_pk_...
All requests must include an API key. We recommend using the Authorization header.

Create Record — POST /records

Field            Type      Required  Description
model_id         string    Yes       Identifier of the model that made the decision
input            object    Yes       Input data sent to the model
output           object    Yes       Model's output/decision
confidence       number    No        Confidence score (0-1)
transaction_id   string    No        Your internal reference ID
policy_id        string    No        Business policy applied
context          object    No        Additional metadata
explanation      object    No        XAI data (SHAP values, etc.)
curl -X POST https://api.xase.ai/v1/records   -H "Authorization: Bearer xase_pk_..."   -H "Content-Type: application/json"   -d '{
    "model_id": "credit-model-v2",
    "input": {"customer_id": "cust_123", "income": 85000},
    "output": {"decision": "APPROVED", "credit_limit": 25000},
    "confidence": 0.94,
    "transaction_id": "txn_abc123"
  }'

Response

{
  "id": "rec_8a7f3b2c4d5e6f7a",
  "model_id": "credit-model-v2",
  "input": { "customer_id": "cust_123", "income": 85000 },
  "output": { "decision": "APPROVED", "credit_limit": 25000 },
  "confidence": 0.94,
  "transaction_id": "txn_abc123",
  "hash": "sha256:9f86d081884c...",
  "previous_hash": "sha256:abc123...",
  "created_at": "2025-01-15T14:32:00.000Z",
  "interventions": []
}

Get Record — GET /records/{id}

curl -X GET https://api.xase.ai/v1/records/rec_8a7f3b2c   -H "Authorization: Bearer xase_pk_..."

Response

{
  "id": "rec_8a7f3b2c4d5e6f7a",
  "model_id": "credit-model-v2",
  "input": { "customer_id": "cust_123", "income": 85000 },
  "output": { "decision": "APPROVED", "credit_limit": 25000 },
  "confidence": 0.94,
  "transaction_id": "txn_abc123",
  "hash": "sha256:9f86d081884c...",
  "previous_hash": "sha256:abc123...",
  "created_at": "2025-01-15T14:32:00.000Z",
  "interventions": []
}

List Records — GET /records

curl -G https://api.xase.ai/v1/records   -H "Authorization: Bearer xase_pk_..."   --data-urlencode "model_id=credit-model-v2"   --data-urlencode "start_date=2025-01-01"   --data-urlencode "end_date=2025-01-31"   --data-urlencode "has_intervention=true"   --data-urlencode "limit=20"   --data-urlencode "offset=0"

Response

{
  "data": [ {"id": "rec_...", "output": {"decision": "APPROVED"}} ],
  "total": 1234,
  "limit": 20,
  "offset": 0
}

Errors

{
  "error": {
    "code": "validation_error",
    "message": "Invalid request body",
    "details": [{ "field": "model_id", "message": "Required field missing" }]
  }
}