Get a licence

One connection fails. Your work doesn't.

MFI AI Gateway runs on your own Linux server and puts your AI provider connections behind one OpenAI-compatible endpoint. When a connection stops answering, requests move to the next one that serves the same model, and your tools never notice.

The control panel of a running gateway. Select the image to enlarge it.

AI tools are now part of the build. They shouldn't be the part that stops it.

  • Outages stay upstream

    A provider error, a revoked key or a dead network path moves the request to the next connection. People keep working.

  • One key per person or app

    Provider keys stay on the server. Hand out gateway keys instead, and revoke one without touching the rest.

  • Cost you can trace

    See what requests cost and where the spend goes, by user, key, model and provider, over the time window you choose.

  • Your server, your traffic

    Prompts and responses pass through infrastructure you run. Nothing is relayed through us.

Overview usage range

Last 24 hours

Last 24 hours3 days7 days14 days1 month3 months

Total Spend
$9.50Last 24 hours
Total Tokens
6,448,210Last 24 hours
Total Requests
4,613Last 24 hours
Input Tokens
5,912,404Last 24 hours
Output Tokens
535,806Last 24 hours
Failed Requests
3Last 24 hours
Illustrative figures. The Usage page breaks these totals down by user, API key, model, account and provider.

What happens to a request

Every model has its own pool: the connections you've added that can serve it. Choose how the gateway uses it: failover, which moves a request on only when a connection fails, or load balancing, which spreads requests across the pool.

  1. 01

    Request arrives

    Your tool sends a normal OpenAI-style request with its gateway key.

    Authorization: Bearer cg-…
  2. 02

    Best connection is picked

    Connections are ranked by recent errors and health. A running session stays on the same connection.

    sticky route: hit
  3. 03

    Failures are read, not guessed

    An outage, an invalid key and a "wait until" are handled differently. If a provider says when a connection is usable again, the gateway holds it until then.

    held until reset: 2h 14m
  4. 04

    Response returns with its cost

    The answer goes back in the format your tool expects. Where the model has a price set, the request's cost is added to usage.

    usage.cost: 0.0041

Failover stays inside a model's pool. A request for an OpenAI model fails over to your other connections for that model. It does not switch to a different provider's model, because the answer would change.

Bring the accounts you already have

MFI AI Gateway doesn't include any AI usage. You connect your own keys and accounts, and the provider bills you directly as it does today.

Account Sign-In Connections

Personal use

OpenAI · Anthropic · Google

  • Sign in with your own provider account instead of pasting a key.
  • Useful for an individual developer using their own plan.

Your plan's terms apply to how the account is used. For teams, use API Key Connections.

Why add more than one connection?

Per project

Give each project or client its own key, so spend and access stay separate and one can be closed without touching the others.

A spare key

If a key is revoked, expires or stops working, the next one for that model takes over while you sort it out.

A route per account

Run each account through its own proxy, or on the server's own connection.

Change one URL

Anything that accepts a custom OpenAI base URL works: the official SDKs, coding assistants and your own services. Point it at your gateway and keep the rest of the code.

  • POST /v1/chat/completionsChat Completions
  • POST /v1/responsesResponses
  • POST /v1/messagesMessages format
  • GET /v1/modelsModels you've enabled
  client = OpenAI(
-     base_url="https://api.openai.com/v1",
+     base_url="https://ai.your-company.com/v1",  # your gateway
-     api_key="sk-...",
+     api_key="cg-...",                           # a gateway key
  )

One command on a clean server

The installer checks your server, then sets up the gateway, its database and cache, a web server with a TLS certificate, and the firewall. When it finishes, the admin panel is live on your domain.

$ curl -fsSL https://download.mfimail.eu/install.sh | sudo bash
  • Serverx86-64 Linux with systemd. Tested on Ubuntu 24.04.
  • Disk20 GiB free
  • DomainA DNS record pointing at the server, not proxied, so the certificate can be issued
  • Sets upGateway service, PostgreSQL, Redis, Nginx, Let's Encrypt TLS, UFW
  • UpdatesSigned, from the admin panel or the command line
  • RuntimeNone to install: static Linux binaries, no Node, Python or container engine

What reaches our licence server

  • Licence and activation IDs
  • Your server's public key fingerprint
  • IP address and time of each licence check
  • Gateway version and platform
  • Installation integrity signals used to detect licence misuse
  • Update checks and release downloads

What never does

  • Prompts and responses
  • Your provider keys and account logins
  • Your users and their gateway keys
  • Your licence key in plain text

What MFI AI Gateway is not

You should know where the line is before you buy.

Not an AI provider

It includes no model access and resells none. Usage is between you and your provider.

Not a way to get more usage

Each connection keeps its provider's own limits. Adding connections is for continuity and for keeping projects separate, not for raising a limit.

MFI AI Gateway licence

£10per 30-day licence

About US$13 · nothing renews automatically

  • The period starts when you first activate, not when you buy.
  • One active server per licence. Moving? Enter the key on the new server and the old one stops at its next check.
  • Renew by hand whenever you like; each renewal adds another 30 days.
  • If a licence lapses, API requests stop with a clear licence error. The admin panel stays reachable so you can renew.

Haven't activated your key? You can get your money back within 14 days. Refund Policy

From licence to running gateway

  1. 01

    Create your account

    Open a MAGCODE customer account with your email address, or sign in to the one you have.

  2. 02

    Buy a licence

    Pay in the customer portal. A payment reference is reserved for you while the payment is confirmed.

  3. 03

    Get your key

    Once the payment is confirmed, your licence key is in the customer portal. Show it whenever you need it and hide it again; it's hidden each time the page reloads.

  4. 04

    Run the installer

    Paste the key when the installer asks. It activates, and the gateway is ready on your domain.

Before you install

Is this allowed by OpenAI, Anthropic and Google?

MFI AI Gateway is software you run that connects to accounts you own. Providers make API keys for exactly this kind of use, and that's what we recommend for teams and production.

If you connect a personal plan by signing in, that plan's terms apply. Some personal plans don't permit use through third-party tools, so please check them first.

Will a provider restrict my account?

We can't speak for providers, but the gateway is built to treat them with respect. When a provider says a connection should wait until a certain time, the gateway records it at once and doesn't try that connection again until then.

Temporary network problems and errors that don't come from the provider are handled according to their type, and another route is tried when that makes sense. The gateway reads every response a provider sends and acts on it; it doesn't try to get around a block on its own.

How your connections are used is still governed by your provider's terms.

How do I know a release hasn't been altered?

Every release is signed. Before installing or updating, the installer verifies the release signature, the archive's SHA-256 and its size, and refuses anything altered. At start-up, the gateway also compares its own binaries against the signed manifest that came with the release.

Can I check what the gateway sends you?

Yes. Watch the server's DNS lookups or network connections: the only traffic that comes to us is licence verification and update checks. The full list is in the install section, under "What reaches our licence server".

Which tools work with it?

Any program that lets you set a custom base URL works with it: the official SDKs, coding assistants, editor extensions and your own code. If you find one that doesn't, open a support ticket in the customer portal and tell us which one.

Keep the work moving when a connection doesn't.

A 30-day self-hosted licence. Your server, your accounts, one endpoint.