In this guide, you will learn how to set up Casper’s built-in Xano integration. This is necessary to bypass Bubble’s 60 second API request timeout. GPT-4’s API can take longer than 60 seconds to respond, which means that any medium to large prompt you send will not return a response when using native Bubble API connector.
Have these things ready before starting:
(Coming Soon)
Xano allows us to package everything you need into a ‘Snippet,’ which you can install with a few clicks.
Navigate to https://www.xano.com/snippet/szLHpp_R and install the snippet to your Xano instance. Once it is installed, click the “Go to Instance” button.
Once you are on your dashboard, navigate to Marketplace > Purchased, select ‘Casper+Xano OpenAI Integration,’ and click the green Install button.
After you have installed the snippet, navigate to the API tab. Click the ‘View’ button on the Casper OpenAI API group, and click ‘Edit this endpoint’ on the /process_request endpoint.
Click on the function in the function stack to modify it’s input data. In the openai_api_key_header field, replace [YOUR API KEY] with your actual OpenAI API key. Save your changes to that function. Then, publish your changes to the live version of the /process_request endpoint by clicking the green ‘Publish’ button. This is a GIF showing you the process: