gitwtfhub

wtf is workersai2api?

cmliussss2024/workersai2api — explained in plain English

Analysis updated 2026-05-18

42JavaScriptAudience · developerComplexity · 3/5Setup · moderate

TL;DR

Turns Cloudflare's free Workers AI into an OpenAI-compatible API with a visual admin panel and multi-account load balancing.

Mindmap

mindmap
  root((WorkersAI2API))
    What it does
      OpenAI-compatible API
      Admin panel
    Tech stack
      JavaScript
      Cloudflare Workers
      Cloudflare KV
    Use cases
      Free AI access
      Load balancing accounts
    Audience
      Developers
      Self-hosters

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Connect OpenAI-compatible chat clients like Cursor or LobeChat to Cloudflare's free AI models

REASON 2

Spread AI requests across multiple Cloudflare accounts to avoid hitting free-tier limits

REASON 3

Manage AI API keys and usage through a visual admin dashboard

What's in the stack?

JavaScriptCloudflare WorkersCloudflare PagesCloudflare KV

How it stacks up

cmliussss2024/workersai2apikris77z/web-experience-clonerthetalhachy/frame-puzzle
Stars424242
LanguageJavaScriptJavaScriptJavaScript
Setup difficultymoderatemoderate
Complexity3/53/5
Audiencedeveloperdevelopervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires a Cloudflare account, a KV namespace binding, and an admin password before it will serve requests.

No license information is given in the README.

Wtf does this do

WorkersAI2API is a JavaScript project that turns Cloudflare's free Workers AI service into an API that looks and behaves like OpenAI's own API. This matters because many popular AI chat tools, such as Cursor, LobeChat, and NextChat, already know how to talk to an OpenAI style API, so once this project is deployed, those same tools can be pointed at it and start using Cloudflare's free AI models without any special integration work. Beyond plain chat, it also supports embeddings and an Anthropic compatible messages format, so it covers more than one style of AI request. A useful feature for anyone relying on the free tier is built in load balancing across multiple Cloudflare accounts: you can register several accounts, and the project spreads requests across them, automatically switching to another account if one runs out of its free quota or has a problem. The project includes a visual admin panel where you log in with a password to view usage, manage which Cloudflare accounts and API keys are connected, and customize how model names are mapped to Cloudflare's actual model identifiers. Authentication is optional: if you set an API key, the service requires it, and if you do not, it stays open to anyone who can reach it. Deployment is designed to be simple and happens entirely on Cloudflare's own infrastructure. The recommended path is dragging a single worker file into Cloudflare Pages and connecting a storage namespace called KV, along with setting a required admin password. There is also a command line path using Cloudflare's wrangler tool for developers who prefer deploying through Workers directly. After deployment, you log in, add your Cloudflare account credentials, generate a key, and then point any OpenAI compatible client at the new address to start using it.

Yoink these prompts

Prompt 1
Help me deploy WorkersAI2API to Cloudflare Pages and bind a KV namespace
Prompt 2
Explain how to add multiple Cloudflare accounts for load balancing in WorkersAI2API
Prompt 3
Show me how to point Cursor or LobeChat at my deployed WorkersAI2API endpoint
Prompt 4
List the built-in model name mappings this project uses for Cloudflare Workers AI

Frequently asked questions

wtf is workersai2api?

Turns Cloudflare's free Workers AI into an OpenAI-compatible API with a visual admin panel and multi-account load balancing.

What language is workersai2api written in?

Mainly JavaScript. The stack also includes JavaScript, Cloudflare Workers, Cloudflare Pages.

What license does workersai2api use?

No license information is given in the README.

How hard is workersai2api to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is workersai2api for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.