Good to know: You can make a wrapper for our API as well and get it listed here!
Make your first request
To make your first request, send an authenticated request to the ai endpoint. This will return a json object, which contains our AI Response.
Good to know: We are using Python Library (YARSAW) to make the requests.
Take a look at how you might call this method using our official libraries, or via curl:
import yarsawimport asyncio # defaultclient = yarsaw.Client("RSA KEY HERE", "RapidAPI KEY HERE")asyncdefmain(): keep_talking =Truewhile keep_talking:# Start loop cin =input("You:\t")if cin =="exit": keep_talking =False# end loopelse: res =await client.get_ai_response(cin, bot_name="yarsaw")print("Bot:\t"+ res.response)await client.disconnect()# disconnect the client at the end of the loopasyncio.get_event_loop().run_until_complete(main())
var axios =require("axios").default;var options = { method:'GET', url:'https://random-stuff-api.p.rapidapi.com/ai', params: { msg:'Hi there, how are you?', id:'123' }, headers: { authorization:'Api Key received from api.pgamerx.com/register','x-rapidapi-host':'random-stuff-api.p.rapidapi.com','x-rapidapi-key':'Your RapidAPI Key' }};axios.request(options).then(function (response) {console.log(response.data);}).catch(function (error) {console.error(error);});