Setup
Get started with the Cloud Coding API in just a few simple steps.
API Reference
Endpoint
POST https://api.cloudcoding.ai/invoke
Content-Type: application/json
x-api-key: YOUR_CLOUDCODING_API_KEY
Request Body
Field | Type | Required | Description |
---|
repo_url | string | ✅ | GitHub repository URL |
github_token | string | ✅ | Your GitHub personal access token |
branch | string | ✅ | Branch name to work on |
variables | object | ✅ | Template variables (see templates) |
haiku | boolean | ❌ | Use Claude Haiku instead of Sonnet (default: false) |
template_id | string | ❌ | Template ID (default: Chat template) |
working_dir | string | ❌ | Directory to mount after cloning |
ant_api_key | string | ❌ | Anthropic API key (if not set in dashboard) |
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
Next Steps