OpenRouter 통합

OpenRouter 통합

LangChain JavaScript로 OpenRouter의 통합 API를 통해 여러 프로바이더의 모델에 접근하는 방법을 알아봅니다.

OpenRouter는 단일 엔드포인트를 통해 여러 프로바이더(OpenAI, Anthropic, Google, Meta 등)의 모델에 접근을 제공하는 통합 API로, 프로바이더 라우팅과 멀티 모델 폴백 같은 기능을 갖추고 있어요.

출처: 문서

본문

설치

npm install @langchain/openrouter @langchain/core

환경에 OPENROUTER_API_KEY를 설정하세요. 설정 세부 사항은 ChatOpenRouter 페이지를 참조하세요.

채팅 모델(Chat models)

  • ChatOpenRouter — OpenRouter 통합 API를 통해 여러 프로바이더의 채팅 모델에 접근합니다.

더 알아보기 (Learn more)