跳转到内容
exoticrouter.com ↗

LangChain

提供模型集成和抽象,用来构建智能体。用一个 Base URL 和一个密钥,把 LangChain 接到 ExoticRouter:这里是要填的值,以及它们在 LangChain 里填在哪里。

设置 值
Base URL(OpenAI 兼容 API) https://api.exoticrouter.com/v1
Base URL(Anthropic API) https://api.exoticrouter.com
Base URL(Gemini API) https://api.exoticrouter.com
API 密钥 你的密钥,在 API 密钥页面
模型 模型 ID,例如 anthropic/claude-sonnet-5-5,见模型页面

如果工具会自己在地址后面加 /v1,就填 https://api.exoticrouter.com。

这是一个示例,只列了几个模型,密钥用占位符代替。把 sk-er-YOUR-KEY 换成你自己的密钥。

example.py
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="anthropic/claude-opus-5-5", base_url="https://api.exoticrouter.com/v1", api_key="sk-er-YOUR-KEY")
reply = llm.invoke("Hello")
print(reply.content)

先安装 langchain-openai。模型库里的每个模型都能通过这个接口调用。

API 模型
OpenAI 兼容 模型库里的所有文本模型
Anthropic Claude 模型
Gemini Gemini 模型

这个设置的说明见 LangChain 自己的文档。