Integration
LangChain with LLMcode
LangChain's ChatOpenAI accepts a custom base_url. Point it at LLMcode and keep the rest of the chain unchanged.
Updated
Python
Pass base_url and api_key to ChatOpenAI. The model is a published profile slug, for example flash.
Embeddings use the same base URL with OpenAIEmbeddings.
JavaScript
In @langchain/openai, pass configuration.baseURL. The API key can come from an environment variable.
If you use LangGraph or an agent executor, set recursion and token limits: agent loops are the fastest way to burn a balance.
Tracing and cost
LLMcode does not send traces to LangSmith. If you use LangSmith, it observes calls on your side; the LLMcode journal remains the billing source.
The journal stores the applied price per request, so you can reconcile a chain run with the actual spend.
Connect
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
base_url="https://llmcode.io/v1",
api_key=os.environ["LLMCODE_API_KEY"],
model="deepseek-flash",
)import { ChatOpenAI } from "@langchain/openai";
const llm = new ChatOpenAI({
configuration: { baseURL: "https://llmcode.io/v1" },
apiKey: process.env.LLMCODE_API_KEY,
model: "deepseek-flash",
});Published model prices
USD per 1M tokens. The numbers come from the public catalog on every page rebuild — this is the sale price, not an estimate.
| Model | Input | Output | Cache |
|---|---|---|---|
| Claude Opus 5.5 | $2.70 | $8.00 | $0.14 |
| DeepSeek Flash | $0.50 | $2.00 | $0.01 |
| Claude Sonnet 5.5 | $1.33 | $6.67 | $0.07 |
| DeepSeek V4 Pro | $2.20 | $6.60 | $0.07 |
Top-up from $10, balance in USD. 1 USD = 1,000,000 UT. No subscription and no auto-charge.
Questions
Which class should I use?
ChatOpenAI for chat models. The OpenAI-compatible base URL is enough; no custom LangChain integration is required.
Do tools and function calling work?
They depend on the upstream model and the OpenAI-compatible shape. Test your tool schema before production.
How do I keep agent costs bounded?
Use a key with a spend limit, cap max_tokens and set a recursion limit in the agent.