Use NexRouter with OpenHands
Connect OpenHands with your site API address, key, and model.
Follow these steps to use your NexRouter key and model in OpenHands.
Not installed yet? Follow the official guide first, then return here.
1. Get three things ready
- API address: open this site’s connection settings and copy the address required below.
- API key: create or copy a key in API key management. Do not use your login password.
- Model ID: copy the exact ID from the model list, not its display name.
Use an address and key from the same site. Domestic and overseas credentials are separate.
2. Configure OpenHands
Start Agent Canvas using the official installation guide, then open Settings → LLM → Advanced:
| Field | Value |
|---|---|
| Custom Model | openai/ followed by the model ID you copied |
| Base URL | The OpenAI Base URL you copied, including /v1 |
| API Key | Your site API key |
Keep the openai/ model prefix. Do not append /chat/completions to the Base URL. Save and start a new session with a tool-capable model.
3. Send a test message
Select the model you just configured, open a new chat, and send:
Please reply with only: ConnectedA normal reply means your first connection worked. You can now start your own task.
If no reply arrives, check the error:
- 401 / API key error: copy the full key again and check that the address and key belong to the same site.
- 404 / endpoint not found: compare the URL with the format above, especially missing or repeated
/v1. - Model not found: copy the exact model ID again and check that your key has access.
See Troubleshooting for other errors. To check the API separately, use the first request example.
Learn more
For installation, complete settings, and advanced features, see the official OpenHands documentation.