OpenClaw
Add GreenTokens as a custom model provider in OpenClaw.
Add GreenTokens as a provider
OpenClaw connects to any OpenAI-compatible API as a custom provider. Add GreenTokens to the models section of your OpenClaw config and make one of its models the default:
OpenClaw config
{
models: {
providers: {
greentokens: {
baseUrl: "https://api.greentokens.io/v1",
apiKey: "${GREENTOKENS_API_KEY}",
api: "openai-completions",
models: [
{ id: "claude-sonnet-5", name: "Claude Sonnet 5" },
{ id: "claude-opus-5-5", name: "Claude Opus 5.5" },
{ id: "gpt-6-sol", name: "GPT-6 Sol" },
{ id: "glm-5.3", name: "GLM-5.3" }
]
}
}
},
agents: {
defaults: {
model: { primary: "greentokens/claude-sonnet-5" }
}
}
}baseUrlincludes/v1, andapi: "openai-completions"uses the Chat Completions API.${GREENTOKENS_API_KEY}reads your key from the environment, so it never sits in the file.- Each
idis a GreenTokens model ID from the models page. Reference them asgreentokens/model-id.
Or add it from the command line
To merge the provider into your existing config without editing the file by hand:
Shell
openclaw config set models.providers.greentokens '{
"baseUrl": "https://api.greentokens.io/v1",
"apiKey": "${GREENTOKENS_API_KEY}",
"api": "openai-completions",
"models": [{ "id": "claude-sonnet-5", "name": "Claude Sonnet 5" }]
}' --strict-json --mergeSet your key
export GREENTOKENS_API_KEY="sk-gt-…"Agents can run for a long time unattended. Give OpenClaw its own API key with a daily spend limit on the API Keys page.