GenAI API for Apple Shortcuts

GenAI API for Apple Shortcuts

Louis Brulé Naudet · Coding

GenAI API for Apple Shortcuts is an open-source TypeScript API that runs on Cloudflare Workers and brings Google Gemini models into your iPhone shortcuts, free up to 1,500 requests a day.

Interface preview of GenAI API for Apple Shortcuts

About GenAI API for Apple Shortcuts

What Is GenAI API for Apple Shortcuts

GenAI API for Apple Shortcuts is a serverless AI API that links Apple's Shortcuts app to Google's Gemini models. You deploy it once to Cloudflare Workers, store your Google AI Studio key as a secret, and from then on your shortcuts can send text or images to a Gemini model and get an answer back. The project is written in TypeScript with the Hono framework and released under the Apache 2.0 license.

The problem it solves is friction. Apple's Shortcuts app has a native action for web requests, but none for generative AI, so anyone who wanted an AI step in a shortcut had to build the plumbing first. This repo handles the plumbing: authentication, model routing, and a single completion endpoint that already speaks the format your shortcut needs.

The biggest limitation is that there's no hosted service. You run it yourself, so setup asks for a Cloudflare account, a Google AI Studio key, and a few terminal commands. Cloudflare's free Workers tier covers up to 100,000 requests a day, while Google AI Studio's free tier caps Gemini at 1,500 requests per day, and the lighter models cost nothing to call within that limit.

Getting Started

  1. Clone the repository and edit the config files, mainly the wrangler.jsonc file, then run make init to install dependencies.
  2. Store your Google AI Studio API key as a secure secret with the wrangler secret put GOOGLE_AI_STUDIO_API_KEY command, then add a bearer token with wrangler secret put BEARER_TOKEN.
  3. Deploy the worker with make deploy, which gives you a Cloudflare Workers URL ending in /api/v1/completion.
  4. Build a shortcut that sends a POST request to that completion endpoint, passing your bearer token in the Authorization header and a message in the JSON body.
  5. Test with a short prompt, then wire the reply into the rest of your shortcut, for example to summarize text or describe a photo.

Product Information

A quick look at GenAI API for Apple Shortcuts's pricing, supported platforms, and performance.

Free PlanYes
Paid Plans$0 - $25/mo (Cloudflare Workers paid tier; Google Gemini has paid tiers)
PlatformCloudflare Workers, iOS Shortcuts, macOS Shortcuts, iPadOS Shortcuts
DeveloperLouis Brulé Naudet
CategoryCoding
Release DateAug 2025
Latest UpdatedApr 2026
Website Visits649.3M
Website Global Rank50
API AvailabilityYes

Best for

The users, tasks, and scenarios where this tool fits best.

Users

  • Shortcuts power users
  • Developers testing AI features
  • Privacy-minded users

Tasks

  • Summarizing text on the phone
  • Describing or reading photos
  • Drafting replies
  • Automating repetitive writing

Scenarios

  • Voice-first workflows
  • Building without a server budget
  • Prototyping an app idea

Key features

Single Completion Endpoint

The whole API surfaces one route, POST /completion, which accepts an OpenAI-style messages array and returns plain text. That shape means you can drop it behind tooling that already expects OpenAI's format without rewriting request logic. Text replies come back as the model's completion with no wrapper to parse.

Multimodal Input

Requests can mix text and images in one message. You send an image as a data URL alongside a text prompt, which opens the door to visual question answering, image captioning, and pulling text out of a photo. The image has to be a valid data URL, so your shortcut encodes the file before sending it.

Google Gemini Model Choice

The API routes to Google AI Studio and lets you pick the model per request. The supported lineup covers gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.0-flash, and gemini-2.0-flash-lite, so you trade speed against capability based on the task. The default is gemini-2.5-flash, a solid middle ground for everyday prompts.

Bearer Token Security

Every request needs a bearer token you set as a Cloudflare secret, and requests without it fail. You can also send an X-API-Key header to use a provider key per request, which lets you swap keys without redeploying the worker. This keeps the endpoint from being an open door if the URL leaks.

Serverless Deployment

Because it ships as a Cloudflare Worker, there's no server to patch, no container to keep warm, and no idle cost. Deploys are a single make deploy command, and updates are a make update away. Cloudflare's free tier absorbs up to 100,000 requests a day, well above what a personal shortcut setup uses.

Built for Apple Shortcuts

The project started as a shortcut booster and the README points you to Apple's own guide for making API calls in Shortcuts. It leans on the native Get Contents of URL action, so your shortcut sends a request and reads the reply with no extra app. That keeps the whole AI step inside the Apple apps you already use.

Pros and cons

Pros

  • Open source under Apache 2.0, so you can read, fork, and change every line instead of trusting a black box.
  • Runs on Cloudflare Workers with no server to maintain and a free tier that covers heavy personal use.
  • One OpenAI-style completion endpoint handles text and images, which fits shortcuts with minimal setup.
  • Model choice per request, from fast Flash-Lite models to the stronger Gemini 2.5 Flash.
  • Bearer token and optional per-request API key give you basic control over who can call the endpoint.

Cons

  • No hosted service, so you need a Cloudflare account, a Google AI Studio key, and comfort with the command line to get going.
  • The request format has to match the API's schema, and a malformed image data URL makes the call fail rather than degrade gracefully.
  • Google AI Studio's free tier caps Gemini at 1,500 requests per day, so heavy automation can hit the ceiling and need a paid key.
  • You maintain it yourself, which means watching for dependency updates and redeploying when the Gemini models change.

Frequently asked questions

No. The worker runs on Cloudflare's free tier and Google AI Studio offers a free Gemini allowance of up to 1,500 requests a day, so a personal setup can run at no cost. You only pay if your volume passes those limits or you want Cloudflare's paid Workers plan.