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 — 100 calls a day for your first 7 days, then 50 a day with no end date, no card.
Get your free API keySet it up
- Install the OpenAI integration (pip install langchain-openai, or npm install @langchain/openai).
- Create a ChatOpenAI client with our base URL and your key.
- 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.
- Only free models answer, 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 ($49/year) gives 2,000 calls a day and Lifetime ($99 once) 10,000. 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.