The objective of this repo is to provide a very simple and easy-to-use API for developers to integrate generative AI capabilities into their shortcuts in a minute. You just have to download this repository, slightly edit the configuration files, notably the wrangler.jsonc file, and run make init (eventually make update), then:
wrangler secret put GOOGLE_AI_STUDIO_API_KEY
Wrangler will prompt you to enter your API key, which will be securely stored as a secret environment variable in your Cloudflare Worker. If you don’t have an API key yet, you can get one from the Google AI Studio.
Then, you need to put a bearer token for security reasons:
wrangler secret put BEARER_TOKEN
Once you have set up the secrets, you can deploy the API to Cloudflare Workers using:
make deploy
Here you go! Your API is now deployed and ready to use. You can test it by sending requests to the Cloudflare Workers URL provided in the output. The completion endpoint must be accessible pinging something like