← all repositories
haibbo/cf-openai-azure-proxy

The serverless shim that tricks OpenAI clients into using Azure

Most OpenAI clients won’t speak to Azure, so this Cloudflare Worker acts as a polite bilingual intermediary.

1.6k stars JavaScript Inference · ServingOther AI
cf-openai-azure-proxy
Not currently ranked — collecting fresh signals.
star history

What it does

This Cloudflare Worker script intercepts standard OpenAI API requests and forwards them to Azure OpenAI Service. It remaps model names such as gpt-4 and dall-e-3 to your specific Azure deployment aliases, then passes the response back to the client. The entire proxy runs on Cloudflare’s edge network and costs nothing for the first 100,000 requests per day.

The interesting bit

Azure returns replies in fragmented chunks, which most chat clients render poorly. The worker splits those fragments into discrete messages and streams them sequentially, creating what the author calls “printer mode”—effectively teaching Azure’s chunky responses to mimic OpenAI’s real-time token streaming.

Key highlights

  • Supports GPT-3, GPT-4, and DALL-E-3 via a configurable deployment mapper.
  • Runs serverless on Cloudflare Workers; no dedicated host or credit card required for the free tier.
  • Also offers a Docker deployment path built on Wrangler.
  • Lets off-the-shelf OpenAI clients such as OpenCat use Azure endpoints simply by swapping the API domain.

Caveats

  • You must manually maintain the mapping between OpenAI model names and your Azure deployment names.
  • Client compatibility is not guaranteed; the author notes that not every OpenAI client has been tested.

Verdict

A handy drop-in if you have Azure OpenAI credits and a favorite client that only speaks the OpenAI API. Look elsewhere if you need a heavy-duty API gateway or deep protocol transformation beyond model name remapping.

Frequently asked

What is haibbo/cf-openai-azure-proxy?
Most OpenAI clients won’t speak to Azure, so this Cloudflare Worker acts as a polite bilingual intermediary.
Is cf-openai-azure-proxy open source?
Yes — haibbo/cf-openai-azure-proxy is open source, released under the MIT license.
What language is cf-openai-azure-proxy written in?
haibbo/cf-openai-azure-proxy is primarily written in JavaScript.
How popular is cf-openai-azure-proxy?
haibbo/cf-openai-azure-proxy has 1.6k stars on GitHub.
Where can I find cf-openai-azure-proxy?
haibbo/cf-openai-azure-proxy is on GitHub at https://github.com/haibbo/cf-openai-azure-proxy.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.