run_agent · Run a coding agent
may change things: you confirm before it runsRuns a coding agent CLI non-interactively on a running computer with your own model key: claude (Claude Code, -p), codex (codex exec), opencode (opencode run) or gemini (Gemini CLI). It works in the repo with full permissions inside the microVM and returns a run id; read progress with read_logs. Your key goes to that run's environment only and is never stored; model usage is billed by your provider.
Input schema
{
"type": "object",
"properties": {
"computer": {
"type": "string",
"description": "The computer id from create_computer, like c_ab12cd34ef56.",
"pattern": "^c_[a-z0-9]{12}$"
},
"token": {
"type": "string",
"description": "The computer token from create_computer (ct_...). Not needed when you call with the owner's API key."
},
"agent": {
"type": "string",
"enum": [
"claude",
"codex",
"opencode",
"gemini"
],
"description": "Which CLI (default claude)."
},
"prompt": {
"type": "string",
"description": "The task, up to 20000 characters."
},
"apiKey": {
"type": "string",
"description": "Your model key: Anthropic key or Claude subscription token (claude), OpenAI key (codex), the provider's key (opencode), Google AI Studio key (gemini)."
},
"model": {
"type": "string",
"description": "Optional model name (opencode: provider/model)."
},
"provider": {
"type": "string",
"enum": [
"anthropic",
"openai",
"openrouter",
"google"
],
"description": "opencode only: whose key apiKey is (default anthropic)."
},
"cwd": {
"type": "string",
"description": "Working directory (default: the repo)."
}
},
"required": [
"computer",
"prompt",
"apiKey"
],
"additionalProperties": false
}