LangChain Platform integration · LangChain

LangChain multiplies calls. Codex Hosted flattens the bill.

One user request can become a dozen model calls inside a chain. Point ChatOpenAI at ProxyLLM and the OpenAI-bound calls run on your ChatGPT subscription through Codex Hosted, with your API key as fallback.

$129/month SaaS. Bring your own model keys. No inference markup.

Three steps to connect.

01

Create a chain key

Generate one ProxyLLM key per app, worker, or environment. LangChain chains can call models many times, so scoped caps matter.

02

Configure ChatOpenAI

Set configuration.baseURL to https://api.proxyllm.ai/v1 and use the ProxyLLM key as the API key.

03

Let agents loop

Retries and agent loops bill to the flat subscription, not per token. At a plan limit, ProxyLLM falls back to a second Codex account or your own API key until it resets.

Set the ChatOpenAI base URL.

Keep LangChain's model interface and point it at ProxyLLM.

chain.ts
import { ChatOpenAI } from "@langchain/openai";

const model = new ChatOpenAI({
  model: "gpt-4o-mini",
  apiKey: process.env.PROXYLLM_API_KEY,
  configuration: {
    baseURL: "https://api.proxyllm.ai/v1",
  },
});
Codex Hosted · the main feature

Run your AI workloads on your ChatGPT subscription.

ProxyLLM runs OpenAI's Codex for you, signed in with your own ChatGPT account. Your apps call one OpenAI-compatible endpoint and the work bills to your flat plan instead of per-token API pricing.

$129/month · normal SaaS pricing

Agents that retry shouldn't bill per retry.

Codex Hosted serves OpenAI calls from your ChatGPT subscription. The request log shows what every chain run did, call by call.