What the gateway does between your app and the model
Mobiforge sits in front of OpenAI, Anthropic, Google and DeepSeek. It authenticates your key, checks its budget, routes the request, retries on failure and records the cost.
OpenAI-compatible API
Works with the official OpenAI SDKs for Python and Node.js, LangChain, LlamaIndex, the Vercel AI SDK and any client that lets you set a base URL. Claude and Gemini models are translated to the same request and response shape.
- POST /v1/chat/completions
- Chat and tool calling in OpenAI format, with stream: true for SSE
- GET /v1/models
- Every available model ID with its current input and output rate
- POST /v1/embeddings
- Embeddings from supported providers through the same key
- GET /v1/usage
- Usage and cost per key, model and day, as JSON or CSV
classify.ts
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.mobiforgesystems.store/v1",
apiKey: process.env.MOBIFORGE_API_KEY,
});
const res = await client.chat.completions.create({
model: "google/gemini-3.8-flash",
messages: [{ role: "user", content: "Classify: refund request" }],
});
console.log(res.usage); // prompt, completion, cached tokens Routing and fallback
Each model can be served by more than one upstream route. On a 429, 5xx or timeout the gateway retries on the next route, up to two retries, before returning. Failed attempts are not billed.
- Pin a request to one provider to turn retries off
- Set a fallback model list, e.g. Sonnet 5.5 then GPT-6.1 Sol
- Every attempt appears in the request log with its status code
- openai/gpt-6.1-sol · route A · upstream timeout after 30s 09:41:02
- Retry 1 · route B · 200 OK in 1.8s 09:41:04
- Billed 1,204 input + 388 output tokens 09:41:04
Key policies
| Key | Allowed models | Monthly cap |
|---|---|---|
| prod-chat Owner | anthropic/*, openai/* | $1,000 |
| intern-sandbox Developer | *-flash, *-luna | $25 |
| nightly-evals Developer | deepseek/* | $150 |
Budgets you set per key
Caps reset monthly. You get an email alert at 80%, and once a key hits its cap it returns HTTP 402 until you raise the limit. Allowlists stop a sandbox key from calling a $50-per-million-token model by accident.
See the saving, not just the spend
Usage reports show what you paid next to what the same tokens would cost at provider list price, broken down by provider, model and key. Export to CSV for your finance team.
Teams and Enterprise
- Roles
- Owner, Developer and Billing roles per workspace. Billing users see invoices but not keys.
- Audit log
- Key creation, revocation, cap changes and member changes, with who and when.
- SAML 2.0 SSO
- Sign in through Okta or Microsoft Entra ID on the Enterprise plan.
- Provider rules
- Restrict routing to providers that meet your requirements on data retention and training use.
- Bring your own key
- Use your own provider keys alongside credits; that usage is billed by the provider.
- Invoicing
- Monthly invoices with usage detail; Enterprise can pay by invoice instead of prepaid credits.