This doc summarizes everything we set up so you can run and test the integration tomorrow.
- OpenClaw = AI agent (runs 24/7, talks on Telegram/Discord/Control UI). Uses Anthropic (or other LLM) and has tools that call the OpenModelStudio API.
- OpenModelStudio plugin = A plugin for OpenClaw that registers 16 tools (
oms_*) so the agent can create projects, models, datasets, start training, manage experiments, launch workspaces, and search—all via the OpenModelStudio REST API. - Agent instructions = Your OpenClaw workspace
AGENTS.mdnow has an “OpenModelStudio (OMS) workflow” section so the agent chains steps (create project → create model → start training, etc.) and uses the exact IDs returned by the API.
Result: You say in Telegram (or Control UI): “Create a project called MyML, add a model, and start training.” The agent calls the API step by step and reports back. You see the same projects/jobs in the OpenModelStudio dashboard.
The plugin calls the OpenModelStudio API. Choose one:
Option A — Full Kubernetes
cd /path/to/OpenModelStudio
make k8s-deploy- API: http://localhost:31001
- Frontend: http://localhost:31000
- Login:
test@openmodel.studio/Test1234
Option B — Local dev (API only)
make dev-api- API: http://localhost:8080
- You must set the plugin
baseUrltohttp://localhost:8080in OpenClaw config (see below).
openclaw gateway- Gateway: ws://127.0.0.1:18789
- Control UI: http://127.0.0.1:18789/ or http://127.0.0.1:18789/__openclaw__/canvas/
If you see “unauthorized: gateway token missing” in the Control UI, paste your gateway token in the UI settings. Token is in ~/.openclaw/openclaw.json under gateway.auth.token.
The plugin needs the OpenModelStudio API URL and either an API key (recommended) or a JWT so it can call the API.
Config location: ~/.openclaw/openclaw.json → plugins.entries["openclaw-plugin"].config
Example:
"openclaw-plugin": {
"enabled": true,
"config": {
"baseUrl": "http://localhost:31001",
"accessToken": "oms_xxxxxxxx..."
}
}- baseUrl — Use
http://localhost:31001for K8s deploy, orhttp://localhost:8080formake dev-api. - accessToken — Use an API key (recommended) or a JWT.
- Log into OpenModelStudio (UI) once.
- Go to Settings → API Keys and create a key (e.g. name:
OpenClaw). - Copy the key (it looks like
oms_xxxxxxxx...; you only see it once). - Put that value in
accessTokenin the plugin config above.
End users never need to provide or refresh a token; the same key is used until you revoke it in Settings → API Keys.
Production: Use HTTPS for the OpenModelStudio API so the key is not sent in the clear, and practice good secret handling (secrets manager or secure config, restrict permissions on config files, never commit credentials).
Use a JWT as accessToken. It expires (often 15–60 min). To get a fresh token:
curl -s -X POST http://localhost:31001/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"test@openmodel.studio","password":"Test1234"}' | jq -r '.access_token'Copy the output and replace accessToken in the config. No need to restart the gateway for a token-only change (plugin reads config when a tool runs).
The agent needs an LLM to run. We set it up with Anthropic.
- Add/update auth:
openclaw agents add main→ follow prompts, paste Anthropic API key when asked. - Or manually: create/edit
~/.openclaw/agents/main/agent/auth-profiles.jsonwith your Anthropic (or other) provider credentials.
If you see “No API key found for provider anthropic”, run openclaw agents add main and add the key, then restart the gateway.
Control UI (browser)
- Open http://127.0.0.1:18789/
- Enter gateway token if prompted
- Chat in the UI. Example: “List my OpenModelStudio projects”
Telegram
- Your OpenClaw bot is already configured. Open the bot in Telegram and send the same kinds of messages. Example: “Create a project called Test and list my projects.”
Agent tools allowlist
Your config has agents.list[].tools.allow: ["openclaw-plugin"], so all 16 OMS tools are enabled. No extra config needed.
| Tool | What it does |
|---|---|
oms_list_projects |
List projects |
oms_create_project |
Create project (name, optional description) |
oms_list_models |
List models (optional project_id) |
oms_create_model |
Create model (project_id, name, framework, optional description/source_code) |
oms_create_dataset |
Create dataset (project_id, name, format e.g. csv, optional description) |
oms_list_datasets |
List datasets (optional project_id) |
oms_start_training |
Start training (model_id; optional dataset_id, hardware_tier, hyperparameters) |
oms_list_training_jobs |
List training jobs |
oms_get_training_job |
Get job status (job_id) |
oms_get_job_metrics |
Get job metrics (job_id) |
oms_create_experiment |
Create experiment (project_id, name, optional description) |
oms_add_experiment_run |
Add run (experiment_id, job_id, optional parameters/metrics) |
oms_list_experiment_runs |
List runs for an experiment |
oms_list_experiments |
List experiments (optional project_id) |
oms_launch_workspace |
Launch JupyterLab workspace (project_id; optional name, hardware_tier) |
oms_search |
Search projects/models/datasets |
All IDs are UUIDs returned by the API; the agent is instructed to pass them from one step to the next.
In ~/.openclaw/workspace/AGENTS.md we added an “OpenModelStudio (OMS) workflow” section. It tells the agent to:
- List or create project → remember project_id
- Create model (project_id, name, framework) → remember model_id
- List or create dataset if needed → remember dataset_id
- Start training (model_id, optionally dataset_id) → remember job_id
- Optionally create experiment and add run (experiment_id, job_id)
- Optionally launch workspace (project_id) and share the URL
So when you say “Create a project and train a model”, the agent should run: create project → create model → start training, using the returned IDs in each step.
Before you start
- OpenModelStudio API is running (K8s or
make dev-api) and reachable at the URL in the plugin config. - OpenClaw gateway is running (
openclaw gateway). - Plugin
baseUrlandaccessTokenin~/.openclaw/openclaw.jsonare correct. If in doubt, get a new token with thecurlabove and updateaccessToken. - Agent has LLM auth (e.g. Anthropic) so it can reply.
Tests
- Control UI: Open http://127.0.0.1:18789/ → paste gateway token if needed → say “List my OpenModelStudio projects.” You should see JSON or a summary of projects.
- Create project: “Create a project called MondayTest.” Agent should call
oms_create_projectand show the new project with its id. - Chained flow: “In that project create a model named demo-model with framework pytorch and start training for it.” Agent should create the model then start training, using the project_id and model_id from previous steps.
- Telegram: Same prompts in your OpenClaw Telegram bot. You should get the same behavior.
Check OpenModelStudio UI
- Open http://localhost:31000 (if using K8s), log in, and confirm the new project, model, and training job appear.
| Issue | What to do |
|---|---|
| “Session token expired” / 401 from OMS | Get a new JWT with the curl in section 3 and update accessToken in the plugin config. |
| “No API key found for provider anthropic” | Run openclaw agents add main and add your Anthropic API key; restart gateway. |
| “Gateway token missing” in Control UI | Paste the token from ~/.openclaw/openclaw.json → gateway.auth.token in the Control UI settings. |
| “Missing tool result” / synthetic error | We fixed this by wrapping all tool executions in a safe handler so errors return a proper message. Restart the gateway so it loads the updated plugin. |
| Agent doesn’t chain steps | Ensure ~/.openclaw/workspace/AGENTS.md contains the “OpenModelStudio (OMS) workflow” section. Restart the gateway. |
| API unreachable (connection refused) | Start OpenModelStudio (e.g. make k8s-deploy or make dev-api) and ensure baseUrl matches (e.g. 31001 for K8s, 8080 for dev-api). |
| What | Where |
|---|---|
| OpenClaw config | ~/.openclaw/openclaw.json |
| Agent workspace (AGENTS.md, SOUL.md) | ~/.openclaw/workspace/ |
| Plugin code | OpenModelStudio/integrations/openclaw/ (index.ts, openclaw.plugin.json, package.json) |
| Plugin install (linked) | openclaw plugins install -l ./integrations/openclaw from repo root |
| OMS workflow example | integrations/openclaw/AGENTS-oms-example.md |
| Full integration doc | docs/OPENCLAW-INTEGRATION.md |
Start OpenModelStudio API and OpenClaw gateway; keep the plugin’s baseUrl and accessToken correct; then in Telegram or the Control UI ask the agent to list projects, create a project, create a model, and start training—it will call the API step by step and you can verify everything in the OpenModelStudio dashboard.