Setup

Get started with the Cloud Coding API in just a few simple steps.

API Reference

Endpoint

POST https://api.cloudcoding.ai/invoke

Headers

Content-Type: application/json
x-api-key: YOUR_CLOUDCODING_API_KEY

Request Body

FieldTypeRequiredDescription
repo_urlstringGitHub repository URL
github_tokenstringYour GitHub personal access token
branchstringBranch name to work on
variablesobjectTemplate variables (see templates)
haikubooleanUse Claude Haiku instead of Sonnet (default: false)
template_idstringTemplate ID (default: Chat template)
working_dirstringDirectory to mount after cloning
ant_api_keystringAnthropic API key (if not set in dashboard)

Response Format

The API returns streaming JSON responses with different message types:

data: {"auth": "Authenticated Successfully!"}
data: {"setup": {"messages": [...], "repo_url": "...", "branch": "main"}}
data: {"executor": [...]}
data: {"push": "changes successfully pushed to main"}

Quick Examples

Basic Code Analysis

Analyze any repository to understand what it’s about:

curl -X POST "https://api.cloudcoding.ai/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "repo_url": "https://github.com/username/repo-name",
    "github_token": "YOUR_GITHUB_TOKEN",
    "branch": "main",
    "variables": {
      "query": "analyze the repo to see what it is about"
    }
  }'

Add New Features

Use natural language to add functionality:

curl -X POST "https://api.cloudcoding.ai/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "repo_url": "https://github.com/username/my-app",
    "github_token": "YOUR_GITHUB_TOKEN",
    "branch": "feature/new-component",
    "variables": {
      "query": "Add a dark mode toggle component to the React app"
    }
  }'

Plan and Execute Template

For complex tasks, use the Plan and Execute template:

curl -X POST "https://api.cloudcoding.ai/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "repo_url": "https://github.com/username/my-project",
    "github_token": "YOUR_GITHUB_TOKEN",
    "branch": "main",
    "template_id": "a2ef2e64-40e2-4c6a-99fc-767e3a30a963",
    "variables": {
      "task": "Refactor the authentication system to use JWT tokens"
    }
  }'

Use Claude Haiku (Faster/Cheaper)

For simpler tasks, use the Haiku model:

curl -X POST "https://api.cloudcoding.ai/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "repo_url": "https://github.com/username/docs-site",
    "github_token": "YOUR_GITHUB_TOKEN",
    "branch": "main",
    "haiku": true,
    "variables": {
      "query": "Fix typos in the README file"
    }
  }'

Available Templates

Chat Template (Default)

  • Variables: query (string)
  • Use case: Direct communication with Claude for any coding task

Plan and Execute Template

  • Template ID: a2ef2e64-40e2-4c6a-99fc-767e3a30a963
  • Variables: task (string)
  • Use case: Complex multi-step coding tasks that benefit from planning

Discover more templates at cloudcoding.ai/dashboard

Next Steps