Prompt
Package prompts is your prompt library, versioned, so nothing changes silently.
Package prompts is your prompt library, versioned, so nothing changes silently.
| Base URL | https://api.hanzo.ai |
| Operations | 6 |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Specification
Specification pending — no HIP in 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 prompts … | 6 of 6 |
| SDK | — | no published client declares one yet — regenerating the clients is what adds them |
| MCP | tool prompts on https://api.hanzo.ai/v1/mcp | 6 operations, 2 under the document's own id — ask describe for the rest |
Quickstart
export HANZO_API_KEY=sk-... # console.hanzo.ai → API keysThen the first call — a read that needs nothing but the key. GET /v1/prompt, operation get_prompt:
hanzo prompts listimport { Configuration, PromptApi } from 'hanzoai';
const api = new PromptApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getPrompt();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()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.PromptAPI.GetPrompt(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::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?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.PromptApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new PromptApi(client).getPrompt();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (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 →
curl https://api.hanzo.ai/v1/prompt \
-H "Authorization: Bearer $HANZO_API_KEY"Tool prompts, op get_prompt — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
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": "prompts",
"arguments": {
"op": "get_prompt",
"input": {}
}
}
}'Answers 200 with object — ok.
Endpoints
| Endpoint | What it does |
|---|---|
GET /v1/prompt/{name} | Get 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} | Delete removes one of the caller org's prompts and every version of it, answering 204. |
GET /v1/prompt/catalog | Catalog returns the read-only starter prompt library shipped with the binary — reference content every tenant sees the same, NOT the caller's own… |
GET /v1/prompt/metrics | 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… |
GET /v1/prompt | List 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… |
POST /v1/prompt | Create records a prompt for the caller's org and answers 201 with it. |
How is this guide?