Prerequisite: Ensure you’ve completed the Quickstart and have your API keys configured.
Two Ways to Use Cloud Coding API
The Cloud Coding API offers two powerful approaches to automate your development workflow:1. Prebuilt Templates (Recommended for Getting Started)
Ready-to-use templates for common development tasks. Perfect for quick automation without configuration.2. Custom Messages (Advanced Control)
Script your AI agent’s exact behavior with custom conversation flows, tool selection, and workflow control.Using Prebuilt Templates
The fastest way to get started is with our prebuilt templates. These are battle-tested workflows for common development tasks.Our Favorite: Plan and Execute Template
Template ID:a2ef2e64-40e2-4c6a-99fc-767e3a30a963
This template breaks down complex tasks into manageable steps by first creating a detailed plan, then executing it systematically.
Why Use Prebuilt Templates?
- ⚡ Fast Setup: No configuration needed - just provide variables
- 🧪 Battle-Tested: Proven workflows used by thousands of developers
- 📝 Smart Planning: Templates like Plan & Execute break complex tasks into steps
- 🔄 Consistent Results: Standardized approaches to common problems
- 🎯 Best Practices: Built-in industry standards and conventions
Available Template Categories
Browse all available templates in the Templates Library or use our Plan and Execute template for most complex tasks.
Custom Messages: Advanced Control
When you need complete control over the AI agent’s behavior, custom messages let you script exact workflows.Quick Custom Message Example
Message Structure
Each message in themessages array supports these fields:
Why Use Custom Messages?
- 🎯 Complete Control: Script exact conversation flows and agent behavior
- 🔧 Tool Selection: Choose specific tools for each step of your workflow
- 📁 Directory Focus: Limit the agent’s scope to specific repository parts
- 🔄 Conversation Flow: Continue previous contexts or start fresh sessions
Common Custom Message Patterns
1. Simple Single Task
Perfect for focused development tasks:2. Multi-Step Workflow
Chain related tasks with conversation continuity:3. Tool-Controlled Workflow
Control exactly which tools are used:5. Multi-Directory Workflow (Separate API Calls)
Work across different parts of your repository using separate API calls:Key Features
Available Tools
You can control which tools the AI agent uses:Working Directory Control
TheworkingDir field allows you to focus the AI agent on specific parts of your repository:
- Focus on specific modules or directories
- Large codebase organization
- Component-by-component refactoring
- Gradual migration workflows
- Targeted testing and validation
Response Format
The API returns Server-Sent Events (SSE) with these event types:- Authentication:
{"auth": "Authenticated Successfully!"} - Setup: Configuration and repository information
- Executor: Agent conversation and tool usage
- Push: Final commit and push status
When to Use Which Approach
Use Prebuilt Templates When:
- ✅ You want to get started quickly
- ✅ Your task fits a common pattern (planning, testing, deployment)
- ✅ You prefer battle-tested workflows
- ✅ You’re new to the Cloud Coding API
a2ef2e64-40e2-4c6a-99fc-767e3a30a963) for complex tasks.
Use Custom Messages When:
- ✅ You need precise control over AI behavior
- ✅ Your workflow doesn’t match existing templates
- ✅ You want to specify exact tools for each step
- ✅ You need conversation continuity across steps
Next Steps
For Beginners
- Browse Templates: Check the Templates Library for ready-to-use workflows
- Try Plan & Execute: Use template
a2ef2e64-40e2-4c6a-99fc-767e3a30a963for your first complex task - Learn Variables: Understand how to customize templates with variables
For Advanced Users
- Custom Messages: Read the Custom Templates Guide for complete control
- Workflow Patterns: Learn advanced patterns like tool selection and conversation flow
- Integration: Build custom integrations using the API
Common Parameters
Model Selection Guide
- Haiku (
"haiku": true): Fast, cost-effective for simple tasks - Sonnet (
"haiku": false): More powerful for complex reasoning and large codebases
Getting Help
- 📚 Templates: Browse the Templates Library for prebuilt workflows
- 🛠️ Custom Messages: Read the Custom Templates Guide for advanced control
- 💬 Support: Contact our team for help with complex use cases
Pro Tip
Start with the Plan and Execute template (
a2ef2e64-40e2-4c6a-99fc-767e3a30a963) for your first complex task. It breaks down work into manageable steps automatically.