API Reference

RESTful API for programmatic access to Pulse functionality.

Authentication

All API requests require authentication using a Bearer token:

curl -X POST https://api.pulse.dev/v1/infer/fraud-detector \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": {...}}'

Get your API key from the Pulse dashboard or by running pulse auth login.

Base URL

https://api.pulse.dev

Endpoints

POST/v1/infer/{model}

Run inference on a deployed model

Request Body

{
  "input": {
    "transaction_amount": 1500.00,
    "merchant_category": "electronics"
  },
  "options": {
    "include_metadata": true
  }
}

Response

{
  "id": "inf_abc123",
  "model": "fraud-detector",
  "version": "1.0.0-def456",
  "output": {
    "is_fraud": false,
    "confidence": 0.12
  },
  "metadata": {
    "latency_ms": 45,
    "cached": false
  }
}
POST/v1/train/{model}

Trigger a training run

Request Body

{
  "snapshot": "snap_abc123",
  "options": {
    "gpu": true,
    "notify_on_complete": true
  }
}

Response

{
  "id": "run_xyz789",
  "model": "fraud-detector",
  "status": "running",
  "started_at": "2024-01-15T10:30:00Z",
  "snapshot": "snap_abc123"
}
POST/v1/snapshot/{datasource}

Create a new data snapshot

Request Body

{
  "options": {
    "force": false,
    "compression": "zstd"
  }
}

Response

{
  "id": "snap_def456",
  "datasource": "transactions-db",
  "created_at": "2024-01-15T10:30:00Z",
  "rows": 1247832,
  "size_bytes": 524288000,
  "hash": "sha256:e3b0c442..."
}
GET/v1/models/{model}/versions

List model versions

Response

{
  "model": "fraud-detector",
  "versions": [
    {
      "version": "1.0.0-def456",
      "created_at": "2024-01-15T10:30:00Z",
      "status": "deployed",
      "metrics": {
        "accuracy": 0.9847,
        "f1_score": 0.9621
      }
    },
    {
      "version": "1.0.0-abc123",
      "created_at": "2024-01-10T08:00:00Z",
      "status": "archived"
    }
  ]
}
GET/v1/lineage/{id}

Get lineage information

Response

{
  "id": "inf_abc123",
  "type": "inference",
  "model": {
    "name": "fraud-detector",
    "version": "1.0.0-def456"
  },
  "training": {
    "id": "run_xyz789",
    "snapshot": "snap_abc123",
    "started_at": "2024-01-15T02:00:00Z",
    "completed_at": "2024-01-15T02:04:32Z"
  },
  "datasource": {
    "name": "transactions-db",
    "type": "postgresql",
    "rows": 1247832
  }
}

Error Handling

All errors follow a consistent format:

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Input validation failed",
    "details": [
      {
        "field": "transaction_amount",
        "message": "must be a positive number"
      }
    ]
  }
}

Error Codes

CodeHTTP StatusDescription
VALIDATION_ERROR400Invalid input data
UNAUTHORIZED401Invalid or missing API key
NOT_FOUND404Resource not found
RATE_LIMITED429Too many requests
INTERNAL_ERROR500Internal server error

Rate Limits

API requests are rate limited based on your plan:

PlanRequests/minBurst
Free6010
Pro600100
EnterpriseUnlimitedCustom

SDKs

Official SDKs for popular languages:

# Python
pip install pulse-sdk

# JavaScript/TypeScript
npm install @anthropic/pulse

# Go
go get github.com/anthropic/pulse-go