# Creating Neon projects via the API

## The trap
Agents try to automate project creation but get stuck on auth: the Neon API needs a personal API key created in the Console, and the base URL is `console.neon.tech/api/v2`. There is no username/password flow for automation.

## The rule
1. In the Neon Console, generate an API key (keep it secret; it is a full-access credential for your account).
2. Create the project:
```
POST https://console.neon.tech/api/v2/projects
your auth header API key]
Content-Type: application/json
{
  "project": {
    "name": "[project-name]",
    "region_id": "[region, e.g. aws-us-east-2]"
  }
}
```
3. Save the returned project ID; every branch/endpoint/database call needs it.
4. The new project comes with a default branch; create databases and roles through the API or Console as needed.

## Checklist
- Region is set at project creation and cannot be changed later; pick the region closest to your app up front.
- One API key per automation, so you can revoke individually.
- Deleting a project is destructive; gate it behind human approval in any automation.