Skip to main content

AI hub

The AI hub is a catalogue page on the gateway where developers can see what is available to them: which model groups exist, their context windows, prices, supported parameters and health, plus published agents, MCP servers and skills. It saves platform teams from maintaining a separate wiki of model names. The hub lives at /ui/model_hub_table in the Admin UI and is backed by public read-only endpoints.

A real-world scenario​

A company has forty model groups on its gateway and developers keep asking in chat which ones they may use and what they cost. The platform admin marks the twelve approved model groups public from the Model hub page. Developers now open the hub, see each model's context window, price, capability flags and latest health check, and ask for access to the ones they need through access requests. The admin leaves the hub closed to anonymous visitors, so only signed in people see the list.

Choosing what is public​

Nothing is public by default. A proxy admin picks which model groups appear in the public hub, either on the Model hub page in the Admin UI or with the API.

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"]}'

Agents and MCP servers are published the same way with /v1/agents/make_public and /v1/mcp/make_public. Each call replaces the whole list, and every change writes an audit row with the list before and after, see the audit log.

Publishing an MCP server only lists it on the hub. It does not change who may call it. A server marked internal network only (available_on_public_internet: false) stays reachable from internal addresses only after it is published, and every call still needs a key with access to it.

Skills work differently. The hub lists every enabled skill in the skills marketplace, so enabling a skill publishes it and disabling it takes it off the hub. There is no separate publish step.

If you delete a model group that is still on the public list, the hub keeps showing its name as a row with no provider and no price. Remove it from the list with /model_group/make_public (or public_model_groups in the config) when you delete the model.

Who can open the hub​

The hub is closed to anonymous visitors by default. Signed in users and callers with a valid key can always open it, and the gateway answers every hub endpoint below with a 401 for anyone else, while the hub page sends them to the login page.

To let anyone who can reach the gateway browse the hub without signing in, turn on Open the AI Hub to anyone without signing in under Settings, Admin Settings, UI Settings, or set it in the config file.

general_settings:
enable_public_model_hub: true

Only what you made public appears, but an open hub shows those model names, prices and health to anyone on the network, so leave it off if that list is sensitive. The older require_auth_for_public_ai_hub setting still closes the hub when it is true, even if enable_public_model_hub is on, and turning the hub on from the Admin UI clears it.

Public endpoints​

MethodPathSummary
GET/public/agent_hubList the agents published on the AI hub
GET/public/mcp_hubList the MCP servers published on the AI hub
GET/public/model_hubList the model groups published on the AI hub
GET/public/skill_hubList the skills published on the AI hub
GET/public/model_hub/infoGet the AI hub title, description and useful links
GET/public/providersList the provider names the gateway supports
GET/public/providers/fieldsDescribe the credential fields each provider needs
GET/public/endpointsList the LLM endpoints and the providers that support each
GET/public/v1/model_hubBrowse the published models
GET/public/v1/model_hub/{facet}List the filter values of the published models

GET /public/model_hub returns the public model groups with provider, mode, token limits, prices per token, supported OpenAI parameters and the latest health check result for each. GET /public/model_hub/info returns hub metadata, including any useful links an admin configured. It does not report the gateway version, so an anonymous visitor cannot use it to look up known issues in a release. Useful links must be absolute http:// or https:// URLs, and POST /model_hub/update_useful_links refuses any other scheme with 422. The facet endpoints under /public/v1/model_hub power the filters in the UI.

Paging, sorting and filtering​

GET /public/v1/model_hub is the paged version of the model list, which the hub page uses. It answers {"data": [...], "meta": {"total_count", "page", "page_size", "total_pages"}, "links": {...}}.

ParameterDefaultWhat it does
page1The page to return.
page_size50Rows per page, at most 100.
sortmodel_groupOne of model_group, mode, providers, max_input_tokens, max_output_tokens, input_cost_per_token, output_cost_per_token, rpm and tpm. A leading - sorts descending, for example sort=-input_cost_per_token.
searchnoneFinds model groups whose name contains the text.
filter[mode][in], filter[providers][contains], filter[features][in]noneKeep only rows that match, for example filter[mode][in]=chat.

GET /public/v1/model_hub/providers, /modes and /features list the distinct values the filters can take, with the same search and filters applied, so a dropdown only offers values the table can show.

curl "http://localhost:4000/public/v1/model_hub?sort=-input_cost_per_token&filter[mode][in]=chat&page_size=10" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

A parameter, sort field or filter the route does not accept answers 400 with a list of the ones it would have accepted. Both routes follow the same access rule as the rest of the hub.

What the hub shows for each model​

For every public model group the hub lists the providers behind it, the mode (chat, embedding, image and so on), the maximum input and output tokens, input and output prices, capability flags such as function calling, vision and reasoning, the parameters the gateway accepts for it, and whether the latest health check passed. Prices come from the bundled price map or your custom pricing.

Signed-in view​

A signed-in developer who is not an admin sees the same public list inside the Admin UI. The hub shows what an admin made public, not which of those models the developer's own keys can call. To see that, call GET /model_group/info with the key, which returns the model group details for the models that key has access to and is the endpoint to use from scripts, or open Virtual Keys and look at the key's models.

Publish the hub step by step​

  1. In the Admin UI open AI Hub and stay on the Model Hub tab. Click Select Models to Make Public, pick the model groups, click Next, then Make Public, or use POST /model_group/make_public as shown above.

  2. Read the public list the way the hub page does:

    curl http://localhost:4000/public/model_hub -H "Authorization: Bearer $SPANWAY_API_KEY"

    Expected result: one entry per public model group with providers, mode, max_input_tokens, max_output_tokens, the per token prices, the supported_openai_params and the latest health check result.

  3. Decide who may open it. To let anyone on the network browse without signing in, open Settings, Admin Settings, the UI Settings tab, switch on Open the AI Hub to anyone without signing in and save. Then confirm from a shell without a key:

    curl http://localhost:4000/public/model_hub/info

    Expected result: {"docs_title": "Spanway API", "custom_docs_description": null, "useful_links": {...}} when the hub is open, and 401 when it is closed.

  4. Open /ui/model_hub_table in a browser and check that only the published model groups appear, each with the price you expect from the bundled map or your custom pricing. The same models also show at /ui/model_hub, a card view of the public hub that needs no sign-in either.

Errors​

StatusRouteMeaningFix
401 Authentication Error, No api key passed in.every /public/*_hub route and /public/v1/model_hubThe hub is closed to anonymous visitors and the request carried no key.Sign in, send a key, or open the hub as above.
400 No models configured on proxyGET /public/model_hubThe gateway has no models loaded.Register models in config.yaml or the database.
422 useful link '<name>' must be an absolute http:// or https:// URLPOST /model_hub/update_useful_linksA link is a relative path or another scheme.Use a full https:// address.
403 Only proxy admins can update the AI hub useful links. Your role=...POST /model_hub/update_useful_linksThe key is not a proxy admin key.Use a proxy admin key.
403 Only proxy admins can update public mcp servers. Your role=...POST /v1/mcp/make_publicThe key is not a proxy admin key.Use a proxy admin key.
404 MCP Server with ID <id> not foundPOST /v1/mcp/make_publicA listed id matches no server.Check the ids on the MCP Servers page.
500 Error updating useful links: <error>POST /model_hub/update_useful_linksThe config could not be saved, usually the database.Check the database and try again.
500 Failed to list the published skills.GET /public/skill_hubThe skill list could not be read. The cause is in the gateway log, see below.Check the database.
500 Failed to list public model groups.GET /public/v1/model_hubThe list could not be built.Read the log line below.
500 Failed to list public model group values.GET /public/v1/model_hub/{facet}The values of one filter, such as providers, could not be built.Read the log line below.
500 Could not save the public MCP server list. The gateway log has the cause.POST /v1/mcp/make_publicThe publication list could not be saved, usually the database.Read the Error making MCP servers public log line and try again.
The hub is empty although enable_public_model_hub is onNothing was made public, or require_auth_for_public_ai_hub still closes it.Make model groups public, and turn the hub on from the Admin UI, which clears the older setting.

Logs​

LevelLineMeaning and action
ERROR...public_model_hub_list(): Exception occured - <error> or ...public_model_hub_facet(): Exception occured - <error>The paged hub list or a filter list failed and the caller got 500. The error names the cause, usually the router or the database.
ERRORCould not list the published skills: <error>The skill hub could not read the marketplace table. Check the database.
ERRORError updating useful links: <error>Saving the useful links failed.
ERRORError making MCP servers public: <error>Saving the MCP publication list failed.

Health results shown in the hub come from health checks. To let developers ask for access to models they see in the hub, use access requests.