# Build on the chart

Canonical URL: https://docs.chartvoyant.com/

Connect clinical apps, AI agents, lab and hospital feeds, population-health pipelines, and practice tools to ChartVoyant. Every capability below documents its real endpoints, authentication, limits, and production status.

## Choose how to integrate

ChartVoyant exposes two main integration models — tenant-scoped **API keys** for practice and AI-agent workflows, and standards-based **SMART on FHIR R4** with zero fees — alongside dedicated interfaces for HL7 v2 feeds, patient-controlled MCP keys, and complete record exports.

    Live

### ChartVoyant REST API

Tenant-scoped JSON API authenticated with a practice bearer key (`cvk_…`) for patients, practitioners, encounters, documents, and context.

    https://chartvoyant.com/api/v1

    LiveMCP

### Practice MCP Server

Connect Claude Code or any MCP client to a practice chart with 28 read tools and 8 scheduling and inbox tools.

    POST https://chartvoyant.com/api/v1/mcp

    LivePatient

### Patient MCP Server

Patients generate a read-only `cvpk_…` key in the portal to connect Claude, ChatGPT, Cursor, or VS Code to their own record.

    POST https://chartvoyant.com/api/v1/portal/mcp

    LiveONC certification in progress

### SMART on FHIR-4 & US Core 6.1

Patient, clinician, EHR launch, Backend Services, and Bulk Data 2.0 across 27 US Core 6.1 resources. No fee and no revenue share.

    https://fhir.chartvoyant.com/r4/{practice}

    NewPer interface

### HL7 v2 Interfaces

Labs, imaging centers, and hospitals deliver `ORU^R01` results and `ADT` events over HTTPS with synchronous ER7 ACKs.

    POST /api/v1/interop/hl7/{interfaceId}

    LiveONC certification in progress

### Complete EHI Export

Published Archive Format 2.0 (ZIP64 of native JSON tables, US Core NDJSON, original documents, and frozen schema v1) with synthetic sample.

    Archive format 2.0 · schema-v1.json

## Make your first request

Request a self-serve sandbox key in about a minute — it provisions your own isolated synthetic office for 14 days with read and write access and zero real patient data — then query the REST API or attach an MCP client:

**cURL**

```bash
# Sandbox: synthetic patients only
curl "https://chartvoyant.com/api/v1/patients?limit=5" \
  -H "Authorization: Bearer $CHARTVOYANT_API_KEY" \
  -H "X-Purpose: operations"
```

**TypeScript**

```typescript
const res = await fetch("https://chartvoyant.com/api/v1/patients?limit=5", {
  headers: {
    Authorization: `Bearer ${process.env.CHARTVOYANT_API_KEY}`,
    "X-Purpose": "operations",
    Accept: "application/json"
  }
});
if (!res.ok) throw new Error(`ChartVoyant API error: ${res.status}`);
const { data, page } = await res.json();
```

**Python**

```python
import os, urllib.request, json

req = urllib.request.Request(
    "https://chartvoyant.com/api/v1/patients?limit=5",
    headers={
        "Authorization": f"Bearer {os.environ['CHARTVOYANT_API_KEY']}",
        "X-Purpose": "operations",
        "Accept": "application/json",
    },
)
with urllib.request.urlopen(req) as resp:
    payload = json.loads(resp.read().decode("utf-8"))
```

## Rate limits at a glance

Over-budget calls return HTTP `429` with a `Retry-After` header. Higher limits carry no fee — see [Rate Limits & Error Codes](https://docs.chartvoyant.com/rate-limits-and-errors/) for full details and error envelopes.

| Scope | Burst | Sustained |
| --- | --- | --- |
| API key, per key | 150 requests / second | 3,600 requests / minute |
| API key, per practice (all keys and staff sessions) | 400 requests / second | 12,000 requests / minute |
| FHIR, per token | 300 requests / second | 9,000 requests / minute |
| FHIR, per practice | 600 requests / second | 18,000 requests / minute |
| Self-serve sandbox key, per key (also 5,000 / day) | 38 requests / second | 900 requests / minute |

## Usage policy & sandbox terms

Sandbox keys are governed by the [ChartVoyant Sandbox Terms](https://chartvoyant.com/sandbox-terms/) (version 1.0). Production API keys are governed by the 14-point [API key usage policy](https://docs.chartvoyant.com/usage-policy/) and the [ChartVoyant API Use Agreement](https://docs.chartvoyant.com/api-use-agreement/) (version 1.2), including server-side secret storage, minimum-necessary data access, no model training or shadow charts, 35% profit share on commercialized products built on the proprietary API, and strict Model Provider BAA requirements for AI agents.

## Not available yet

  Not available yetOutbound webhooks
There are no developer webhooks or event subscriptions yet. Poll the REST API or run incremental [Bulk Data](https://docs.chartvoyant.com/bulk-data/) exports with `_since`.

  Not available yetMCP OAuth sign-in
Practice MCP takes a `cvk_…` bearer key; Patient MCP takes a `cvpk_…` key or URL path token. Interactive OAuth for MCP clients is not yet built.

  Not available yetHL7 over MLLP or SFTP
HL7 v2 arrives over HTTPS only. MLLP over VPN/TLS and SFTP file pickup are not offered.

## Frequently asked questions

### Should I use a ChartVoyant API key or SMART on FHIR?

Use an API key if you need practice scheduling, inbox workflows, billing context, or Practice MCP tools. Use SMART on FHIR if you are building a patient-facing app, a clinician launch app, or a population Bulk Data integration — it is free, standards-based, and carries no revenue share.

### Can I get a production key without a sponsoring practice?

No. Every production key is bound to one practice that confirms the integration. Build and demo against a self-serve synthetic sandbox key first.

### Can I connect Claude Code or another AI agent?

Yes — via the [Practice MCP server](https://docs.chartvoyant.com/mcp/) for practice workflows (sandbox today; production requires version 1.2 of the [API Use Agreement](https://docs.chartvoyant.com/api-use-agreement/) and a Model Provider BAA covering MCP/tool traffic), or via the [Patient MCP server](https://docs.chartvoyant.com/patient-mcp/) for patients connecting their own record.

### Where do I report a security vulnerability?

Email [info@chartvoyant.com](mailto:info@chartvoyant.com?subject=Security%20report) with reproduction details. Never test against a live practice.
