← Blog

Install InferAll into any project with one command

npx @inferall/cli init detects your stack, sets up your key, and points your existing OpenAI or Anthropic SDK code at InferAll — with an AI-assisted codemod for the tricky call sites.

InferAll Team

2 min read
CLIinstall wizardOpenAI SDKAnthropic SDKAI gatewaydeveloper toolscodemod
Every gateway asks you to read docs to change one line. We built a wizard that makes the change for you: ```bash npx @inferall/cli init ``` That's the whole integration. Here's what it actually does — and what it deliberately doesn't. --- ### What `init` does 1. **Detects your project.** Node or Python, and whether you already use the `openai`, `@anthropic-ai/sdk`, or Google Gemini SDKs. 2. **Sets up your key.** Writes `INFERALL_API_KEY` to `.env`, adds a placeholder to `.env.example`, and makes sure `.env` is gitignored — the hygiene step most quickstarts skip. 3. **Migrates your code.** Simple client constructors are rewritten deterministically — the OpenAI SDK gets `baseURL: "https://api.inferall.ai/v1"`, the Anthropic SDK gets the host root (it appends `/v1/messages` itself). Anything ambiguous gets an AI-suggested patch that you review before it's applied. The patches are generated by InferAll's own $0 NVIDIA NIM models — the wizard runs on the product it installs. 4. **Verifies with a live call.** If your account isn't activated yet, it says exactly that — the $5 starter pack becomes spendable balance, not a fee — with the link, instead of failing with an opaque 402. ### What it deliberately doesn't do Using the Google Gemini SDK? That SDK speaks its own wire protocol, so no base URL can re-point it. Instead of a risky cross-protocol rewrite, the wizard prints the exact OpenAI-compat snippet (`model: "gemini/gemini-2.5-flash"`) and leaves your code alone. Honest guidance beats broken automation. ### `doctor` — keep it wired ```bash npx @inferall/cli doctor ``` Checks key presence and validity, `.env` gitignore hygiene, whether every client call site actually points at the gateway, and your live account state. Exit code 0 only when everything passes — so it drops straight into CI: ```yaml - name: Check InferAll wiring run: npx @inferall/cli doctor env: INFERALL_API_KEY: ${{ secrets.INFERALL_API_KEY }} ``` ### `models` — see what you get ```bash npx @inferall/cli models --free ``` The live catalog with real prices from the gateway — 217 models, 118 of them at $0 input/output on NVIDIA NIM within free-plan daily limits. --- Zero runtime dependencies, Node 18+, and the whole thing is one file. Get a key at [inferall.ai/keys](https://inferall.ai/keys) and run `npx @inferall/cli init` in your project.