# Use Hanzo AI with Haystack — Hanzo AI > Build NLP pipelines and RAG systems with Haystack. Point OpenAIChatGenerator at api.hanzo.ai/v1, name a Hanzo model, and the pipeline runs unchanged. [Integrations](https://hanzo.ai/integrations)/Haystack 🌾Frameworks # Use Hanzo AI with Haystack Build NLP pipelines and RAG systems with Haystack. Point OpenAIChatGenerator at api.hanzo.ai/v1, name a Hanzo model, and the pipeline runs unchanged. 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 [deepset.ai](https://haystack.deepset.ai) License: Apache-2.0 · [View source on GitHub →](https://github.com/deepset-ai/haystack) Hanzo AI is OpenAI-compatible, so existing Haystack code works with zero refactoring. We deeply appreciate the deepset.ai team for building and maintaining this open-source project. ## Haystack + Hanzo python ``` pip install haystack-ai from haystack.components.generators.chat import OpenAIChatGenerator from haystack.dataclasses import ChatMessage from haystack.utils import Secret generator = OpenAIChatGenerator( model="zen4-pro", api_key=Secret.from_token("your-hanzo-api-key"), api_base_url="https://api.hanzo.ai/v1", ) messages = [ChatMessage.from_user("What is RAG?")] result = generator.run(messages=messages) ``` ## RAG pipeline python ``` from haystack import Pipeline from haystack.components.builders import PromptBuilder from haystack.components.generators.chat import OpenAIChatGenerator prompt_template = """ Context: {% for doc in documents %}{{ doc.content }}{% endfor %} Question: {{ question }} Answer: """ pipeline = Pipeline() pipeline.add_component("prompt", PromptBuilder(template=prompt_template)) pipeline.add_component("llm", OpenAIChatGenerator( model="zen4-pro", api_key=Secret.from_token("your-hanzo-api-key"), api_base_url="https://api.hanzo.ai/v1", )) ``` ## Embeddings python ``` from haystack.components.embedders import OpenAITextEmbedder embedder = OpenAITextEmbedder( model="openai/text-embedding-3-large", api_key=Secret.from_token("your-hanzo-api-key"), api_base_url="https://api.hanzo.ai/v1", ) ``` ## Install bash ``` pip install haystack-ai export HANZO_API_KEY="your-hanzo-api-key" ``` ## 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)[LangChain](https://hanzo.ai/integrations/langchain)[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)[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)