Skip to main content
OpenClaw is a self-hosted AI assistant that connects chat channels such as Telegram, WhatsApp, and Discord to AI models and tools. This guide configures MaxAPI as an OpenAI-compatible provider.

Prerequisites

Before you begin, you need:
  • A MaxAPI API key
  • An available model ID
  • Node.js 22 or later
  • OpenClaw installed locally
1

Install OpenClaw

Install OpenClaw globally with npm, then start its onboarding flow.
2

Store the API key

Store your MaxAPI API key in an environment variable.
Never commit a real API key to a configuration repository. Use environment variables or a secrets manager in production.
3

Add the MaxAPI provider

Add maxapi under models.providers in your OpenClaw configuration. Replace YOUR_MODEL_ID with an ID from the model list.
Match contextWindow and maxTokens to the selected model. For a vision-capable model, set input to ["text", "image"].
4

Verify the configuration

Check model status, then select the MaxAPI model.

Troubleshooting

Confirm that MAXAPI_API_KEY is available to the shell or service that starts OpenClaw, and that the key is active.
Ensure models[].id exactly matches the MaxAPI model list. Select it using the maxapi/MODEL_ID format.
Ensure api is set to openai-completions. Check whether the model supports tools, image input, or other advanced request fields.
Add or increase timeoutSeconds in the provider configuration. Use asynchronous endpoints for video, image, and music generation.