LangChain with an India AI API (₹ billing)
Run LangChain RAG and agent chains on unoblox — swap OpenAI for Qwen, DeepSeek, or Claude and get one monthly rupee invoice with GST.
LangChain is the dominant agent and RAG framework in Python and JavaScript. unoblox makes it ₹-native: point LangChain at unoblox instead of OpenAI, choose any model — Qwen for cost, Claude for nuance, DeepSeek for reasoning, GPT-4o for general use — and get one GST invoice in rupees.
Why unoblox + LangChain
- One-line setup: swap
base_urlandapi_key, keep every chain and prompt template as-is - 40+ models: Qwen3.8-27B for everyday RAG (₹16.32/1M input), Qwen3 1.7B free for prototyping, Claude Opus for hard reasoning (₹504/1M input)
- No rewrite: LangChain's interfaces are unchanged; only configuration differs
- ₹ billing: one monthly GST invoice, input-tax-credit eligible, no currency exposure
- Both languages: works with LangChain Python and LangChain.js identically
Two-line integration
# Modern LangChain (langchain_openai package)
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
api_key="ub-gw-YOUR_API_KEY",
base_url="https://api.unoblox.ai/v1",
model="openai/gpt-4o"
)
# Use LangChain exactly as documented
chain = prompt | llm | output_parser
result = chain.invoke({"input": "What is the capital of France?"})
All LangChain features — memory, tools, chains, retrieval — work through the unoblox endpoint unchanged.
Model selection for common tasks
| LangChain task | Recommended model | ₹ per 1M input |
|---|---|---|
| Semantic search + chunking | Qwen3.8-27B | ₹16.32 |
| RAG retrieval, low cost | Qwen3 1.7B | FREE |
| Agentic reasoning | Claude Opus | ₹504 |
| Fast summarization | DeepSeek V4 Flash | ₹9.07 |
| Multi-turn chat | GPT-4o | ₹252 |
Start on Qwen3 1.7B while you build the chain; move a step up only where quality actually stalls.
Full example: RAG chain
from langchain_openai import ChatOpenAI, OpenAIEmbeddings
from langchain_community.vectorstores import FAISS
from langchain.chains import RetrievalQA
embeddings = OpenAIEmbeddings(
api_key="ub-gw-...",
base_url="https://api.unoblox.ai/v1",
model="Qwen/Qwen3-Embedding-0.6B"
)
vectorstore = FAISS.from_texts(docs, embeddings)
llm = ChatOpenAI(
api_key="ub-gw-...",
base_url="https://api.unoblox.ai/v1",
model="anthropic/claude-opus-5"
)
chain = RetrievalQA.from_chain_type(llm=llm, retriever=vectorstore.as_retriever())
chain.run("Summarize the documents")
One endpoint, one key, two unoblox models — embeddings free, the answering LLM at ₹504 per 1M input tokens.
Troubleshooting
401 Unauthorized when calling unoblox?
Check that api_key matches your dashboard value. unoblox keys are prefixed ub-gw-; OpenAI keys start with sk- — a leftover OpenAI key is the usual cause.
"Model not found" error?
Query https://api.unoblox.ai/v1/models to see the live catalog. Model ids are case-sensitive — most chat models are lowercase, but the embedding model is Qwen/Qwen3-Embedding-0.6B with a capital Q.
Slow embeddings? Qwen3-Embedding-0.6B is a small model; expect sub-second inference per chunk. Embed once and cache the vectors instead of re-embedding on every query.
How do I monitor costs? Export usage logs from your unoblox dashboard (90–180 days retained). Every call logs model name, tokens, and ₹ cost.
Can I use LangChain.js (Node.js)?
Yes. npm install @langchain/openai. Configuration is identical — one base_url, one key, the same model ids.
Do tool-use chains work?
Yes. LangChain's tool-calling agents work with Claude, GPT-4o, and Qwen — check the model card on /models if a specific model doesn't support tools.
Get started in rupees → https://unoblox.ai/sign-in
Start building in rupees
Call every major model through one OpenAI-compatible endpoint, billed in ₹ on a GST invoice.