Call API
Describes how to make your bot call an external API
Last updated
Was this helpful?
Describes how to make your bot call an external API
Last updated
Was this helpful?
URL
The URL of the API endpoint you are calling
HTTP Method
The HTTP method verb
POST
Bearer token
The authentication token for your API call. Generally this is issued to you by the API service and is unique and private. Do not share this key with anyone.
sk-xyzabcdef
Request body
The request body for the API call. Must be properly formatted JSON. Leave this blank for GET requests.
{ "model": "gpt-4.1", "input": "Give me some whale facts please!" }
Response body variable name
This is the variable which you can use in other nodes to process the API response body.
gptResponse
Example bot in action:
The following flow in BSD is used to get a prompt from the user and call Chat GPT (via OpenAI API)
We can reference gptResponse
since we used that variable name in the API Call node.
That's it! Now when a user uses the !gpt
command with our bot, their prompt will be sent to OpenAI and our bot will respond.