Practical overview
When it fits
Use it when you want a self-managed Cloudflare Worker endpoint between a client application or Apple Shortcut and Gemini, and can configure the required provider key and bearer token.
Who it is for
- Developers adding Gemini responses to applications running through a Cloudflare Worker.
- Apple Shortcuts makers who want to call a Gemini-backed API from a shortcut.
Documented uses
- Send text prompts to Gemini and receive a plain-text completion.
- Submit text with an image data URL for tasks such as visual question answering or image captioning.
- Provide an authenticated backend interface between an application or shortcut and Google AI Studio's listed Gemini models.
Requirements & limits
The repository is public and declares an Apache-2.0 license. Deployment requires a Google AI Studio API key and a bearer token.
- The documented provider is google-ai-studio; listed models are gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.0-flash and gemini-2.0-flash-lite.
- Image input must be provided as a valid data URL.
- Every request needs an Authorization bearer token; an X-API-Key header can be used for a provider-specific key.
- The documented response is plain text, even when the request includes an image.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Deploy the API to Cloudflare Workers
Configure the repository's API credentials and deploy the Worker.
Before you start
- The Genai API repository and Wrangler setup.
- A Google AI Studio API key.
- A Cloudflare Worker configuration, including edits to wrangler.jsonc where needed.
- A bearer token.
Steps
Download the repository and edit the configuration files, including wrangler.jsonc as needed.
Run make init; run make update if needed.
Use Wrangler to store GOOGLE_AI_STUDIO_API_KEY and BEARER_TOKEN as secrets.
Run make deploy to deploy the API to Cloudflare Workers.
Expected outcome
A deployed Worker with the documented /api/v1/completion route available for requests.
Guide limitations
- Requests to the completion endpoint require an Authorization bearer token.
- The guide does not specify endpoint behavior beyond the documented completion request format.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 16 October 2026
- Original website title
- louisbrulenaudet/genai-api · Official homepage title · retained in its source language

