How to Setup OpenClaw with OpenAI API Key

Do not index
If you want to use OpenClaw with OpenAI models inside Agent 37, the setup is straightforward. You’ll create an OpenAI API key, open your OpenClaw instance in Agent 37, configure the model provider in the terminal, and then verify the selected model.
Follow the steps below or watch the video walkthrough:

Video walkthrough

Video preview

Prerequisites

Before you begin, make sure you have:
  • A running OpenClaw instance inside Agent 37
  • A valid OpenAI API key

Step 1: Create your Claude (Anthropic) API key

  1. Go to the OpenAI Platform and sign in.
  1. In the left sidebar, open Manage > API keys.
  1. Click Create new secret Key.
  1. When prompted:
      • Enter a name.
      • Select the Project
      • Click create secret key.
  1. Copy the generated key.
notion image
OpenAI API keys typically look like:
sk-proj-xxxx...

Step 2: Open your Agent 37 instance

  1. Go to the Agent37 dashboard and sign in.
  1. Open an existing instance (or create a new one).
  1. Open Terminal.

Step 3: Configure OpenClaw to use Anthropic

In Terminal, run:
openclaw configure
When prompted, choose the following:
  • Where will the gateway run? > Local
notion image
Continue with:
  • Select Section to Configure? > Model
notion image
  • Model / Auth Provider > OpenAI
notion image
  • OpenAI Auth Model > OpenAI API Key
notion image
  • How do you want to provide this API key now? > Paste API key now
notion image
  • Enter OpenAI API key > paste the key you copied in Step 1
notion image
  • Models in /models picker > select your model (example: openai-codex/gpt-5.4)
notion image
  • After selecting the model > Continue
notion image

Step 4: Verify the configured model

Run:
openclaw models list
You should see the models you selected in the output.
notion image
If you want to make that model the default, run:
Execute:
openclaw models set openai-codex/gpt-5.4 
You have successfully configured OpenClaw with your OpenAI API key inside Agent 37. Your instance is now ready to use the selected OpenAI model for future tasks.