{"id":674,"date":"2026-03-28T08:23:28","date_gmt":"2026-03-28T16:23:28","guid":{"rendered":"https:\/\/nramkumar.org\/tech\/?p=674"},"modified":"2026-03-28T08:23:28","modified_gmt":"2026-03-28T16:23:28","slug":"setting-up-openclaw-model-providers","status":"publish","type":"post","link":"https:\/\/nramkumar.org\/tech\/blog\/2026\/03\/28\/setting-up-openclaw-model-providers\/","title":{"rendered":"Setting Up OpenClaw Model Providers"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">One of the first things you need to do after setting up OpenClaw is configure Model Providers. There are several options but these are the most common ones (and the ones that I have personally used):<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Configure OpenAI Codex provider &#8211; done via Codex OAuth. Run <code>openclaw onboard --auth-choice openai-codex<\/code> or <code>openclaw models auth login --provider openai-codex<\/code> and follow instructions to set it up.<\/li>\n\n\n\n<li>Configure Anthropic API Key &#8211; set <code>ANTHROPIC_API_KEY=&lt;your_key><\/code> in the openclaw <code>.env<\/code> file. You can get your key from <a href=\"https:\/\/platform.claude.com\">platform.claude.com<\/a>. Restart gateway and it should pick this up automatically.<\/li>\n\n\n\n<li>Configure Google Gemini API Key &#8211; Get your key from <a href=\"https:\/\/aistudio.google.com\">aistudio.google.com<\/a> and configure it as <code>GEMINI_API_KEY=&lt;your_key><\/code> in the openclaw <code>.env<\/code> file. Restart gateway and it should pick this up automatically as well.<\/li>\n\n\n\n<li>Configure Local Models via Ollama &#8211; Follow instructions for setting up Ollama on your local host. Then add the section to your <code>openclaw.json<\/code> and restart the gateway &#8211; adjust to match the models you have setup in your ollama instance and context window, maxTokens for your hardware.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  \"models\": {\n    \"mode\": \"merge\",\n    \"providers\": {\n      \"ollama\": {\n        \"baseUrl\": \"http:\/\/127.0.0.1:11434\/v1\",\n        \"apiKey\": \"ollama_secret\",\n        \"api\": \"openai-completions\",\n        \"models\": &#91;\n          {\n            \"id\": \"qwen3.5:9b-q4_K_M\",\n            \"name\": \"Local Qwen3.5 9B (Q4)\",\n            \"reasoning\": false,\n            \"input\": &#91;\n              \"text\"\n            ],\n            \"cost\": {\n              \"input\": 0,\n              \"output\": 0,\n              \"cacheRead\": 0,\n              \"cacheWrite\": 0\n            },\n            \"contextWindow\": 32768,\n            \"maxTokens\": 8192\n          }\n        ]\n      }\n    }\n  }<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Other Popular Providers\n<ul class=\"wp-block-list\">\n<li>Claude OAuth with a Pro\/Max subscription. This is a grey area as to whether or not your account will get banned for using it in this manner. I have not attempted this.<\/li>\n\n\n\n<li>Anti-Gravity OAuth with a Google AI Pro or other subscription. Definitely will get banned &#8211; do not attempt this.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Comparison Of Model Providers<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>OpenAI Codex<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cost:<\/strong> $<\/li>\n\n\n\n<li><strong>Availability:<\/strong> Excellent<\/li>\n\n\n\n<li><strong>Capability:<\/strong> Very Good<\/li>\n\n\n\n<li><strong>Limits:<\/strong> Generous \u2014 has 5-hour and weekly limits (seems to be separate from ChatGPT usage limits).<\/li>\n\n\n\n<li><strong>Notes:<\/strong> Best value with great response times and reliable responses without throttling or errors.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Anthropic API Key<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cost:<\/strong> $$$<\/li>\n\n\n\n<li><strong>Availability:<\/strong> Good<\/li>\n\n\n\n<li><strong>Capability:<\/strong> Excellent<\/li>\n\n\n\n<li><strong>Limits:<\/strong> N\/A<\/li>\n\n\n\n<li><strong>Notes:<\/strong> Expensive, and you should expect rate limits and errors during peak times. However, it allows you to set the budget ahead of time to avoid billing surprises.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Gemini API Key<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cost:<\/strong> $$<\/li>\n\n\n\n<li><strong>Availability:<\/strong> OK<\/li>\n\n\n\n<li><strong>Capability:<\/strong> Very Good<\/li>\n\n\n\n<li><strong>Limits:<\/strong> N\/A<\/li>\n\n\n\n<li><strong>Notes:<\/strong> Good capabilities. The server-side logging and datasets feature is quite useful, although you can get the same (plus a lot more) from the session <code>.jsonl<\/code> files as well. Expect rate limiting and errors during peak times. It does not have a set budget feature, but you do get a $10 credit per month with an AI Pro subscription.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Ollama Providers<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Cost: N\/A<\/li>\n\n\n\n<li>Availability: N\/A<\/li>\n\n\n\n<li>Capability: Low<\/li>\n\n\n\n<li>Limits: N\/A<\/li>\n\n\n\n<li>Notes: Heavily dependent on your hardware. I have 12 GB VRAM &#8211; with this, I find running even basic back and forth for OpenClaw on any of the models listed above does not work well. In general, I think most consumer hardware is unlikely to be able to run a good enough model for general purpose OpenClaw like Agent usage.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>One of the first things you need to do after setting up OpenClaw is configure Model Providers. There are several options but these are the most common ones (and the ones that I have personally used): Comparison Of Model Providers OpenAI Codex Anthropic API Key Gemini API Key Ollama Providers<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-674","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts\/674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/comments?post=674"}],"version-history":[{"count":2,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts\/674\/revisions"}],"predecessor-version":[{"id":676,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts\/674\/revisions\/676"}],"wp:attachment":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/media?parent=674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/categories?post=674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/tags?post=674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}