OpenClaw

To connect OpenClaw to a third-party API you need to configure the provider, the API protocol, the base URL, the API Key and the default model.

Install and enter the setup wizard

If OpenClaw is not installed yet, run the official install command for your system. The setup wizard starts automatically once the installation finishes.

  • Windows PowerShell
iwr -useb https://openclaw.ai/install.ps1 | iex
  • Windows Cmd
powershell -NoProfile -ExecutionPolicy Bypass -Command "& ([scriptblock]::Create((irm https://openclaw.ai/install.ps1)))"
  • macOS / Linux
curl -fsSL https://openclaw.ai/install.sh | bash

If OpenClaw is already installed, run this command to enter the setup wizard again:

  • Terminal
openclaw onboard --install-daemon

Complete the basic setup

In the setup wizard, choose the following:

  1. For Continue? choose Yes.
OpenClaw configuration wizard: select Yes for Continue
  1. For Help make OpenClaw better? choose No thanks.
Select No thanks
  1. For Setup mode choose QuickStart.
Setup mode: Select QuickStart
  1. Keep the default agent name main and press Enter.
Keep the Agent name as main
  1. For Model/auth provider choose Skip for now.
Model/auth provider: Select Skip for now
  1. For Default model choose Keep current. It does not matter if the model shown here is different; you will overwrite it with the HiModels configuration later.
Default model: Select Keep current
  1. For Select channel choose Skip for now.
Select channel: Select Skip for now
  1. For Search provider choose Skip for now.
Search provider: Select Skip for now
  1. For Install missing skill dependencies choose Skip for now. This is a multi-select screen: press Space to highlight the option and Enter to submit.
Install missing skill dependencies: Select Skip for now

Leave the remaining settings at their defaults, or choose Skip for now.

HiModels is a custom provider, so skip the built-in model configuration for now; the next step writes in the HiModels key and endpoint.

The two setups below use different provider names. You can configure just one of them, or add the other models too; later configurations never overwrite the models you already added.

OpenAI setup

  • Pick the command for your system, replace sk-your-api-key with the API Key you just created, then paste the whole block into your terminal.
  • macOS / Linux
cat <<'EOF' | openclaw config patch --stdin
{  
    "agents": {    
        "defaults": {      
            "model": {        
                "primary": "himodels-openai/gpt-6-astra"      
             }    
         }  
 },  
 "models": {    
     "mode": "merge",    
     "providers": {      
         "himodels-openai": {        
             "baseUrl": "https://api.himodels.ai/v1",        
             "apiKey": "sk-your-api-key",        
             "api": "openai-responses",        
             "models": [          
                 {            
                     "id": "gpt-6-astra",            
                     "name": "GPT-6 Astra"          
                 }        
              ]      
         }    
     }  
  }
}
EOF

Claude setup

  • Pick the command for your system, replace sk-your-api-key with the API Key you just created, then paste the whole block into your terminal.
  • macOS / Linux
cat <<'EOF' | openclaw config patch --stdin
{  
    "agents": {    
        "defaults": {      
            "model": {        
                "primary": "himodels-claude/claude-sonnet-5-5"      
             }    
         }  
 },  
 "models": {    
     "mode": "merge",    
     "providers": {      
         "himodels-claude": {        
             "baseUrl": "https://api.himodels.ai",        
             "apiKey": "sk-your-api-key",        
             "api": "anthropic-messages",        
             "models": [          
                 {            
                     "id": "claude-sonnet-5-5",            
                     "name": "Claude Sonnet 5.5"          
                 }        
              ]      
         }    
     }  
  }
}
EOF

Check the configuration

After either setup, run these commands to check the configuration:

Terminal:
openclaw config validate
openclaw config get agents.defaults.model.primary

If you see Config valid and the second command prints the model you just configured, the configuration has been written:

  • OpenAI: himodels-openai/gpt-6-astra
  • Claude: himodels-claude/claude-sonnet-5-5
openclaw config validate displays Config valid

Open the Dashboard to verify the connection

Restart Gateway, then open Dashboard:

Terminal:
openclaw gateway restart
openclaw dashboard

Once the browser opens:

  1. Create a new session.
  2. Click the model name under the input box and select the model you just configured.
  3. Send a message.

The model you configured last becomes the default for new sessions; existing sessions may keep the model they were using, so create a new session or switch models manually when you verify. If OpenClaw replies normally and the request shows up in your HiModels usage records, the connection works.

First make sure the API Key is on a group that allows external access, then check the base URL, API mode and model name above. For 401, 403 or 429 errors, see the FAQ.