Get FREE $10 20% OFF OPENAI MODELS FOR LIFE
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.

Request $10 with BONUS10. No credit card required. Manually approved within 24 hours.

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 ChatGPT plan instead of per-token API pricing.

BONUS10 · $10 signup bonus

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.