Publish offers one tool on the marketplace, optionally monetized.
Publish offers one tool on the marketplace, optionally monetized.
POST /v1/marketplace/listings
| Address | https://api.hanzo.ai/v1/marketplace/listings |
| Method | POST |
| Operation | post_marketplace_listings |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Publish offers one tool on the marketplace, optionally monetized. The tool must already resolve in the publisher's own scope, so a listing can never advertise a capability that does not exist; a listing with a price must name the payout wallet the x402 seam settles to, so a monetized offer is never unpayable. The price is exact to 18 decimal places, so a per-call price below a cent is a real price and not a rounded-away zero. The listing is owned by the publishing org, paid into a wallet of that same org, and answers 201 with the created row.
Request
8 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
category | body | string | — | Category groups the listing in the shop window. |
currency | body | string | — | Currency denominates Price. |
description | body | string | — | Description is the long copy, clipped at 4096 characters. |
price | body | string | — | Price is the per-call price as a decimal USD string, exact to 18 places — "0.0025" is a quarter of a cent and stays one. |
public | body | boolean | — | Public makes the listing discoverable by other orgs. |
recipient | body | string | — | Recipient is the seller's payout wallet ID, in the publishing org — the wallet x402 pays. |
title | body | string | — | Title is the shop-window name, 1-200 characters. |
tool | body | string | — | Tool is the registry name of the capability being offered. |
Response
| Status | Body | Meaning |
|---|---|---|
201 | Listing | created |
201 body — 11 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
category | body | string | — | Category groups the listing in the shop window. |
createdAt | body | integer | — | CreatedAt is when the listing was published, in Unix SECONDS, minted at insert. |
currency | body | string | — | Currency is the ISO 4217 code Price is quoted in; Create defaults it to "USD" when the publisher names none. |
description | body | string | — | Description is the long copy. |
id | body | string | — | ID is the listing's id, minted here as "lst_" + 16 hex characters. A publisher cannot choose it: Create overwrites whatever arrives. |
price | body | any | — | exact per-call price; 0 is free. |
public | body | boolean | — | Public is whether other orgs can discover the listing. |
publisherOrg | body | string | — | PublisherOrg is the org that published the listing, taken from the validated principal and never off the wire. |
recipient | body | string | — | seller payout WALLET ID, in PublisherOrg. |
title | body | string | — | Title is the shop-window name, required and refused past 200 bytes. |
tool | body | string | — | Tool is the registry name of the offered capability, in the flat fleet-wide tool namespace. |
Failure carries the platform error shape — see Errors.
Examples
hanzo marketplace listings createimport { Configuration, MarketplaceApi } from 'hanzoai';
const api = new MarketplaceApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postMarketplaceListings({ category: "<category>", currency: "<currency>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import MarketplaceApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = MarketplaceApi(client).post_marketplace_listings(category="<category>", currency="<currency>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.MarketplaceAPI.PostMarketplaceListings(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, marketplace_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = marketplace_api::post_marketplace_listings(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.MarketplaceApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new MarketplaceApi(client).postMarketplaceListings();curl -X POST https://api.hanzo.ai/v1/marketplace/listings \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"category": "<category>",
"currency": "<currency>"
}'The door reaches marketplace through the marketplace 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": "get_marketplace"
}
}
}'How is this guide?