321AI Model MarketplaceLive marketplace →

Connect LangChain to 321AI

Dev framework · configuration guide + live pricing · sign up for trial credit

LangChain's ChatOpenAI accepts a custom base_url, so the relay plugs straight in.

LangChain in one line: ChatOpenAI(base_url=...) plugs the relay into your chains. Recommended models and their market floor prices are in the table below; the full catalog is at https://321ai.cc/en/models/.

Sign up & get trial creditSee live pricing

Configuration

SettingValueNotes
base_urlhttps://321ai.cc/v1ChatOpenAI(base_url=...)
api_keyAPI key from the console
modela model name on sale

Steps

1. pip install langchain-openai

2. ChatOpenAI(model=..., base_url=..., api_key=...)

3. The rest of your chain calls stay the same as official usage

Recommended models (live market floor)

WhatWhereNotes
Live market floor pricinghttps://321ai.cc/en/models/input per 1M tokens, per-supplier quotes on the marketplace

Prices are the multi-supplier market floor and move in realtime; see all model prices →

FAQ

Which components need changes?

Only classes that take a base_url (ChatOpenAI / OpenAIEmbeddings and similar); everything else is unchanged.

Other setup guides

Claude Code Cursor Cherry Studio Cline Dify Immersive Translate LobeChat NextChat Open WebUI Codex CLI Python OpenAI SDK LiteLLM
All model pricesFeatured · 321AI communityFeatured · Open-source toolsFeatured · Advertise with usFeatured