Invoke a function
Make invocation requests on your functions.
Function deployments on Blaxel have an invocation endpoint which can be used by external consumers to request an invocation execution. Invocation requests are then routed on the Global Inference Network based on the deployment policies associated with your function deployment.
When an agent requests a function execution, it uses the same invocation endpoint routed through the Global Inference Network.
Invocation endpoints
When you deploy a function on Blaxel, an invocation endpoint is generated on Global Inference Network. The protocol used for communication depends on the type of function: pre-built functions use WebSockets, while custom functions use HTTPS.
The invocation endpoint looks like this:
Endpoint authentication
By default, functions deployed on Blaxel aren’t public. It is necessary to authenticate all invocation requests, via a bearer token.
The evaluation of authentication/authorization for invocation requests is managed by the Global Inference Network based on the access given in your workspace.
Make an invocation request
Blaxel API
Using this endpoint to make invocation requests is done differently depending whether the function is one of your custom functions or if it is a pre-built Blaxel function.
Custom functions can be invoked by calling the root endpoint using the HTTPS protocol. Make a POST request to the invocation endpoint for the function deployment you are requesting, making sure to fill in the authentication token:
Pre-built functions are Model Context Protocol (MCP) servers deployed on Blaxel. They provide a toolkit of multiple tools—individual capabilities for accessing specific APIs or databases. These functions can be interacted using WebSocket protocol.
They offer two methods:
tools/list
A method that lists the available tools and their schemas, allowing consumers (you or agents) to discover the function’s capabilities.tools/call
A method that lets consumers execute individual tools. It requires params with two keys:name
: the name of the tool to run, obtained from the listing endpoint abovearguments
: an object with the key and values of input parameters for the execution, obtained from the listing endpoint above
Example of tools/list
outbound message on a Brave Search toolkit (make sure to fill in the authentication token).
This one returns two tools in the function: brave_web_search and brave_local_search.
Example of tools/call
outbound message on the brave_web_search tool.
Blaxel CLI
The following command is only compatible with custom functions and will make a default POST request to the function’s deployment (by default), on the base endpoint.
At the moment, pre-built Blaxel functions cannot be invoked via Blaxel CLI.
Blaxel console
invocation requests can be made from the Blaxel console from the function deployment’s Playground page.