cloudcli
  1. Agents
cloudcli
  • CloudCLI API Documentation
  • Environments
    • List environments
      GET
    • Get environment
      GET
    • Create environment
      POST
    • Delete environment
      DELETE
    • Get SSH credentials
      GET
    • Start environment
      POST
    • Stop environment
      POST
  • Agents
    • Execute AI agent
      POST
    • AI Agent models
      GET
  • Schemas
    • Schemas
      • AgentModels
      • Environment
      • CreateEnvironmentRequest
      • SSHCredentials
      • AgentExecuteRequest
      • Error
  1. Agents

Execute AI agent

POST
https://cloudcli.ai/api/v1/agent/execute
Run Claude Code or Cursor agent on a running environment.

Project Path Structure#

Each environment has a /workspace/ directory where projects live:
When you create an environment with a GitHub repo, it's cloned to /workspace/{sanitized-name}
You can have multiple projects in one environment under /workspace/
Specify only the project name (not full path) - we'll automatically prefix it with /workspace/

Example#

If your environment was created with GitHub repo mycompany/backend:
The repo is cloned to: /workspace/backend/
Set projectName: "backend" (just the name, not the full path)
If you create a new project in the environment:
You might create it at: /workspace/new-feature/
Set projectName: "new-feature"

Request

Authorization
API Key
Add parameter in header
X-API-KEY
Example:
X-API-KEY: ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢200OK
text/event-stream
Agent execution started (streaming response)
Body

🟠400Bad Request
🟠404Not Found
🟠424Failed Dependency
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'https://cloudcli.ai/api/v1/agent/execute' \
--header 'X-API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "environmentId": "bded3eef-fa6d-4edf-8299-9f20091a6dd5",
    "projectName": "MyProject2",
    "message": "create a hello world",
    "provider": "claude",
    "model": "opus"
}'
Response Response Example
200 - Example 1
null
Modified at 2025-12-29 17:45:04
Previous
Stop environment
Next
AI Agent models
Built with