Is LangChain free for commercial use? Yes. The LangChain and LangGraph libraries, in Python and JavaScript, are released under the MIT license, so you can build a paid product on them, ship them inside closed source software and charge customers without paying LangChain Inc. anything. The one condition is that you keep the MIT copyright and permission notice with any copy of the code you distribute. Your actual costs come from the models you call, the hosting you run, and LangSmith if you choose to use it.
That short answer covers most teams, but there are three places where "free" gets less simple: the hosted LangSmith platform, the Agent Server that langgraph dev and production deployments use, and the licenses of everything else your install pulls in. We checked each one on October 25, 2026, against the license files on GitHub, the package metadata on PyPI and npm, LangChain's pricing page and its deployment docs, and we audited a real install on the box. If you are still choosing between the two libraries, LangChain vs LangGraph explains how they fit together.
Which LangChain packages are free for commercial use
Everything you import to build an agent is MIT licensed. The main repositories (langchain, langgraph, langchainjs, langgraphjs, deepagents and langchain-community) all carry an MIT LICENSE file, and the PyPI metadata matches:
| Package (version on Oct 25, 2026) | License | What it is |
|---|---|---|
langchain 1.4.7 | MIT | create_agent, middleware, the main entry point |
langchain-core 1.7.0 | MIT | Messages, tools and model interfaces |
langgraph 1.2.17 | MIT | The graph runtime under create_agent |
langgraph-checkpoint-postgres 3.2.0 | MIT | Saves agent state to Postgres |
langchain-openai, langchain-anthropic, langchain-ollama | MIT | Model provider packages |
langchain-community 0.4.2 | MIT | Community integrations |
langchain-mcp-adapters 0.3.2 | MIT | Loads MCP server tools as LangChain tools |
deepagents 0.7.32 | MIT | Ready made harness for long tasks |
langsmith 0.14.12 | MIT | The tracing client SDK (the service is separate) |
langgraph-cli 0.4.38 | MIT | The langgraph command |
langgraph-api 0.16.6 | Elastic-2.0 | The Agent Server itself |
On npm, langchain 1.5.19, @langchain/core 1.3.0 and @langchain/langgraph 1.5.2 also list MIT.
The MIT license lets you "use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies" of the software. You don't have to open source your own code, pay a royalty, or tell LangChain you're using it. If you ship the library inside something you distribute (a desktop app, a Docker image you hand to a customer, an SDK), include LangChain's license text, which most teams do in a third party notices file. If the code only runs on your own servers, nothing leaves your hands and there is nothing extra to do.
Where LangChain costs start: LangSmith pricing
LangSmith is LangChain Inc.'s commercial platform for tracing, evaluation, deployment and more. It's optional. The langsmith SDK is MIT, but the hosted service has its own terms and bills by seat and usage. From the LangSmith pricing page on October 25, 2026:
| Plan | Price | What's included |
|---|---|---|
| Developer | $0, 1 seat | Up to 5,000 base traces a month, then pay as you go; community support |
| Plus | $39 per seat per month | Up to 10,000 base traces a month, then pay as you go; 1 free small serverless deployment; unlimited seats |
| Enterprise | Custom | Self hosted and hybrid options, custom SSO and RBAC, support SLA |
Usage beyond the allowances is billed in LangChain Standard Units, and the page sets 1 LSU at $1. Base traces are kept for 14 days and extended traces for 180 days. LangChain also says LangSmith does not train models on your traces, and it offers up to $10,000 in credits for venture backed startups.
You can use LangChain commercially without ever creating a LangSmith account. Tracing is opt in through environment variables. If you want observability without LangSmith, you can send traces to another tool or skip tracing entirely.
The exception: the Agent Server is not MIT
This is the part most "yes, it's free" answers miss. When you run langgraph dev, langgraph up or a self hosted production deployment, your graph runs inside the Agent Server, which ships as the Python package langgraph-api. Its PyPI metadata lists the Elastic License 2.0, not MIT, and so does langgraph-runtime-inmem, the in memory runtime behind langgraph dev.
Elastic License 2.0 is a source available license. It allows commercial use, but it has three limits. You may not offer the software to others as a hosted or managed service that gives them a substantial set of its features. You may not move, disable or get around its license key checks. And you may not remove the licensor's notices.
In practice, LangChain's standalone server docs list two keys for a self hosted Agent Server: a LANGSMITH_API_KEY and a LANGGRAPH_CLOUD_LICENSE_KEY, which the server checks once at startup. It also needs network egress to beacon.langchain.com for license checks and usage reporting unless it runs in air gapped mode. The local development docs say langgraph dev needs only a LangSmith API key (free to sign up) and note that custom auth under langgraph up needs a license key. Self hosting the full LangSmith platform is an add on to the Enterprise plan.
The npm package @langchain/langgraph-api 1.5.5 lists MIT in its metadata, so the JavaScript side reads differently. Check the license of the exact version you install.
None of this touches the libraries. A LangGraph graph that you serve with your own FastAPI app, a queue worker or a serverless function, using langgraph and a checkpointer such as langgraph-checkpoint-postgres, uses only MIT code. The Agent Server is a convenience layer with threads, runs, cron jobs and an assistants API, and you can choose not to use it.
What we found when we audited a real install
To see what "LangChain is MIT" means for the whole dependency tree, we created a fresh Python 3.13.5 environment on October 25, 2026, installed langchain, langchain-openai and langgraph, and ran pip-licenses over it.
That install pulled in 44 packages. None was GPL, AGPL or Elastic licensed. Almost all were MIT, BSD or Apache 2.0. Two used the Mozilla Public License 2.0: certifi (the CA certificate bundle) and orjson (MPL 2.0 together with Apache 2.0 or MIT). MPL 2.0 is a file level license: it asks you to share changes you make to those files, not your own code, so using them unmodified is routine in commercial software.
Then we added langgraph-cli[inmem], the package the docs give for langgraph dev. That brought in langgraph-api and langgraph-runtime-inmem under Elastic-2.0, plus forbiddenfruit (pulled in by blockbuster, a library that detects blocking calls in async code), whose metadata lists both GPLv3 or later and MIT. So the development server is where a license review has real work to do, while the core libraries are clean.
You can repeat the check on your own project in a minute:
pip install pip-licenses
pip-licenses --order=license --format=markdown
Other costs that are not LangChain's
"Free for commercial use" covers the framework, not the services it talks to:
- Model APIs. Every call to OpenAI, Anthropic, Google or another provider is billed by that provider under its own terms. A local model through Ollama avoids per token fees, but the model weights carry their own licenses.
- Integrations. A
langchain-communityloader or tool is MIT, yet the search API, vector database or SaaS it calls has its own pricing and terms. - Gateways and hosting. If you route models through LiteLLM or a hosted gateway, or deploy on a cloud, those bills are separate. Our LLM gateway vs OpenRouter guide covers that layer.
A quick checklist before you ship
- Keep LangChain's MIT notice in a third party notices file if you distribute your app.
- Run
pip-licensesor your usual scanner on the final lockfile, not just your direct dependencies. - If you deploy with the Agent Server, read the Elastic License 2.0 terms and get a license key from LangChain. If you don't want either, serve your graph with your own web layer.
- Don't resell the Agent Server as a hosted service for others to run their agents. That is what Elastic 2.0 forbids.
- Budget for models, tracing and hosting separately from the framework, which costs nothing.
If you're weighing other frameworks, most popular ones are also permissive. CrewAI is MIT, as our LangChain vs CrewAI comparison notes, and the OpenAI Agents SDK is open source too. Our best AI agent framework for Python guide compares them, and LangChain vs n8n shows how different a source available license like n8n's is in practice.
This guide is a plain reading of public license texts and pricing pages, not legal advice. For a product with real legal exposure, have counsel review the licenses that apply to your exact build.
FAQ
Is LangChain open source?
Yes. LangChain, LangGraph, LangChain.js, LangGraph.js and Deep Agents are open source under the MIT license, one of the most permissive licenses there is. The source is on GitHub under the langchain-ai organization.
Is LangGraph free for commercial use?
Yes. The langgraph library is MIT licensed, the same as LangChain. The separate Agent Server package (langgraph-api on PyPI) is under Elastic License 2.0 and needs a license key for self hosted production use.
Do I need to pay for LangSmith to use LangChain?
No. LangSmith is optional. You can build, run and sell LangChain apps with no LangSmith account. LangSmith's Developer plan is free for one seat with 5,000 base traces a month if you want tracing.
Do I have to credit LangChain in my product?
Not in your user interface. The MIT license only asks that the copyright and permission notice travel with copies of the software. A license file or third party notices page in what you distribute covers it.
Can I sell a SaaS product built on LangChain?
Yes. A SaaS app whose agents use LangChain or LangGraph is fine under MIT. What you can't do under Elastic 2.0 is offer the Agent Server itself as a managed service for other people's agents.
Is LangChain free to use with free models?
The framework is free, and if you run open weight models locally through Ollama there are no per token fees. Check the license of each model, since some limit commercial use.



