Metrics returns real per-prompt statistics for the caller's org: how many…
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…
GET /v1/prompt/metrics
| Address | https://api.hanzo.ai/v1/prompt/metrics |
| Method | GET |
| Operation | get_prompt_metrics |
| Auth | Authorization: Bearer $HANZO_API_KEY |
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. Every number is counted from the store — nothing here is estimated or fabricated.
Request
GET /v1/prompt/metrics takes no parameters and no body — the credential is the whole request.
Response
| Status | Body | Meaning |
|---|---|---|
200 | metricList | ok |
200 body — 7 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
data | body | metricRow[] | — | Data is one row per prompt the org owns. |
data[].createdAt | body | string | — | CreatedAt is when version 1 was written, RFC 3339 UTC. |
data[].currentVersion | body | integer | — | CurrentVer is the version number served as current. |
data[].lastUpdatedAt | body | string | — | LastUpdatedAt is when the newest version was appended, RFC 3339 UTC — the age of the template you would get today. |
data[].name | body | string | — | Name is the prompt this row is about — its org-unique handle. |
data[].type | body | string | — | Type is the current version's kind. |
data[].versions | body | integer | — | Versions is how many revisions the prompt has, COUNTED in the store and uncapped — so it can exceed the 100 entries a list row or a detail response carries. |
Failure carries the platform error shape — see Errors.
Examples
hanzo prompts metricsimport { Configuration, PromptApi } from 'hanzoai';
const api = new PromptApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getPromptMetrics();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_metrics()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.PromptAPI.GetPromptMetrics(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_metrics(&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).getPromptMetrics();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/metrics \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches prompt through the prompts tool, which names its 6 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
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"
}
}
}'How is this guide?