Skip to content

Integrations · Python · JavaScript

Use LangChain with a free AI API

LangChain is a framework for building applications with language models, in Python and JavaScript. Point it at ZeroLimitAI and every request goes to the best free model available at that moment — free for 7 days at 25 calls a day, no card. Then Annual ($99/year, 2,000 calls a day, with paid models as backup when the free ones are busy), or Lifetime ($99 once, on your own free OpenRouter or Groq key).

Get your free API key

Set it up

  1. Install the OpenAI integration (pip install langchain-openai, or npm install @langchain/openai).
  2. Create a ChatOpenAI client with our base URL and your key.
  3. Use it anywhere LangChain expects a chat model: chains, agents, tools.
Python
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="auto",
    base_url="https://www.zerolimitai.com/api/v1",
    api_key="zlai_your_key_here",
)
print(llm.invoke("Say hello in one sentence").content)
JavaScript
import { ChatOpenAI } from "@langchain/openai";

const llm = new ChatOpenAI({
  model: "auto",
  apiKey: "zlai_your_key_here",
  configuration: { baseURL: "https://www.zerolimitai.com/api/v1" },
});
console.log((await llm.invoke("Say hello in one sentence")).content);

Replace zlai_your_key_here with your key. Base URL: https://www.zerolimitai.com/api/v1. LangChain's own documentation

Good to know

  • Tool calling (bind_tools / bindTools) is supported.
  • Free models answer first (on Annual, a paid backup model steps in at our cost when they are busy), and never through a provider that may train on your prompts. Context is at least 32K tokens, depending on the model.
  • Need more than the free tier? Annual ($99/year, $59 in Latin America, South and Southeast Asia) gives 2,000 calls a day, and your own free Groq or OpenRouter key carries on past that. Lifetime ($99 once) runs the same router on your own key, with no limit of ours; your provider's free tier is the limit. See plans.

If something goes wrong

401 invalid_key
The key is mistyped, revoked or missing the zlai_ prefix. Create a new one in your dashboard under Developer.
404 Not Found
The base URL must end in /api/v1 (https://www.zerolimitai.com/api/v1). Tools add /chat/completions themselves.
429 daily_limit
Your account used its calls for the day. The limit is per account, not per key, and resets at 00:00 UTC; the X-RateLimit-Remaining header shows what is left.
“Model not found”, or a model name you did not choose in the response
Any model ID is accepted: one we do not serve is routed by ZeroOptimize, and the response header X-ZeroOptimize-Substituted-From says what you asked for. Use “auto”.
Slow first word
Some free models think before answering. Keep streaming on so text appears as soon as it is written; a model that stays silent is replaced automatically.

Full reference: API docs · live status

Other tools

Configs checked against each tool's documentation on 2026-10-02.

Stop paying per token.

One endpoint. $0 inference.

Free 7-day API key in a minute · no card. Then $99 once on your own key, or $99 a year.