Skip to main content
Use the NEAR AI Inference SDK to call models, verify attestation evidence, and check response signatures.

JavaScript

Requires Node.js 24.22.1 or later.

Python

Requires Python 3.12 or later.

Rust

Use Rust stable and Cargo.

Go

Requires Go 1.26.10 or later.

Widget

Use the Embedded guide to add the Verification Center to your web application.

Install

Supported APIs

Choose the API listed on your model’s page in the model catalog, then open its example in your language guide. All four languages support the APIs below; Chat Completions, Responses, and Messages also support streaming.

E2EE

End-to-end encryption (E2EE) is off by default. Enable it for Chat Completions with a supported NEAR TEE model. The SDK encrypts each supported field to a verified model key and binds it to a fresh reply key using the v3 encryption protocol.

Verification

Follow Verify with the SDK for a complete request-to-verification walkthrough and an explanation of its results. The SDK verifies Gateway attestation before sending a request and model attestation where supported. After receiving the answer, call verifyResponse() or your language’s equivalent before using the output. For streaming, consume the entire stream first. System One’s receipt ID is separate from the upstream request ID. If a receipt is temporarily unavailable, retry verification on the same client with the same ID. After successful verification, the client releases its copies of the request and response bodies and caches the result. Response records expire 60 minutes after the response finishes by default. Verify before expiry or closing the client. Check the returned signature kind:
  • provider_tee: the signer selected before the request signed the request and response bytes. The result includes every verified model report that matches that signer.
  • gateway: the verified Gateway signed those bytes.
Responses and Messages use Gateway signatures. See Verification for custom policies and evidence requirements.

OHTTP

OHTTP adds encryption between the client and the attested Gateway for Chat Completions, Responses, and Messages. It is optional, disabled by default, and requires Ed25519. See the JavaScript, Python, Rust, or Go configuration.

Examples

  • SDK examples: complete projects for each language.
  • Image provenance: configure checks for selected image builds and Compose Manager deployments.