Before you start
What this OpenClaw setup proves
This page covers the narrow integration that can be verified from public documentation: an OpenClaw custom provider using an OpenAI-compatible /v1/chat/completions endpoint and bearer authentication. The first test is deliberately text-only. It proves that OpenClaw can reach ScriptEngine, authenticate the key, select a returned model ID, and receive a response.
OpenClaw supports richer agent behavior, but a provider must actually accept the corresponding tool, reasoning, streaming, image, or response fields. ScriptEngine currently publishes and verifies the model-list and chat-completions surface; do not assume that every OpenClaw tool or multimodal workflow is supported. Complete the smoke test below before enabling tools for a production agent.
OpenClaw documents custom providers under models.providers and recommends the openai-completions adapter for OpenAI-compatible chat endpoints. This guide follows that documented configuration shape.
Requirements
Prepare the three values OpenClaw needs
- Create a ScriptEngine account and generate a private API key. Keep the key in an environment variable or secret store.
- Set the base URL to exactly
https://scriptengine.org/v1. Do not append/chat/completions. - Discover an available model with the same key. Model IDs change, so use the response from
/v1/modelsrather than copying a model from an old screenshot.
export SCRIPTENGINE_API_KEY="YOUR_PRIVATE_KEY"
curl https://scriptengine.org/v1/models \
-H "Authorization: Bearer $SCRIPTENGINE_API_KEY"
Choose one text model ID from the JSON response and keep it as MODEL_ID_FROM_DISCOVERY while completing the configuration. The public model catalog is useful for rate research, but the authenticated response is the authority for your key.
Configuration
Add ScriptEngine as an OpenClaw custom provider
OpenClaw can merge a custom provider into its model catalog. Add the following JSON5 fragment to the agent configuration described in the official custom-provider documentation. Use your real model ID in the provider model list and in the primary model reference.
models: {
mode: "merge",
providers: {
scriptengine: {
baseUrl: "https://scriptengine.org/v1",
apiKey: "${SCRIPTENGINE_API_KEY}",
api: "openai-completions",
models: [
{
id: "MODEL_ID_FROM_DISCOVERY",
name: "ScriptEngine model",
input: ["text"]
}
]
}
}
},
agents: {
defaults: {
model: {
primary: "scriptengine/MODEL_ID_FROM_DISCOVERY"
}
}
}
The provider ID is the first part of the model reference, so scriptengine/MODEL_ID_FROM_DISCOVERY tells OpenClaw which custom provider owns the route. Do not add capability flags such as tool support, images, or reasoning unless the exact ScriptEngine model and endpoint have been tested for that behavior.
Verification
Run a text chat before enabling agent tools
Validate the provider in two layers. First, check the API directly. Second, ask OpenClaw for a short response using the new provider/model reference. A direct request isolates an API-key or model-ID issue from an OpenClaw configuration issue.
curl https://scriptengine.org/v1/chat/completions \
-H "Authorization: Bearer $SCRIPTENGINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"MODEL_ID_FROM_DISCOVERY","messages":[{"role":"user","content":"Reply with exactly: ScriptEngine connected"}]}'
Then use the current OpenClaw model commands to inspect and select the configured route. The exact command names can change between OpenClaw releases, so follow the official models reference for your installed version. A successful response should identify the selected scriptengine/... model and return normal assistant text.
Troubleshooting
Fix the common OpenClaw setup failures
- 401 or invalid API key
- Confirm the environment variable is available to the OpenClaw process and that the value is the ScriptEngine key, not a dashboard password. Test the same key with
/v1/models. - Model not found
- Run model discovery again and replace the placeholder with an ID returned to that key. Model names from OpenClaw, OpenRouter, or an old tutorial are not automatically valid on ScriptEngine.
- 404 or duplicated path
- Use
https://scriptengine.org/v1as the base URL. Do not enter the homepage,/v1/models, or/v1/chat/completionsin the base-URL field. - Tools or images fail after text works
- That is a capability question, not proof that the connection is broken. Keep tools disabled and use text chat until the exact model and request shape have been separately tested.
Cost and safety
Control an agent budget before it runs continuously
OpenClaw can make repeated requests through scheduled or tool-assisted workflows. Start with a small prepaid balance, choose a model whose current rates fit the workload, and monitor usage in the ScriptEngine workspace. The site publishes a dated reference maximum of 86% savings for one model comparison; it is not a universal OpenClaw discount.
Do not paste an API key into a public skill, commit it to a repository, or place it in a chat transcript. OpenClaw skills can execute meaningful actions on a machine, so read third-party skills before enabling them and keep the provider key scoped to the environment where the agent runs.
ScriptEngine currently publishes no uptime or response-time SLA. Treat this setup as a tested integration path, not a reliability guarantee. For production, add your own request timeout, error handling, usage alert, and a fallback plan.
Sources and next steps
Keep the configuration current
This guide was checked August 4, 2026 against OpenClaw's custom-provider configuration and model documentation, plus ScriptEngine's public endpoint contract. OpenClaw releases can change field names and command flows; compare the installed version with the official OpenClaw documentation before upgrading.