Quick Start
The OffloadGPT API works in combination of the RapidAPI platform and the OpenAI Chat Completion API.
Get your API keys
Make your first request
curl --request POST \
--url https://offloadgpt.p.rapidapi.com/v1/stream-chatgpt \
--header 'content-type: application/json' \
--header 'X-RapidAPI-Host: offloadgpt.p.rapidapi.com' \
--header 'X-RapidAPI-Key: <REQUIRED>' \
--header 'X-OpenAI-API-Key: <REQUIRED>' \
--data '{
"messages": [
{
"role": "system",
"content": "You are an assistant of an online store selling hardware and I do not want you to talk about anything other than my products"
},
{
"role": "user",
"content": "Can you resume the pros and cons of the Soundcore by Anker Space Q45 Adaptive Active Noise Cancelling Headphones?"
}
]
}'const http = require('https');
const options = {
method: 'POST',
hostname: 'offloadgpt.p.rapidapi.com',
port: null,
path: '/v1/stream-chatgpt',
headers: {
'content-type': 'application/json',
'X-RapidAPI-Host': 'offloadgpt.p.rapidapi.com',
'X-OpenAI-API-Key': '<REQUIRED>',
'X-RapidAPI-Key': '<REQUIRED>'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
messages: [
{
role: 'system',
content: 'You are an assistant of an online store selling hardware and I do not want you to talk about anything other than my products'
},
{
role: 'user',
content: 'Can you resume the pros and cons of the Soundcore by Anker Space Q45 Adaptive Active Noise Cancelling Headphones?'
}
]
}));
req.end();Check the results
Last updated