Skip to main content
NEAR AI Inference SDK is available for JavaScript and Python. Both provide an OpenAI-compatible Chat Completions client, attestation verification, optional encryption, and explicit response-signature verification.

JavaScript

Install from npm and get started with Node.js 24 or later.

Python

Install from PyPI and get started with Python 3.12 or later.

Install

Packages: npm · PyPI.

E2EE

End-to-end encryption is disabled by default. Enable it with e2ee: true in JavaScript or e2ee=True in Python to encrypt supported Chat fields to a verified model key. E2EE requires a supported NEAR TEE model and rejects models without supported model attestation.

Verification

The clients verify Gateway evidence before sending Chat and verify model evidence where supported. In Python, model verification requires a NEAR vLLM deployment with attestation enabled; other providers use Gateway-only verification. The JavaScript SDK also supports Chutes model attestation. After receiving a completion, call verifyResponse(completion.id) in JavaScript or await client.verify_response(completion.id) in Python before using the answer as verified. For streaming, consume the entire stream first. Deployment verification alone does not verify a particular response. A provider_tee signature binds the exact request and response bytes to a verified model signer. A gateway signature binds those bytes to a verified Gateway signer; it does not prove that an attested model generated them. See Verification for evidence, policies, and verification limits, or follow the JavaScript and Python guides.

OHTTP

Both SDKs support optional OHTTP to encapsulate the Chat HTTP exchange to the attested Gateway. It is disabled by default and requires Ed25519. E2EE protects supported fields to the model independently. See the JavaScript or Python configuration.

Examples

See the language guides for runnable examples, or explore the SDK source and examples.