Verify OpenClaw’s OpenAI API Key

To use an OpenAI API key with OpenClaw, configure an API-key auth profile for the openai provider and select a model available to your OpenAI Platform project. Verify both the model used in a fresh session and API usage in the intended project, because the same provider also supports Codex subscription sign-in.

Choose Platform billing explicitly

Create a secret API key in the intended OpenAI Platform project and record the project name and intended model ID without recording the secret in your run log. OpenClaw uses the same openai provider ID for direct API-key authentication and ChatGPT or Codex subscription authentication. For Platform billing, follow the OpenAI setup guide linked from OpenClaw's provider documentation and choose the API-key path when configuring the instance.

For an existing installation, inventory any subscription sign-in and model fallback settings before making changes. Use a disposable instance or an isolated test configuration when both routes are present and you cannot tell which one will win. Keep the key in the credential input for the selected auth method. A request sent through a chat channel should contain only the test prompt.

Use a provider project alias, one harmless test request and its run ID. Keep key values outside the log and tool.

OpenAI - OpenClaw

Verify the model and the billed project

In an illustrative test, suppose your OpenAI project is named Support Sandbox and its intended OpenClaw model is openai/gpt-6.2-sol, provided your installation and project expose that model. In a fresh session, send a synthetic prompt asking for the exact text check-green. After the reply, use /status and record the current model and the last-response token counts if they are available. Then check OpenAI Platform usage for Support Sandbox over the corresponding time window, allowing for reporting delay.

A matching reply shows the request completed. The session model and project usage establish whether it took the intended route. If usage is hard to attribute because the project has other traffic, repeat the test in a quiet test project. OpenClaw's session cost can depend on local pricing metadata, so use Platform usage for billing verification.

Confirm that the usage appears in the intended project over the provider’s reporting window before scaling the workload.

API usage and costs - OpenClaw

Trace unexpected credentials or model selection

If the session uses a different model, check the default in a fresh session and inspect any session override or fallback. If the reply succeeds but the intended project shows no matching usage after reporting has updated, inspect the OpenAI authentication route. OpenClaw documents that the openai model prefix alone does not select a runtime. Check both the selected runtime and the credential used for the turn before changing the model.

If the test returns an authentication error, verify that you saved the credential in the intended instance and selected the API-key profile. If the credential is accepted but the model is unavailable, confirm project access and the exact model identifier. Change one setting at a time and repeat the same prompt. Restore channel traffic after the selected model and intended billing project both check out.

OpenAI - OpenClaw

Sources