# Create sites — POST /v1/projects/sites

URL: https://docs.hanzo.ai/docs/openapi/project/post-projects-sites

> Generates a self-contained, mobile-responsive static site from a natural-language brief and deploys it live in one call.

`POST /v1/projects/sites`

> [Project →](https://docs.hanzo.ai/docs/openapi/project) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                          |
| ------------- | ---------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/projects/sites` |
| **Method**    | `POST`                                   |
| **Operation** | `post_projects_sites`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`   |

Generates a self-contained, mobile-responsive static site from a
natural-language brief and deploys it live in one call.

One inference call turns `brief` (capped at 8 KiB) into a file manifest, which
then runs through the SAME validation, guards and viewport guarantee as a
hand-supplied manifest: index.html required at the root, absolute and
traversal paths rejected, per-file and total size capped, and a mobile
viewport meta tag injected into every HTML document that lacks one. The
generated site is fully inline — no CDNs, no remote fonts or images — so it is
CSP-safe. `slug` and `name` are optional: the model's own title is preferred,
and a slug is derived or minted when none is given.

It writes into the SAME org-scoped store as /v1/project — it ensures a
project (framework `static`) for the resolved slug and records a deployment —
so this is a second entry point to one publish pipeline, not a second copy of
project state. Publishing is free; what is billed is the model's tokens, to the
caller's own ledger, and the storage the org holds past the free tier. The
storage gate runs BEFORE any inference or upload, so an org past the tier that
cannot pay a month of what it holds (402, or 503 when commerce is unreachable)
generates and uploads NOTHING.

Answers 503 when object storage or inference is unconfigured, and 400 when the
model's manifest cannot be parsed or fails the guards.

Scope: a validated principal is required (401 without one) and the site is
published into THAT principal's org.

## Request

4 fields, body `application/json` (required).

| Field   | In   | Type   | Required | Description                                                |
| ------- | ---- | ------ | -------- | ---------------------------------------------------------- |
| `brief` | body | string | —        | Brief is what the site should be, in plain language.       |
| `model` | body | string | —        | Model names which model writes the site.                   |
| `name`  | body | string | —        | Name is the site's display name.                           |
| `slug`  | body | string | —        | Slug is the handle and public host label to publish under. |

## Response

| Status    | Body                       | Meaning |
| --------- | -------------------------- | ------- |
| `200`     | project.projectsSiteDeploy | ok      |
| `default` | problem-details            | refused |

`200` body — 6 fields.

| Field          | In   | Type      | Always | Description                                                                                                                          |
| -------------- | ---- | --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| `deploymentId` | body | string    | —      | DeploymentID is the deployment this publish recorded, for the history.                                                               |
| `files`        | body | string\[] | —      | Files are the site-relative paths that were uploaded, sorted.                                                                        |
| `name`         | body | string    | —      | Name is the project's display name.                                                                                                  |
| `slug`         | body | string    | —      | Slug is the project the site was published into, created on the fly when the slug was free.                                          |
| `status`       | body | string    | —      | Status is the deployment status, "live" on success.                                                                                  |
| `url`          | body | string    | —      | URL is the canonical live URL, https\://\<slug>.\<apex> — empty when the subdomain belongs to another tenant and this site has none. |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo projects sites create
```

**SDK**

**.ts**

```ts
import { Configuration, ProjectApi } from 'hanzoai';

const api = new ProjectApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postProjectsSites({ brief: "<brief>", model: "<model>" });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ProjectApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ProjectApi(client).post_projects_sites(brief="<brief>", model="<model>")
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.ProjectAPI.PostProjectsSites(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, project_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = project_api::post_projects_sites(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ProjectApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new ProjectApi(client).postProjectsSites();
```

The method above is the one at the current release of the document. `hanzoai@8.5.914` (npm) and `hanzoai@8.5.914` (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. [SDKs →](https://docs.hanzo.ai/docs/sdks)

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/projects/sites \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "brief": "<brief>",
       "model": "<model>"
     }'
```

**MCP**

Tool `project`, op `post_projects_sites` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "project",
         "arguments": {
           "op": "post_projects_sites",
           "input": {
             "brief": "<brief>",
             "model": "<model>"
           }
         }
       }
     }'
```

---

[Project API](https://docs.hanzo.ai/docs/openapi/project) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
