#66th of 6 in AI API backends

genai-api

Hono API on Cloudflare Workers proxying Gemini with bearer auth

Stars
111
License
Apache-2.0
Last commit
Apr 2026
Language
TypeScript

Overview

Hono TypeScript worker exposing POST /completion that forwards OpenAI-style messages (text and data-URL images) to Gemini 2.0 and 2.5 Flash models through Cloudflare AI Gateway, validated with Zod and returned as plain text. Secured by a BEARER_TOKEN secret, with an optional X-API-Key header to pass a provider key per request; deployed with make deploy. Built for Apple Shortcuts; local dev on port 8788.

Who it is for: Developers wanting a small authenticated LLM proxy on Workers

Strengths

  • Bearer-token auth and Zod validation on the single endpoint
  • Requests route through Cloudflare AI Gateway for caching and logs
  • Multimodal input via data-URL images
  • Biome lint and Snyk badge

Weaknesses

  • Google AI Studio provider only; four Gemini Flash models
  • Plain-text responses, no streaming
  • No tests mentioned; last commit 2026-04
  • Needs a Cloudflare account and AI Gateway id

What it needs

  • TypeScript, Gemini 2.5 Flash, 2.5 Flash Lite, 2.0 Flash, 2.0 Flash Lite via Cloudflare AI Gateway, OpenAI SDK client
  • Needs Cloudflare account with AI Gateway, Google AI Studio API key
  • GitHub template

Also in AI API backends

See all 6
Also in AI API backends
RankProjectScore
1agent-service-toolkitLangGraph agents served by FastAPI with a Streamlit chat client Live demo ↗ (opens in a new tab)4.5k stars, MIT70 out of 100
2fastapi-langgraph-agent-production-ready-templateFastAPI service for a LangGraph agent with auth, memory and tracing2.7k stars, MIT55 out of 100
3full-stack-ai-agent-templateProject generator for FastAPI and Next.js apps with agents and RAG1.9k stars, MIT55 out of 100
#4generative-ai-project-templateuv workspace with FastAPI, NiceGUI, LiteLLM and Promptfoo evals118 stars, MIT51 out of 100
#5nodejs-api-boilerplateExpress TypeScript CRUD API template with an LLM module generator163 stars, MIT31 out of 100