openflarestack Star this repo
  1. Catalog
  2. LLM gateways
  3. AI API Gateway
Ranked 84 of 418

AI API Gateway

MoyuFamily/ai-relay

Lets you point all your AI clients at one gateway for many models.

A self-hosted alternative to LiteLLM.

What it sets up in your account

  • D1
    D1 database
    A SQL database for the app’s records.
  • KV
    KV namespace
    A key value store for settings and fast lookups.
Category
LLM gateways
Licence
MIT
Stars
131
Last commit
today
Latest release
v3.0.0

Use it with AI or code

  • Markdown for AIPaste into ChatGPT, Claude or any LLM./apps/ai-relay.md
    Open
  • JSON APIFree, no key, CORS open./api/v1/apps/ai-relay.json
    Open

More in the API docs and llms.txt.

Keeping it up to date

The Deploy button copies the repo into your GitHub. Run this in your copy whenever a new version comes out.

terminal
git remote add upstream https://github.com/MoyuFamily/ai-relay.git
git pull upstream main
npx wrangler deploy

AI API Gateway questions

What is AI API Gateway?

Lets you point all your AI clients at one gateway for many models. It’s an open-source, self-hosted alternative to LiteLLM. It runs on Cloudflare Workers in your own account.

What does AI API Gateway set up in my Cloudflare account?

D1 database and KV namespace. They are created in your account, so the data stays yours.

How do I deploy AI API Gateway?

Press Deploy to Cloudflare. Cloudflare copies the repository into your GitHub account, creates what it needs and deploys it with Workers Builds.

Is AI API Gateway free and open source?

Yes. It’s published under the MIT licence. Running it uses your own Cloudflare account, and small setups usually fit in the free plan.

How do I update AI API Gateway?

Pull from the original repository and redeploy: add https://github.com/MoyuFamily/ai-relay.git as an upstream remote, run git pull upstream main, then npx wrangler deploy.