Skip to main content

Public model catalogue

The public catalogue is a read only route, GET /public/catalogue, that lists the model groups you have published with their price per million tokens, context window, capability flags, p50 and p95 latency, error rate, request count and the latest health check result. It needs no key, answers from a cache and carries the headers a browser on another origin needs, so a public website or status page can read it directly.

A real-world scenario​

A company sells an assistant built on the gateway and wants a models page on its website that shows the live price and latency of every model it offers. The page used to be a hand edited table that was always out of date. The admin publishes the three customer facing model groups, turns the catalogue on, and the website fetches /public/catalogue in the browser. A CDN caches the answer for a minute, so a thousand visitors cost the gateway one database query, and when one model's error rate climbs the page shows it before support tickets arrive.

Steps​

  1. Publish the model groups. In the Admin UI open AI Hub under Developer Tools, click Select Models to Make Public, tick the groups, click Next, read the confirmation and click Make Public. From the command line:

    curl -X POST http://localhost:4000/model_group/make_public \
    -H "Authorization: Bearer $SPANWAY_API_KEY" -H "Content-Type: application/json" \
    -d '{"model_groups": ["claude-sonnet-5-5", "claude-haiku-5-5"]}'

    The list you send is the whole public list, so a group left out stops being public. The same list feeds the AI hub and the status page.

  2. Turn the catalogue on. It is off by default. In the Admin UI open Status Page, find the Public catalogue card under Public surfaces, switch on Publish the model catalogue, and if you want other numbers, change Aggregation window (hours) and Cache lifetime (seconds) and click Save. The change takes effect at once, with no restart. A value set in the config file wins and is shown as locked. In the config file it is:

    general_settings:
    public_catalogue: true
    public_catalogue_window_hours: 24
    public_catalogue_cache_seconds: 60
    KeyDefaultWhat it does
    public_cataloguefalseOn, anyone on the internet can read the list of your public models with their prices, limits, speed and error rate, without a key. That helps customers compare models before they sign up, and it also makes the names of your public models and their traffic figures public. Off, the route answers 404.
    public_catalogue_window_hours24Rolling window of request logs that latency, error rate and request count are aggregated over. A longer window smooths out a bad hour, a shorter one reacts faster.
    public_catalogue_cache_seconds60How long the computed answer stays in the gateway cache, and the max-age sent in Cache-Control. Longer means fewer database queries but staler numbers.
  3. Read it, without a key.

    curl -sD - http://localhost:4000/public/catalogue
  4. Point your site at it. A page on your own website can call https://<your gateway>/public/catalogue from the browser with fetch, because the response carries Access-Control-Allow-Origin: *. If your site sends a Content Security Policy, add your gateway's origin to its connect-src.

Expected result​

{
"generated_at": "2026-11-20T12:00:00+00:00",
"window_hours": 24,
"models": [
{
"model_name": "claude-sonnet-5-5",
"provider": "anthropic",
"mode": "chat",
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"input_cost_per_million": 2.0,
"output_cost_per_million": 10.0,
"supports": ["function_calling", "reasoning", "vision"],
"p50_latency_ms": 812.5,
"p95_latency_ms": 2100.0,
"error_rate": 0.01,
"request_count": 400,
"last_health": "healthy",
"last_health_at": "2026-11-20T11:55:00+00:00"
}
]
}

The response carries Cache-Control: public, max-age=60 and Access-Control-Allow-Origin: *, so a CDN can cache it and a static site on another domain can fetch it from the browser. When the public list is empty the route returns an empty models array, it never falls back to listing every model.

Where each field comes from​

Price, token limits, mode and the supports flags come from the same model group lookup the AI hub and the Admin UI use, so custom pricing is reflected. provider lists every provider behind the model group, comma separated, when it routes to more than one.

Latency, error rate and request count come from one aggregate query over the spend logs for the window, grouped by model group. Latency percentiles are computed over successful requests only. A model with no traffic in the window has null for all three and a request_count of 0.

last_health is the result of the most recent stored health check for the model, healthy or unhealthy, and unknown when no check has been stored. last_health_at is the time of that check.

Privacy​

Only model groups you marked public are listed. Everything about traffic is an aggregate per model over the window. The route reads the database only and never writes. If the names of your models are themselves sensitive, leave the feature off.

Errors​

What you seeWhyFix
404 {"detail": "Public catalogue is not enabled"}public_catalogue is off.Switch it on under Status Page, Public surfaces, or in the config file.
400 {"detail": "No models configured on proxy"}The gateway has no deployments loaded yet.Add at least one deployment and wait for the reload.
200 with "models": []Nothing is published. The route never lists every model.Publish groups as in step 1.
A model with no provider and null pricesThe name is on the public list but the model group no longer exists.Remove it from the public list.
Latency and error rate are null, request_count 0No successful requests in the window, no database to read request logs from, or the traffic query failed (see Logs).Send traffic, widen public_catalogue_window_hours, or check the database.
last_health is unknownNo health check has been stored for the model.Turn on background_health_checks as described in health checks.
The answer is stale for up to a minute after a changeIt is cached for public_catalogue_cache_seconds.Lower the value, or wait.
The browser blocks the fetchThe site's Content Security Policy does not allow the gateway origin.Add the gateway origin to connect-src.

Logs​

LevelLineMeaning and action
ERRORError aggregating public catalogue traffic: <error>The catalogue could not read request statistics. It keeps answering, with prices, limits and health only, and p50_latency_ms, p95_latency_ms, error_rate are null and request_count 0 until the next cache rebuild works. Check the database.