Integrations

LangChain

LangChain is a framework for building applications powered by large language models. It provides tools for prompt management, chains, agents, and retrieval-augmented generation (RAG). Since MARA Cloud is OpenAI-compatible, you can use LangChain's OpenAI integration with a custom base URL.

Prerequisites

  • Python 3.9+ or Node.js 18+
  • A MARA Cloud API key. See API Keys and URLs to generate one.

Setup

Install the LangChain OpenAI package:
bash
pip install langchain-openai

Configuration

Point LangChain's OpenAI provider to MARA Cloud by setting the base_url and api_key:
python
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    base_url="https://api.cloud.mara.com/v1",
    api_key="your-mara-api-key",
    model="MiniMax-M2.5",
    temperature=0.7,
)

response = llm.invoke("Explain what a vector database is in two sentences.")
print(response.content)

Learn more