cloudcli
    cloudcli
    • CloudCLI API Documentation
    • List environments
      GET
    • Create environment
      POST
    • Get environment
      GET
    • Delete environment
      DELETE
    • Start environment
      POST
    • Stop environment
      POST
    • Get SSH credentials
      GET
    • Execute AI agent
      POST
    • Schemas
      • Schemas
        • Environment
        • CreateEnvironmentRequest
        • SSHCredentials
        • AgentExecuteRequest
        • Error

      Execute AI agent

      POST
      https://app.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://app.cloudcli.ai/api/v1/agent/execute' \
      --header 'X-API-KEY: <api-key>' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "environmentId": "123e4567-e89b-12d3-a456-426614174000",
          "projectName": "backend",
          "message": "Add user authentication",
          "provider": "claude"
      }'
      Response Response Example
      400 - Example 1
      {
          "error": "Invalid or missing API key"
      }
      Modified at 2025-11-12 15:10:25
      Previous
      Get SSH credentials
      Next
      Environment
      Built with