Skip to main content

Server tools API

This page documents the 1 gateway endpoint tagged server tools in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.

MethodPathSummary
GET/v1/server_toolsList the server tools your key may use

Endpoints​

GET /v1/server_tools​

List the server tools your key may use

Lists the tools the gateway runs on its own side, such as fetching a web page, that your key may add to tools on /chat/completions with a type like spanway:web_fetch. A tool shows up only when a proxy admin turned it on and it is granted to your key and, for a team key, to your team. Any valid key may call this, and it changes nothing.

Each entry carries the function schema the model sees and its per-request use limit, and the top level gives the most tool calls and the most seconds one request may spend on server tools.

Docs (https://docs.spanway.ai/docs/proxy/server_tools)

Example request:

curl -X GET "http://localhost:4000/v1/server_tools" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The server tools this key may call, with their limitsapplication/json ServerToolCatalog
401No valid key or Admin UI session was presentedapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
toolsarray of ServerToolInfoYesTools
max_tool_callsintegerYesMax Tool Calls
max_wall_secondsintegerYesMax Wall Seconds