# Prompt

URL: https://docs.hanzo.ai/docs/openapi/prompt

> Your prompt library, versioned, so nothing changes silently.

Also for this capability: **API** · [CLI](https://docs.hanzo.ai/docs/cli/prompt) · [MCP](https://docs.hanzo.ai/docs/mcp-tools/prompt) · [SDKs](https://docs.hanzo.ai/docs/sdks)

Your prompt library, versioned, so nothing changes silently.

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

|                |                                        |
| -------------- | -------------------------------------- |
| **Base URL**   | `https://api.hanzo.ai`                 |
| **Operations** | 6                                      |
| **Auth**       | `Authorization: Bearer $HANZO_API_KEY` |

## Specification

Specification pending — no HIP in [hanzoai/hips](https://github.com/hanzoai/hips) declares `capability: prompt` yet. What this capability serves is below, from the API document; what it is — the store it owns, how it meters, what it publishes — is written as a HIP under HIP-0139.

## Four surfaces

| Surface  | Reaches this capability as                     | Coverage                                                                  |
| -------- | ---------------------------------------------- | ------------------------------------------------------------------------- |
| **REST** | `prompt` at its own prefix                     | 6 operations                                                              |
| **CLI**  | `hanzo prompt …`                               | 6 of 6                                                                    |
| **SDK**  | `PromptApi` in every published client          | 6 methods                                                                 |
| **MCP**  | tool `prompt` on `https://api.hanzo.ai/v1/mcp` | 6 operations, 2 under the document's own id — ask `describe` for the rest |

## Quickstart

```bash
export HANZO_API_KEY=sk-...   # console.hanzo.ai → API keys
```

Then the first call — a read that needs nothing but the key. `GET /v1/prompt`, operation `get_prompt`:

**CLI**

```bash
hanzo prompt list
```

**SDK**

**.ts**

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

const api = new PromptApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getPrompt();
```

**.py**

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

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = PromptApi(client).get_prompt()
```

**.go**

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

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

**.rs**

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

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

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

**.java**

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

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

var result = new PromptApi(client).getPrompt();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/prompt \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **prompt** through the `prompt` tool, which names its 6 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_prompts"
         }
       }
     }'
```

Answers `200` with `object` — ok.

## Endpoints

| Endpoint                                                                                      | What it does                                                                                                                                                                 |
| --------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`GET /v1/prompt/{name}`](https://docs.hanzo.ai/docs/openapi/prompt/get-prompt-by-name)       | Returns one of the caller org's prompts: its CURRENT template text plus the metadata of every version it has had.                                                            |
| [`DELETE /v1/prompt/{name}`](https://docs.hanzo.ai/docs/openapi/prompt/delete-prompt-by-name) | Removes one of the caller org's prompts and every version of it, answering 204.                                                                                              |
| [`GET /v1/prompt/catalog`](https://docs.hanzo.ai/docs/openapi/prompt/get-prompt-catalog)      | Returns the read-only starter prompt library shipped with the binary — reference content every tenant sees the same, NOT the caller's own prompts and never mixed into them. |
| [`GET /v1/prompt/metrics`](https://docs.hanzo.ai/docs/openapi/prompt/get-prompt-metrics)      | Returns real per-prompt statistics for the caller's org: how many versions each prompt has, which one is current, and when it was created and last changed.                  |
| [`GET /v1/prompt`](https://docs.hanzo.ai/docs/openapi/prompt/get-prompt)                      | Returns the caller org's prompt library as one row per prompt: its name, type, every version number it has, its taxonomy and when it last changed.                           |
| [`POST /v1/prompt`](https://docs.hanzo.ai/docs/openapi/prompt/post-prompt)                    | Records a prompt for the caller's org and answers 201 with it.                                                                                                               |

---

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