Runnable LangChain and LangGraph examples using the official capsolver-agent library.
This repository contains examples only. There is no separate
langchain-capsolverPython package or release lifecycle.
The CapSolver Agent library already provides LangChain BaseTool implementations with typed inputs and async execution. This repository shows how to pass those tools to a LangChain agent; solving, errors, retries, and browser behavior remain in the shared CapSolver libraries.
Requirements: Python 3.10+, a CapSolver API key, and an OpenAI API key for the sample model.
git clone https://github.com/capsolver-ai/langchain-capsolver.git
cd langchain-capsolver
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txtExport the variables shown in .env.example, then run:
python examples/quickstart.pyfrom capsolver_agent.langchain_tools import get_langchain_tools
from langchain.agents import create_agent
agent = create_agent(
model="openai:gpt-4.1-mini",
tools=get_langchain_tools(),
system_prompt="Use CapSolver only for authorized workflows.",
)See examples/quickstart.py for a complete invocation.
- Typed
SolveCaptchaTool,DetectCaptchasTool, andSolveOnPageToolclasses. - Balance and capability tools.
- Consistent structured results from the same executor used by other frameworks.
- Optional browser-mode support through the shared SDK.
examples/quickstart.py LangChain agent using CapSolver tools
requirements.txt Shared SDK repositories plus LangChain
tests/test_demo.py Offline syntax and repository-scope checks
.github/workflows/ci.yml Demo validation
Use CapSolver only in lawful, user-authorized, terms-compliant automation. Never commit API keys, cookies, tokens, proxy credentials, or private target data.
See CONTRIBUTING.md, SUPPORT.md, and SECURITY.md.
Licensed under the ISC License. LangChain and LangGraph are third-party projects. This repository is maintained by CapSolver and is not affiliated with or endorsed by LangChain.