> ## Documentation Index
> Fetch the complete documentation index at: https://docs.near.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK

> Use the JavaScript and Python SDKs for verified, encrypted Chat Completions.

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.

<CardGroup cols={2}>
  <Card title="JavaScript" icon="braces" href="/cloud/inference-sdk/javascript">
    Install from npm and get started with Node.js 24 or later.
  </Card>

  <Card title="Python" icon="code" href="/cloud/inference-sdk/python">
    Install from PyPI and get started with Python 3.12 or later.
  </Card>
</CardGroup>

## Install

<CodeGroup>
  ```bash JavaScript theme={"dark"}
  npm install @nearai/inference-sdk
  ```

  ```bash Python theme={"dark"}
  pip install nearai-inference-sdk
  ```
</CodeGroup>

Packages: [npm](https://www.npmjs.com/package/@nearai/inference-sdk) · [PyPI](https://pypi.org/project/nearai-inference-sdk/).

## 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](/cloud/verification) for evidence, policies, and verification limits, or follow the [JavaScript](/cloud/inference-sdk/javascript#verification) and [Python](/cloud/inference-sdk/python#verification) 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](/cloud/inference-sdk/javascript#ohttp) or [Python](/cloud/inference-sdk/python#ohttp) configuration.

## Examples

See the language guides for runnable examples, or explore the [SDK source and examples](https://github.com/nearai/inference-sdk).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.