docs/guides/configure-openai-compatible-provider.md
nanobot can call OpenAI-compatible model providers by configuring an apiBase,
optional apiKey, and a model preset that references that provider name.
nanobot agent runUse this for local or hosted services that expose OpenAI-compatible endpoints, including internal gateways, local model servers, and provider proxies that are not already named in nanobot.
python -m pip install nanobot-ai
nanobot onboard --wizard
Verify the endpoint responds before debugging nanobot:
curl -sS https://api.example.com/v1/models
Merge this into ~/.nanobot/config.json:
{
"providers": {
"custom": {
"apiKey": "${CUSTOM_API_KEY}",
"apiBase": "https://api.example.com/v1"
}
},
"modelPresets": {
"primary": {
"label": "Custom",
"provider": "custom",
"model": "provider-model-name",
"maxTokens": 4096,
"contextWindowTokens": 65536,
"temperature": 0.1
}
},
"agents": {
"defaults": {
"modelPreset": "primary"
}
}
}
Then run:
nanobot agent -m "Hello!"
apiBase when the service expects /v1.EMPTY only when the endpoint requires a
non-empty key but does not validate it.apiType unset for OpenAI-compatible custom endpoints.curl /models fails, fix the provider endpoint before changing nanobot.