Learn / How to use Netra Runtime with OpenClaw
How to use Netra Runtime with OpenClaw
OpenClaw is an open-source personal AI assistant that runs on hardware you control and talks to you over channels like WhatsApp, Telegram, Slack, and Discord. It works with any OpenAI-compatible model provider, and Netra Runtime serves models through an OpenAI-compatible API — so you can make a model you own, served by Netra, the brain of your assistant. The whole setup is one JSON block and a restart.
What you need
- OpenClaw installed, with its gateway running. Install instructions are in the OpenClaw repository.
- A Netra Runtime API key from your dashboard at app.netraruntime.com. The API base URL is
https://api.netraruntime.com/v1(self-hosted deployments use their own endpoint URL instead).
Step 1: export your API key
Keep the key out of the config file by referencing an environment variable. Set it in the environment where the OpenClaw gateway runs:
export NETRA_API_KEY="your-netra-api-key"
Step 2: add Netra as a provider in openclaw.json
OpenClaw's config lives at ~/.openclaw/openclaw.json. Add a provider under models.providers with api set to "openai-completions" (the mode for OpenAI-compatible endpoints like Netra's) and declare the model you deployed. Then point the default model at it:
{
"models": {
"mode": "merge",
"providers": {
"netra": {
"baseUrl": "https://api.netraruntime.com/v1",
"apiKey": "${NETRA_API_KEY}",
"api": "openai-completions",
"models": [
{
"id": "qwen3.6-35b",
"name": "Qwen3.6 35B",
"input": ["text"],
"contextWindow": 128000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": { "primary": "netra/qwen3.6-35b" }
}
}
}
The id must match a model id served by the API; https://api.netraruntime.com/v1/models lists the current set (at the time of writing, qwen3.6-35b and gemma-4-26b-a4b). Set contextWindow and maxTokens to match the model you picked. If the model accepts images, add "image" to the input array so attachments pass through. The full provider schema is in OpenClaw's model providers documentation.
Step 3: restart and test
Restart the OpenClaw gateway so it picks up the config, then send your assistant a message on any connected channel. Models are addressed as provider/model-id, so your Netra model is netra/qwen3.6-35b, the primary model every new conversation uses.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| 404 on every request | The base URL should end at /v1; don't append /chat/completions, the client adds it. |
| 401 / authentication error | NETRA_API_KEY isn't set in the environment the gateway runs in, or the key was revoked. |
| Model not found | The id must exactly match a model listed at /v1/models. |
| Replies cut off mid-answer | maxTokens is set lower than the model can produce; raise it to match your deployment. |
Frequently asked questions
Does OpenClaw support custom model providers?
Yes. OpenClaw accepts any OpenAI-compatible endpoint through the models.providers block in openclaw.json, so a model served by Netra Runtime can be added with a base URL, API key, and model entry.
What does api: "openai-completions" mean in the OpenClaw config?
It tells OpenClaw to speak the OpenAI chat-completions protocol to that provider. Netra Runtime exposes an OpenAI-compatible API, so this is the mode to use.
Can I keep my existing provider and use Netra Runtime as well?
Yes. Providers are namespaced, so models are addressed as provider/model-id. You can keep several providers configured and switch the default by changing agents.defaults.model.primary.