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:

Query function

run.blaxel.ai/{YOUR-WORKSPACE}/functions/{YOUR-FUNCTION}

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.

Making a function publicly available is not yet available. Please contact us at support@blaxel.ai if this is something that you need today.

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:

curl 'https://run.blaxel.ai/YOUR-WORKSPACE/functions/YOUR-function' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'X-Blaxel-Authorization: Bearer YOUR-TOKEN' \
  -H 'X-Blaxel-Workspace: YOUR-WORKSPACE' \
  --data-raw $'{"inputs":"Enter your input here."}'

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 above
    • arguments: 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).

{
	"method":"tools/list",
	"jsonrpc":"2.0",
	"id":1
}

This one returns two tools in the function: brave_web_search and brave_local_search.

{
    "result": {
        "tools": [
            {
                "name": "blaxel_web_search",
                "description": "Performs a web search using the Brave Search API, ideal for general queries, news, articles, and online content. Use this for broad information gathering, recent events, or when you need diverse web sources. Supports pagination, content filtering, and freshness controls. Maximum 20 results per request, with offset for pagination. ",
                "inputSchema": {
                    "type": "object",
                    "properties": {
                        "query": {
                            "type": "string"
                        },
                        "count": {
                            "type": "number"
                        },
                        "offset": {
                            "type": "number"
                        }
                    },
                    "additionalProperties": false,
                    "$schema": "http://json-schema.org/draft-07/schema#"
                }
            },
            {
                "name": "blaxel_local_search",
                "description": "Searches for local businesses and places using Brave's Local Search API. Best for queries related to physical locations, businesses, restaurants, services, etc. Returns detailed information including:\n- Business names and addresses\n- Ratings and review counts\n- Phone numbers and opening hours\nUse this when the query implies 'near me' or mentions specific locations. Automatically falls back to web search if no local results are found.",
                "inputSchema": {
                    "type": "object",
                    "properties": {
                        "query": {
                            "type": "string"
                        },
                        "count": {
                            "type": "number"
                        }
                    },
                    "additionalProperties": false,
                    "$schema": "http://json-schema.org/draft-07/schema#"
                }
            }
        ]
    },
    "jsonrpc": "2.0",
    "id": "1"
}

Example of tools/call outbound message on the brave_web_search tool.

{
	"jsonrpc":"2.0",
	"id":2,
	"method":"tools/call",
	"params":{
		"name":"blaxel_web_search",
		"arguments":{
			"query":"What is the current weather in NYC?",
			"count":1,
			"offset":1
			}
		}
}

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.

bl run function your-function --data '{"inputs":"Enter your input here."}'

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.