4.2 KiB
| summary | read_when | ||
|---|---|---|---|
| Use NEAR AI private inference in Clawdbot |
|
NEAR AI
NEAR AI provides privacy-focused AI inference using confidential computing. All inference runs inside Intel TDX (Trust Domain Extensions) and NVIDIA TEE (Trusted Execution Environment), ensuring your prompts and responses are never logged or exposed to the host system.
Why NEAR AI in Clawdbot
- Private inference - all computation happens inside secure enclaves.
- Cryptographic verification - outputs are signed inside TEE before leaving.
- No logging - prompts and responses are never stored.
- OpenAI-compatible
/v1endpoints.
Privacy Technology
NEAR AI uses two layers of hardware-based security:
| Technology | Purpose |
|---|---|
| Intel TDX | Isolates AI workloads in confidential VMs |
| NVIDIA TEE | GPU-level isolation for model weights and computations |
All AI outputs are cryptographically signed inside the TEE before leaving the secure environment, ensuring authenticity and integrity of responses.
Features
- OpenAI-compatible API: Standard
/v1/chat/completionsendpoint - Streaming: Supported on all models
- Function calling: Supported
- Vision: Supported on vision-capable models
Setup
1. Get API Key
- Sign up at cloud.near.ai
- Go to your dashboard and generate an API key
- Copy your API key
2. Configure Clawdbot
Option A: Environment Variable
export NEARAI_API_KEY="your-api-key"
Option B: Interactive Setup (Recommended)
clawdbot onboard --auth-choice nearai-api-key
This will:
- Prompt for your API key (or use existing
NEARAI_API_KEY) - Configure the provider automatically
- Set NEAR AI as your default model
Option C: Non-interactive
clawdbot onboard --non-interactive \
--auth-choice nearai-api-key \
--nearai-api-key "your-api-key"
3. Verify Setup
clawdbot chat --model nearai/zai-org/GLM-4.7 "Hello, are you working?"
Model Selection
After setup, you can use any available NEAR AI model:
clawdbot models set nearai/zai-org/GLM-4.7
clawdbot models set nearai/deepseek-ai/DeepSeek-V3.1
List all available models:
clawdbot models list | grep nearai
Available Models
Note: The model list may change. See the latest available models at cloud.near.ai/models.
| Model ID | Name | Context | Cost ($/M tokens) |
|---|---|---|---|
deepseek-ai/DeepSeek-V3.1 |
DeepSeek V3.1 | 128K | $1.05 in / $3.10 out |
openai/gpt-oss-120b |
GPT OSS 120B | 131K | $0.15 in / $0.55 out |
Qwen/Qwen3-30B-A3B-Instruct-2507 |
Qwen3 30B | 262K | $0.15 in / $0.55 out |
zai-org/GLM-4.7 |
GLM 4.7 (default) | 131K | $0.85 in / $3.30 out |
Configure via clawdbot configure
- Run
clawdbot configure - Select Model/auth
- Choose NEAR AI
Usage Examples
# Use default model (GLM 4.7)
clawdbot chat --model nearai/zai-org/GLM-4.7
# Use DeepSeek for reasoning tasks
clawdbot chat --model nearai/deepseek-ai/DeepSeek-V3.1
# Use Qwen for long context (262K!)
clawdbot chat --model nearai/Qwen/Qwen3-30B-A3B-Instruct-2507
# Send a message
clawdbot agent --message "Explain quantum computing" --model nearai/zai-org/GLM-4.7
Troubleshooting
API key not recognized
echo $NEARAI_API_KEY
clawdbot models list | grep nearai
Ensure the environment variable is set correctly.
Connection issues
NEAR AI API is at https://cloud-api.near.ai/v1. Ensure your network allows HTTPS connections.
Config file example
{
env: { NEARAI_API_KEY: "..." },
agents: { defaults: { model: { primary: "nearai/zai-org/GLM-4.7" } } },
models: {
mode: "merge",
providers: {
"nearai": {
baseUrl: "https://cloud-api.near.ai/v1",
apiKey: "${NEARAI_API_KEY}",
api: "openai-completions"
// Models are auto-discovered from the built-in catalog
}
}
}
}