Setup

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

API Reference

The Cloud Coding API provides a powerful, production-ready streaming endpoint for all your coding tasks.

The /invoke/stdout endpoint is recommended for production use. It provides a real-time, unfiltered stream of events from the agent, including stdout from executed tools.

Endpoint

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

Headers

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

Request Body

FieldTypeRequiredDescription
repo_urlstringThe URL of the GitHub repository for the agent to work with.
github_tokenstringA GitHub personal access token with repository access.
messagesarray▶️An array of messages for a single task invocation.
parallel_tasksarray▶️An array of task objects to execute in parallel.
branchstringThe Git branch to work with. Defaults to main.
haikubooleanWhether to use the Haiku model. Defaults to false.
thread_idstringAn existing thread ID to continue a conversation.

Note: You must provide either messages or parallel_tasks.

Response Stream

The API returns a stream of Server-Sent Events (SSE). Each event has an event type (updates or custom) and a data payload.

Example updates event:

{
  "event": "updates",
  "data": { "run_id": "...", "messages": [...], "stream_events": [] }
}

Example custom event (tool stdout):

{
  "event": "custom",
  "data": { "task_name": "...", "stdout": "..." }
}

Quick Examples

Single Task Invocation

Invoke the agent to perform a single task.

curl -X POST "https://api.cloudcoding.ai/invoke/stdout" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --no-buffer \
  -d '{
    "repo_url": "https://github.com/username/repo-name",
    "github_token": "YOUR_GITHUB_TOKEN",
    "messages": [
      {
        "type": "human",
        "content": "analyze the repo to see what it is about"
      }
    ]
  }'

Parallel Task Invocation

Run multiple tasks concurrently. The stream will contain interleaved events from each task, identified by task_name.

curl -X POST "https://api.cloudcoding.ai/invoke/stdout" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  --no-buffer \
  -d '{
    "repo_url": "https://github.com/username/my-app",
    "github_token": "YOUR_GITHUB_TOKEN",
    "parallel_tasks": [
      {
        "prompt": "Add comprehensive error handling",
        "task_name": "error-handling"
      },
      {
        "prompt": "Create unit tests for all components",
        "task_name": "testing"
      }
    ]
  }'

Next Steps