SDKs and CLI
CHANGENTS.AI provides clients for JavaScript/TypeScript and Python, and a command line, changents. Both clients are generated from the API's own OpenAPI document, so they cover every documented operation and never describe one the server does not serve.
The clients and the CLI are in the repository under sdk/. They are not yet published to npm or PyPI.
JavaScript and TypeScript
Node 18 or later. Types are included (index.d.ts).
const { Changents, verifyProof } = require('changents');
const cg = new Changents({ apiKey: process.env.CHANGENTS_API_KEY });
// The Object Graph
const parties = await cg.objectsList({ type: 'Party' });
// Propose a change: a person approves it in CHANGENTS.AI
const { action } = await cg.actionsPropose(
{},
{ type: 'Invoice', objectId: 'xero:Invoice:8f2c...', change: { dueDate: '2026-12-31' } }
);
// Check the proof bundle yourself, offline
const { proof } = await cg.actionsProof({ id: action.id });
verifyProof(proof).matches; // trueThere is one method per API operation, named by its operationId, such as objectsList, actionsPropose and actionsProof. The first argument holds the path and query parameters. The second holds the JSON body, when the operation takes one. A failed call throws a ChangentsError with the HTTP status and the response body.
baseUrl defaults to CHANGENTS_URL, then https://changents.ai. apiKey defaults to CHANGENTS_API_KEY.
Python
Python 3.9 or later, with no dependencies.
from changents import Changents, verify_proof
cg = Changents() # CHANGENTS_API_KEY, CHANGENTS_URL
parties = cg.objects_list(type="Party")
action = cg.actions_propose(body={"type": "Invoice", "objectId": oid, "change": {"dueDate": "2026-12-31"}})["action"]
proof = cg.actions_proof(id=action["id"])["proof"]
verify_proof(proof)["matches"] # TrueMethods use snake_case names. Path and query parameters are keyword arguments, and the JSON body is body=.
Command line
changents objects types
changents objects list Party --source xero
changents objects get Invoice xero:Invoice:8f2c...
changents actions propose Invoice xero:Invoice:8f2c... dueDate=2026-12-31 --reason "Agreed on the call"
changents actions list --status pending
changents actions proof <id> --out proof.json
changents proof verify proof.jsonchangents proof verify checks a saved proof bundle with no network at all. It exits with 1 if the bundle does not match its digest.
Verifying a proof bundle
verifyProof (JavaScript) and verify_proof (Python) recompute the digest of a proof bundle. The digest is a SHA-256 over the canonical JSON of the bundle, without digest, approval and commit. Canonical JSON here means sorted keys, no spaces, and numbers and strings as JSON writes them.
Both clients and the server are tested against the same bundle, so all three agree. That bundle includes non-ASCII text, decimals and nulls.
Sandbox keys
A sandbox key lets you try the API without touching a real system:
- it reads made-up records for a fictional trading company, from two systems, so you can see records joined across systems, and a suggested join;
- you propose changes as usual, and a person approves them in CHANGENTS.AI, but nothing is written. The proof bundle's
commitsays so; - it can hold only the
objects,actionsandmcpscopes. On the MCP server it sees only the object and action tools, so it cannot run agents.
Create one with Create Sandbox Key on the Developer page, or with "sandbox": true when you create a key through the API.
Current limits
- The packages are not yet on npm or PyPI; use them from the repository.
- The CLI covers the Object Graph and governed actions. To run agents, use the clients or the MCP server.