# Use Hanzo AI with LangChain — Hanzo AI > Integrate LangChain with Hanzo AI to build chains, agents, and RAG pipelines using any of our 500+ models. Hanzo is OpenAI-compatible so ChatOpenAI just works. [Integrations](https://hanzo.ai/integrations)/LangChain ⛓️Frameworks # Use Hanzo AI with LangChain Integrate LangChain with Hanzo AI to build chains, agents, and RAG pipelines using any of our 500+ models. Hanzo is OpenAI-compatible so ChatOpenAI just works. Base URL: `https://api.hanzo.ai/v1` API Key: Get yours at [hanzo.ai/signup](https://hanzo.ai/signup) · Fully OpenAI-compatible · 500+ models available ⛓️ Created by [LangChain AI](https://langchain.com) License: MIT · [View source on GitHub →](https://github.com/langchain-ai/langchain) Hanzo AI is OpenAI-compatible, so existing LangChain code works with zero refactoring. We deeply appreciate the LangChain AI team for building and maintaining this open-source project. ## LangChain Python python ``` pip install langchain langchain-openai from langchain_openai import ChatOpenAI llm = ChatOpenAI( model="zen4-pro", openai_api_key="your-hanzo-api-key", openai_api_base="https://api.hanzo.ai/v1", ) response = llm.invoke("What is the capital of France?") print(response.content) ``` ## Chain with prompt python ``` from langchain_core.prompts import ChatPromptTemplate from langchain_openai import ChatOpenAI prompt = ChatPromptTemplate.from_template("Summarize: {text}") llm = ChatOpenAI( model="openai/gpt-4.1-mini", openai_api_key="your-hanzo-api-key", openai_api_base="https://api.hanzo.ai/v1", ) chain = prompt | llm result = chain.invoke({"text": "LangChain is a framework..."}) ``` ## LangChain TypeScript typescript ``` import { ChatOpenAI } from "@langchain/openai"; const model = new ChatOpenAI({ modelName: "zen4-pro", openAIApiKey: process.env.HANZO_API_KEY, configuration: { baseURL: "https://api.hanzo.ai/v1", }, }); const response = await model.invoke("Hello!"); ``` ## RAG with Hanzo python ``` from langchain_openai import ChatOpenAI, OpenAIEmbeddings embeddings = OpenAIEmbeddings( openai_api_key="your-hanzo-api-key", openai_api_base="https://api.hanzo.ai/v1", model="openai/text-embedding-3-large", ) llm = ChatOpenAI( model="zen4-pro", openai_api_key="your-hanzo-api-key", openai_api_base="https://api.hanzo.ai/v1", ) ``` ## Ready to get started? Create a free account and get your API key. 100K API calls/month free forever. [Get API Key — Free](https://hanzo.ai/signup)[Browse Models](https://hanzo.ai/models) ## More integrations [OpenAI Python SDK](https://hanzo.ai/integrations/openai-sdk)[Anthropic SDK](https://hanzo.ai/integrations/anthropic-sdk)[LlamaIndex](https://hanzo.ai/integrations/llamaindex)[Vercel AI SDK](https://hanzo.ai/integrations/vercel-ai-sdk)[Hugging Face](https://hanzo.ai/integrations/huggingface)[AutoGen](https://hanzo.ai/integrations/autogen)[CrewAI](https://hanzo.ai/integrations/crewai)[DSPy](https://hanzo.ai/integrations/dspy)[Haystack](https://hanzo.ai/integrations/haystack)[Cursor](https://hanzo.ai/integrations/cursor)[Continue.dev](https://hanzo.ai/integrations/continue-dev)[GitHub Copilot](https://hanzo.ai/integrations/github-copilot)[Docker](https://hanzo.ai/integrations/docker)[Kubernetes](https://hanzo.ai/integrations/kubernetes)[Python](https://hanzo.ai/integrations/python)[TypeScript](https://hanzo.ai/integrations/typescript)[Go](https://hanzo.ai/integrations/go)[Rust](https://hanzo.ai/integrations/rust)