API & SDK

KNIRV API & SDK Documentation

Comprehensive documentation, interactive examples, and SDK references for building on the KNIRV D-TEN network.

Quick Start

SDK Installation

Node.js

npm install @knirv/sdk

Full-featured SDK with TypeScript support

Python

pip install knirv-sdk

Python SDK for AI/ML development

Go

go get github.com/knirv/sdk-go

High-performance Go SDK

Code Examples

Create a DVE

import { KnirvClient } from '@knirv/sdk';

const client = new KnirvClient({
  apiKey: 'your-api-key',
  network: 'mainnet'
});

const dve = await client.dve.create({
  name: 'my-dve',
  tier: 'free',
  region: 'us-east',
});

console.log(dve.id, dve.attestationEndpoint);

Apply a Policy

await client.dve.applyPolicy(dve.id, {
  admission: { require_auth: true, max_payload_kb: 512 },
  execution: { max_memory_mb: 512, timeout_seconds: 30 },
  commit: { on: ['execution_complete', 'error'], chain: 'knirvchain' },
});

const audit = await client.chain.getAuditLog({ dveId: dve.id, limit: 10 });
audit.entries.forEach(e => console.log(e.txHash, e.event));