How to create manual ChatGPT and Claude requests and connect them to chatbots
With OpenAI and Anthropic, you can connect ChatGPT and Claude to your chatbots or live chat to deliver quick and accurate responses to users’ messages.
When a user types in a query in a chatbot flow, your chatbot sends it to ChatGPT or Claude using API. This text serves as context for response messages the user will receive.
All new manual user requests in your chatbots are processed separately without saving previous messages. Using manual requests, your chatbot can:
- Handle customer requests and deliver personalized responses or recommendations.
- Help customers explore your catalog, select products or services, and access information about available options.
- Enhance and accelerate customers' experience with your chatbot.
In this article, we’ll talk about how to set up these flows and connect ChatGPT and Claude to them.
ChatGPT manual request
You can use and customize SendPulse's ready-made template to integrate manual requests into your chatbot flows.
Add the template
Go to Chatbots > Templates, find the ChatGPT manual request flow template, and select the chatbot you want to connect it to.
Edit the first flow message to outline your chatbot's features and how it supports users.
Next, create the string-type request
variable to save user requests and use it as context to generate ChatGPT responses.
You can create this variable in the Bot audience tab or the Message element.
Generate an OpenAI API key
The API request element uses the OPENAI_KEY
global variable to store your OpenAI API key.
In your OpenAI account, go to API Keys and create a new API key. Copy and save it.
In your SendPulse account, go to the chatbot settings, and in the Bot variables tab, add the string-type OPENAI_KEY
global variable. In the value field, paste the copied API key from your OpenAI account.
Configure the API request
In the API request element, the JSON-formatted request body specifies the GPT model that will process user requests and sets the role to user
. This ensures the model interprets queries as user-generated input and creates responses based on message context.
You can also include high-level prompts to fine-tune the model's behavior when generating responses.
To do this, add a line with the system
role to the request body, and type in your prompt in the context field. For instance, you can set a conversation tone and limit response topics.
Save and test your flow.
Claude manual request
Claude is a line of language models developed by Anthropic. It uses constitutional AI and ethical principles to provide a safe and beneficial user experience.
Add and customize the template
Similarly to ChatGPT, the Templates section already includes a ready-to-use Claude3 AI manual request flow template. Copy it to your chatbot.
Edit the first flow message to outline your chatbot's features and how it supports users.
In the Filter element, add the number-type attempts
variable to limit every user’s number of available requests. In the Message element, add the string-type request
variable to save user responses.
Generate an Anthropic API key and configure the API request
To use the API request element, create a global variable where you will store your Anthropic API key.
In your Anthropic account, go to API Keys and create an API key. Copy and save it.
In your SendPulse account, go to the chatbot settings, and in the Bot variables tab, add the string-type ANTHROPIC_KEY
global variable. In the value field, paste the copied API key from your Anthropic account.
In the API request element, the request body specifies the Claude model that will process user requests. The role is set to user
, meaning that user queries will serve as context when generating a response.
You can also include high-level prompts to fine-tune the model's behavior when generating responses. To do this, add a line with the system
role to the request body, and type in your prompt in the context field.
Save and test your flow.
Last Updated: 22.01.2025
or