DeepSeek V4.1 Flash Uncensored · Try it →

LangChain with Heabsy: ChatHeabsy from langchain-heabsy

Install langchain-heabsy and use ChatHeabsy: it is LangChain's ChatOpenAI with the Heabsy base URL built in, the key read from HEABSY_API_KEY, token usage on streams switched on, and the model's reasoning text kept in additional_kwargs["reasoning_content"] on non-streaming calls. ChatHeabsy is listed among LangChain's chat model integrations; plain ChatOpenAI with a base_url works as well and is shown below.

Python
# pip install langchain-heabsy
# export HEABSY_API_KEY="<your key>"
from langchain_heabsy import ChatHeabsy

llm = ChatHeabsy(model="qwen38")
reply = llm.invoke("Say hello from Heabsy in five words.")
print(reply.content, reply.usage_metadata)

LangChain chat model integrations · langchain-heabsy on PyPI

Create a Heabsy key OpenAI base URL https://api.heabsy.com/v1 · Anthropic base URL https://api.heabsy.com

What ChatHeabsy sets for you

  1. Base URL https://api.heabsy.com/v1 — nothing to configure.
  2. The key from the HEABSY_API_KEY environment variable, or pass heabsy_api_key="…".
  3. stream_usage=True: streamed responses end with token counts in usage_metadata.
  4. Reasoning text from models that think before answering is kept in reply.additional_kwargs["reasoning_content"] on non-streaming calls; ChatOpenAI drops it.
  5. Everything else is ChatOpenAI: temperature, max_tokens, bind_tools, with_structured_output, async and batch calls work unchanged. The only dependency is langchain-openai.

Tools, agents and LangGraph

llm.bind_tools([...]) and agents built on ChatHeabsy work with models that support tool calling — every model in the table does. LangGraph nodes use the same chat model object, so configure it once.

Alternative: ChatOpenAI with a base_url

Without the package, point ChatOpenAI from langchain-openai at Heabsy. Set stream_usage=True yourself — LangChain leaves it off for custom base URLs — and note that reasoning fields are not extracted. Setting OPENAI_BASE_URL=https://api.heabsy.com/v1 and OPENAI_API_KEY also moves existing code over, but affects every OpenAI client in the process.

Python — ChatOpenAI
# pip install langchain-openai
import os
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="qwen38",
    base_url="https://api.heabsy.com/v1",
    api_key=os.environ["HEABSY_API_KEY"],
    stream_usage=True,
)

Which model should I pick?

Our own models run in the EEA, all except DeepSeek V4.1 Flash Uncensored, and store no prompts, which matters when a chain feeds customer documents to the model. For extraction and classification steps the cheapest model in the table is often enough; for agents, pick qwen38 or mimo-v26-flash.

ModelIDContextMax outputRunsInput / 1MOutput / 1M
Qwen3.8 27B Fableqwen38-fable512K32KEEA$0.10$0.61
Qwen3.8 27B Queenqwen38-queen512K32KEEA$0.10$0.61
GLM 5.3 Flash Uncensoredglm53-flash-unc1M128KEEA$0.20$0.8001
Qwen3.8 27B Obliteratedqwen38-obl512K32KEEA$0.21$1.47
DeepSeek V4.1 Flash 1017 Uncensoreddeepseek-v4.1-flash-1017-unc1M64Koutside EEA$0.40$1.40
DeepSeek V4.1 Flash Uncensoreddeepseek-v4.1-flash-unc1M64Koutside EEA$0.40$1.40
MiMo V2.6 Flash Uncensoredmimo-v26-flash-unc1M64KEEA$0.4624$1.4999
Qwen3.8 27B Uncensoredqwen38-unc512K230KEEA$0.4887$2.17
MiMo V2.6 Flashmimo-v26-flash1M64KEEA$0.50$1.50
MiMo V2.6 Flash Abliteratedmimo-v26-flash-abl1M64KEEA$0.50$1.50
Qwen3.8 27B Uncensored Fast by Heabsyqwen38-unc-fast512K230KEEA$0.8299$2.62
Qwen3.8 27Bqwen38512K32KEEA$1.05$3.15
CyberHeabsycyberheabsy1M64KEEA$1.50$4.50

All models above run on Heabsy hardware in the EEA, except DeepSeek V4.1 Flash Uncensored; prompts and completions are not stored. Thecatalog also lists 24 partner-hosted models — Claude, GPT-6, Kimi K3, DeepSeek V4 and others — with the same key and invoice, but without zero data retention and without an EEA guarantee.

Verify it works

Run the snippet: it prints the reply and usage_metadata with input and output token counts. With ChatOpenAI, empty usage while streaming means stream_usage is still off.

If the tool shows an error you cannot read, test the key on its own first — one short request outside the tool:

curl
curl https://api.heabsy.com/v1/chat/completions \
  -H "Authorization: Bearer $HEABSY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"qwen38","max_tokens":16,"messages":[{"role":"user","content":"Say hi"}]}'

Troubleshooting

What you seeWhat to change
ModuleNotFoundError: No module named 'langchain_heabsy'Install the package into the same environment that runs your code: pip install langchain-heabsy.
usage_metadata is empty when streamingChatHeabsy turns it on; with ChatOpenAI, set stream_usage=True.
No reasoning_content in additional_kwargsIt is kept on non-streaming calls with ChatHeabsy, for models that reason. Streamed calls and ChatOpenAI do not carry it.
404 on every callWith ChatOpenAI, base_url must be https://api.heabsy.com/v1. Do not turn on use_responses_api — Heabsy serves Chat Completions, not the Responses API.
Model not foundUse the exact catalog ID; GET /v1/models lists the IDs your key may call.
403 with an HTML page ("Sorry, you have been blocked")No key was sent at all: the key variable is empty or not set where the tool runs. Requests without a key are stopped before they reach the API; a wrong key gets a JSON 401 instead.

Where do my prompts go?

From LangChain straight to api.heabsy.com. On our own models the request is processed in the European Economic Area, except DeepSeek V4.1 Flash Uncensored and the text is not stored — we keep what billing needs: the model, the token counts and the time. Partner-hosted models are processed by third-party inference providers; each is marked in the catalog, and none of them carries the no-retention promise. The terms are in the data processing agreement, the invoice comes from an EU company.

FAQ

Is langchain-heabsy an official LangChain integration?+

ChatHeabsy is listed in LangChain's table of chat model integrations and is maintained by Heabsy, not by LangChain. It is a thin wrapper around ChatOpenAI, so LangChain's own documentation for ChatOpenAI applies to it.

Does LangGraph work with Heabsy?+

Yes. LangGraph nodes call the same ChatHeabsy or ChatOpenAI object; configure it once as above.

Can I use embeddings from Heabsy?+

No. Heabsy serves chat and reasoning models; keep your current embedding model for retrieval and use Heabsy for generation.

Is customer data processed in the EU?+

With our own models, yes — all except DeepSeek V4.1 Flash Uncensored: processing in the EEA, no stored prompts, invoice from an EU company. Partner-hosted models are marked in the catalog and carry no such promise.

Also set up:Vercel AI SDK · n8n · Open WebUI

LangChain is a trademark of LangChain, Inc.; Heabsy is not affiliated with or endorsed by LangChain. langchain-heabsy is maintained by Heabsy.