mcpField
N
near-ai-cloud

near-ai-cloud

github.com/nearCloud & DevOps1669 installsUpdated 4w ago
Repository

About near-ai-cloud

NEAR AI Cloud provides OpenAI-compatible inference with requests processed inside confidential TEEs. It is for developers who need to verify hardware attestations and cryptographic signatures associated with model responses.

Key features

  1. 01OpenAI-compatible chat completions
  2. 02Inference inside Intel TDX confidential VMs
  3. 03NVIDIA TEE GPU attestation
  4. 04Signed chat responses
  5. 05Endpoints for models, attestation, and signatures

Use cases

  1. 01Send chat requests through an OpenAI SDK
  2. 02Verify GPU and CPU hardware attestations
  3. 03Check a chat signature against an attested key

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/near/agent-skills --skill near-ai-cloud

After installing, type/near-ai-cloudin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
chat-verification.md
e2ee-chat.md
gateway-verification.md
model-verification.md
private-vs-anonymised.md
specialized-endpoints.md

Details

From the project README

NEAR AI Cloud

Verifiable private AI inference through Trusted Execution Environments (TEEs). All inference runs inside Intel TDX confidential VMs with NVIDIA TEE GPUs — your data stays encrypted and isolated from infrastructure providers, model providers, and NEAR itself.

Quick Start

The API is OpenAI-compatible. Point any OpenAI SDK at https://cloud-api.near.ai/v1:

import openai

client = openai.OpenAI(
    base_url="https://cloud-api.near.ai/v1",
    api_key="YOUR_API_KEY"  # from cloud.near.ai dashboard
)

response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V3.1",
    messages=[{"role": "user", "content": "Hello, NEAR AI!"}]
)
print(response.choices[0].message.content)
import OpenAI from 'openai';

const openai = new OpenAI({
    baseURL: 'https://cloud-api.near.ai/v1',
    apiKey: 'YOUR_API_KEY',
});

const completion = await openai.chat.completions.create({
    model: 'deepseek-ai/DeepSeek-V3.1',
    messages: [{ role: 'user', content: 'Hello, NEAR AI!' }]
});
console.log(completion.choices[0].message.content);

How It Works

  • All inference runs inside Intel TDX confidential VMs with NVIDIA TEE GPUs
  • TLS terminates inside the TEE, not at a load balancer — prompts are never exposed in plaintext
  • TEEs generate cryptographic attestation proofs verifiable via NVIDIA NRAS and Intel TDX
  • Every chat response is signed by a key that never leaves the TEE
  • You can independently verify hardware attestation and bind it to message signatures

Verification Flow

1. Generate nonce
2. Request model attestation  →  get signing_address, nvidia_payload, intel_quote
3. Verify GPU attestation     →  submit nvidia_payload to NVIDIA NRAS, check JWT fields
4. Verify CPU attestation     →  verify intel_quote via dcap-qvl or TEE Explorer
5. Verify GPU-CPU binding     →  signing_address + nonce bound in TDX report data; same nonce in NRAS eat_nonce
6. Make chat request           →  use the API as normal
7. Fetch chat signature       →  GET /v1/signature/{chat_id}
8. Verify signature            →  recover signer, compare to attested signing_address

API Endpoints

Base URL: https://cloud-api.near.ai

EndpointMethodDescription
/v1/chat/completionsPOSTOpenAI-compatible chat completions
/v1/modelsGETList available models
/v1/attestation/report?model={model}GETModel attestation (GPU + CPU) — requires API key
/v1/attestation/reportGETGateway attestation — requires API key
/v1/signature/{chat_id}GETChat message signature (also covers Responses API resp_*)

Critical Knowledge

  • Base URL is https://cloud-api.near.ai/v1 — use with any OpenAI SDK
  • signing_algo can be ecdsa or ed25519
  • Attestation report now requires an API key — Authorization: Bearer <key>; retrieval is free and non-billable
  • Nonce should be a random 64-char hex string (32 bytes) for attestation freshness
  • NRAS response is a two-part array: [["JWT", "..."], {"GPU-0": "..."}] — overall JWT + per-GPU JWTs
  • The signing_address from model attestation must match the address that signed chat messages
  • Chat signatures are persistent and can be queried at any time after completion

References

TopicFile
Private vs Anonymised Modelsreferences/private-vs-anonymised.md
Model TEE verificationreferences/model-verification.md
Gateway verification + TLSreferences/gateway-verification.md
Chat message verificationreferences/chat-verification.md
E2E encrypted chat (E2EE)references/e2ee-chat.md
Specialized endpointsreferences/specialized-endpoints.md

Upstream Docs (prefer live values)

Resources

Comments

Markdown supported