b13d5c7b8a spec: codegen-clean hanzo.yaml + retire Stainless (openapi-generator for all langs) (#24)
* fix(spec): add SPDX license identifier (openapi-generator 3.1 requires it)

openapi-generator 7.14.0 errors 'info.license.identifier is missing' for 3.1
specs. Add the SPDX custom identifier LicenseRef-Hanzo-Proprietary alongside the
Proprietary name. Last spec-validation blocker for the openapi-generator path.

* fix(spec): make hanzo.yaml fully codegen-clean for python/go/ts

Retire Stainless: python/go/js SDKs now generate from hanzo.yaml via
openapi-generator (like cpp/dart). These spec fixes make the merged
surface compile clean across the go, python (pydantic v2) and
typescript-axios generators — all verified locally at 0 errors.

- pubsub ack_wait: type integer default 30000000000 (ns) overflows int32
  -> format: int64 (Go build fix).
- platform DeployJob/CancelDeploymentJob: oneOf of inline anonymous
  objects + `const` emitted an empty TS union type. Extract each variant
  into a named component schema referenced by $ref, and use enum:[x]
  instead of const:x for cross-generator support.
- merge.py: namespace operation tags per-service (svc_Tag), same
  discipline as schemas/operationIds. Cross-service tag collisions
  (even case-only, MCP/mcp, API Keys/api-keys) were fusing unrelated
  ops into one cross-contaminated API class and colliding on
  case-insensitive filesystems. Collapse to a single primary tag so one
  op maps to exactly one API class (no duplicate request models). Also
  namespace discriminator.mapping pointers, which prefix() missed.

* ci: retire Stainless — dispatch spec-update to python/go/js SDK repos

python/go/js now generate from hanzo.yaml with openapi-generator (like
cpp/dart), each repo owning its scripts/generate.sh + generate.yml. The
regenerate workflow replaces the Stainless build job with a
repository_dispatch(spec-update) fan-out to the three repos. LLM.md SDK
section rewritten: Stainless retired, per-language generators + publish,
remaining /v1/memory + /v1/videos spec-coverage gaps recorded.

---------

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-04 20:07:24 -07:00
2026-06-01 12:43:33 -07:00
2026-06-01 12:43:33 -07:00
2026-06-01 12:43:34 -07:00
2026-06-01 12:43:35 -07:00
2026-06-01 12:43:36 -07:00
2026-06-01 12:43:37 -07:00
2026-06-01 12:43:38 -07:00
2026-06-01 12:43:38 -07:00
2026-06-01 12:43:39 -07:00
2026-06-01 12:43:40 -07:00
2026-06-01 12:43:41 -07:00
2026-06-01 12:43:41 -07:00
2026-06-01 12:43:42 -07:00
2026-06-01 12:43:43 -07:00
2026-06-01 12:43:43 -07:00
2026-06-01 12:43:44 -07:00
2026-06-01 12:43:45 -07:00
2026-06-01 12:43:45 -07:00
2026-06-01 12:43:46 -07:00
2026-06-01 12:43:46 -07:00
2026-06-01 12:43:47 -07:00
2026-06-01 12:43:47 -07:00
2026-06-01 12:43:48 -07:00
2026-06-01 12:43:49 -07:00
2026-06-01 12:43:50 -07:00
2026-06-01 12:43:51 -07:00
2026-06-01 12:44:10 -07:00
2026-06-01 12:43:51 -07:00
2026-06-01 12:43:52 -07:00

openapi

Hanzo OpenAPI

OpenAPI 3.1 specifications for every Hanzo service. v1.0.0 — locked in.

Forward-only. No backwards compatibility. No deprecated paths. No /api/ prefixes. No cross-brand references.

Single bearer JWT issued by Hanzo IAM (https://hanzo.id) authenticates every service. Every route is /v1/<service>/<resource> so the same path works through the gateway (api.hanzo.ai) and through the service's own hostname (<service>.hanzo.ai).

One exception — AI inference is top-level. The ai service (hanzoai/ai) exposes its OpenAI- and Claude-compatible surface at the bare /v1/* paths (/v1/chat/completions, /v1/completions, /v1/embeddings, /v1/models, /v1/rerank, /v1/messages) — NOT /v1/ai/* — because every OpenAI/Anthropic SDK hard-codes those paths, so the path is the compatibility contract. Everything else stays under /v1/<service>/.

# AI inference (top-level, OpenAI-compatible)
curl -H "Authorization: Bearer ${HANZO_TOKEN}" \
     https://api.hanzo.ai/v1/chat/completions -d '{"model":"zen5","messages":[...]}'

# Control-plane (per-service prefix)
curl -H "Authorization: Bearer ${HANZO_TOKEN}" \
     https://api.hanzo.ai/v1/cloud/get-providers

OIDC discovery: https://hanzo.id/.well-known/openid-configuration

Service Index

Service Spec Hostname Gateway prefix
ai ai/openapi.yaml api.hanzo.ai /v1/{chat,completions,embeddings,models,rerank,messages} (top-level — OpenAI/Claude-compatible)
analytics analytics/openapi.yaml analytics.hanzo.ai /v1/analytics
app app/openapi.yaml api.hanzo.ai /v1/projects (top-level — hanzo.app projects & deploy)
auto auto/openapi.yaml auto.hanzo.ai /v1/auto
base base/openapi.yaml base.hanzo.ai /v1/collections (top-level — Base records store)
bot bot/openapi.yaml app.hanzo.bot /v1/bot
chat chat/openapi.yaml hanzo.chat /v1/chat
cloud cloud/openapi.yaml api.hanzo.ai /v1/cloud
commerce commerce/openapi.yaml commerce.hanzo.ai /v1/commerce
console console/openapi.yaml console.hanzo.ai /v1/console
db db/openapi.yaml db.hanzo.ai /v1/db
did did/openapi.yaml did.hanzo.ai /v1/did
dns dns/openapi.yaml dns.hanzo.ai /v1/dns
edge edge/openapi.yaml edge.hanzo.ai /v1/edge
engine engine/openapi.yaml engine.hanzo.ai /v1/engine
flow flow/openapi.yaml flow.hanzo.ai /v1/flow
gateway gateway/openapi.yaml api.hanzo.ai /v1/gateway
guard guard/openapi.yaml guard.hanzo.ai /v1/guard
iam iam/openapi.yaml hanzo.id /v1/iam + /oauth/* + /.well-known/*
kms kms/openapi.yaml kms.hanzo.ai /v1/kms
kv kv/openapi.yaml kv.hanzo.ai /v1/kv
ml ml/openapi.yaml ml.hanzo.ai /v1/ml
mq mq/openapi.yaml mq.hanzo.ai /v1/mq
nexus nexus/openapi.yaml nexus.hanzo.ai /v1/nexus
o11y o11y/openapi.yaml o11y.hanzo.ai /v1/o11y
operative operative/openapi.yaml operative.hanzo.ai /v1/operative
paas paas/openapi.yaml paas.hanzo.ai /v1/paas
platform platform/openapi.yaml platform.hanzo.ai /v1/platform
pricing pricing/openapi.yaml pricing.hanzo.ai /v1/pricing
pubsub pubsub/openapi.yaml pubsub.hanzo.ai /v1/pubsub
registry registry/openapi.yaml registry.hanzo.ai /v1/registry
s3 s3/openapi.yaml s3.hanzo.ai /v1/s3
search search/openapi.yaml search.hanzo.ai /v1/search
stream stream/openapi.yaml stream.hanzo.ai /v1/stream
vector vector/openapi.yaml vector.hanzo.ai /v1/vector
visor visor/openapi.yaml vm.hanzo.ai /v1/visor
zt zt/openapi.yaml zt.hanzo.ai /v1/zt

Discovery: hanzo.yaml at https://api.hanzo.ai/v1/discovery returns the canonical list of services with their spec URLs.

v1.0.0 Conventions

  • Versioning: info.version: 1.0.0 on every service. There is no v0. There will be no v2. Breaking changes ship as new resources or new endpoints under /v1/, never as a parallel /v2/ tree.
  • Routing: every route is /v1/<service>/<resource>. No /api/ prefix. IAM additionally exposes /oauth/* (RFC 6749) and /.well-known/* (RFC 5785) for OIDC discovery.
  • Security: every operation uses BearerAuth (JWT from Hanzo IAM). No service has its own login flow.
  • Cross-file $ref: never. Each service spec is self-contained.
  • Errors: 4xx for client errors, 5xx for server errors. Every error response has a JSON body with a status and msg.

Validate

# Parse + schema validation across all specs:
python3 -c "import yaml, glob, sys; \
  [yaml.safe_load(open(s)) for s in glob.glob('*/openapi.yaml') + ['hanzo.yaml']]; \
  print('OK')"

# Spectral lint per spec:
for spec in */openapi.yaml hanzo.yaml; do
  npx -y @stoplight/spectral-cli lint "$spec"
done

# Redoc preview:
npx -y @redocly/cli preview-docs hanzo.yaml

Code generation

hanzo.yaml (regenerated by merge.py) is the single source of truth every official SDK derives from. One way per SDK:

Status (2026-07): the Stainless project hanzo-ai still points at the legacy LLM-gateway spec, so the published python/go/js SDKs cover the inference + gateway-admin surface only — NOT the cloud products. Repoint it to hanzo.yaml and close the ~28 missing product specs first. See the SDK generation reconciliation section in LLM.md.

Regenerate the Stainless SDKs (canonical)

The JS, Python and Go SDKs are generated by the Stainless project hanzo-ai. Pushing an updated spec regenerates all three and opens a PR on each SDK repo:

export STAINLESS_API_KEY="$(hanzo kms secret get stainless-api-key)"  # kms.hanzo.ai
stl builds create --project hanzo-ai --branch main hanzo.yaml         # npm i -g @stainless-api/cli

Each SDK repo's .stats.yml records the spec hash it was built from. Tag a semver release in the SDK repo after the PR merges.

One-off client from any spec (openapi-generator)

# Python client for the cloud service:
npx -y @openapitools/openapi-generator-cli generate \
  -i cloud/openapi.yaml -g python -o clients/python/cloud

# TypeScript client for the whole surface:
npx -y @openapitools/openapi-generator-cli generate \
  -i hanzo.yaml -g typescript-axios -o clients/ts/hanzo

License

Proprietary. Copyright 2024-2026 Hanzo AI, Inc.

S
Description
Mirror of github.com/hanzoai/openapi
Readme
22 MiB
Languages
Mustache 52.8%
Python 43.7%
Go 0.9%
Shell 0.8%
Java 0.3%
Other 1.5%