---
title: "Start Code Gen Task"
method: POST
path: "/api/start-code-gen-task"
---

# Start Code Gen Task

`POST /api/start-code-gen-task`

Start a Fargate task for code generation with specified parameters.

This endpoint launches an ECS Fargate task with the provided configuration
as environment variables.

Alternatively, if `use_claude_gha` is True, creates a GitHub issue with @claude
in the body to trigger the Claude Code GitHub Action workflow.

Network Configuration:
- If subnets are not provided, the default VPC's subnets will be used automatically
- If security groups are not provided, the default security group will be used
- Fargate requires subnets because each task gets its own network interface (awsvpc mode)

## Request body

- CodeGenRequest — Request model for starting a code generation task
  - `target_repo` string, required
  - `target_base_branch` string, required
  - `github_app_installation_id` integer, required
  - `target_repo_owner` string, required
  - `target_repo_name` string, required
  - `initial_prompt` string, required
  - `slack_channel_id` string, nullable
  - `slack_message_ts` string, nullable
  - `team_id` string, nullable
  - `cluster_name` string, nullable
  - `task_definition` string, nullable
  - `subnets` string[], nullable
  - `security_groups` string[], nullable
  - `use_claude_gha` boolean
  - `issue_title` string, nullable
  - `use_modal` boolean
  - `requester_name` string, nullable
  - `requester_email` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/deeptrace/apis/fastapi.md) · [All operations](https://skmtc.net/deeptrace/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deeptrace/fastapi/versions/2e2a6de8aeda/schema)
