Skip to main content
LibreChat is joining ClickHouse to power the open-source Agentic Data Stack 🎉 Learn more
LibreChat

カスタムエンドポイントオブジェクト構造

custom 配列内の各 endpoint は、以下の構造である必要があります。

endpoints:
  custom:
    # Example using Mistral AI API
    - name: 'Mistral'
      apiKey: '${YOUR_ENV_VAR_KEY}'
      baseURL: 'https://api.mistral.ai/v1'
      models:
        default: ['mistral-tiny', 'mistral-small', 'mistral-medium', 'mistral-large-latest']
      titleConvo: true
      titleTiming: 'immediate'
      titleModel: 'mistral-tiny'
      modelDisplayLabel: 'Mistral'
      # customParams:
      #   reasoningFormat: reasoning_object
      #   reasoningKey: reasoning_content
      # tokenConfig:
      #   mistral-large-latest:
      #     prompt: 2
      #     completion: 6
      #     context: 128000
      # addParams:
      #   safe_prompt: true # Mistral specific value for moderating messages
      # NOTE: For Mistral, it is necessary to drop the following parameters or you will encounter a 422 Error:
      dropParams: ['stop', 'user', 'frequency_penalty', 'presence_penalty']
 
    # Example using the native Anthropic Messages API
    - name: 'Claude-Compatible'
      provider: 'anthropic'
      apiKey: '${ANTHROPIC_API_KEY}'
      baseURL: 'https://api.anthropic.com'
      headers:
        anthropic-version: '2023-06-01'
      models:
        default: ['claude-sonnet-4-5', 'claude-opus-4-5']
        fetch: false
      titleConvo: true
      titleModel: 'claude-sonnet-4-5'
      modelDisplayLabel: 'Claude (Compatible)'

name

キー:

KeyTypeDescriptionExample
nameStringエンドポイントの一意な名前。Will be used as the "title" in the Endpoints Selector

必須

例:

name: 'Mistral'

apiKey

キー:

KeyTypeDescriptionExample
apiKeyString (apiKey | "user_provided")サービス用のAPIキー。環境変数を参照するか、ユーザーが値を入力できるようにします。It's highly recommended to use the env. variable reference for this field, i.e. `${YOUR_VARIABLE}`

必須

例:

apiKey: '${MISTRAL_API_KEY}'

または

apiKey: 'your_api_key'

または

apiKey: 'user_provided'

baseURL

キー:

KeyTypeDescriptionExample
baseURLString (baseURL | "user_provided")APIのベースURL。環境変数を参照するか、ユーザーが値を指定できるようにします。It's highly recommended to use the env. variable reference for this field, i.e. `${YOUR_VARIABLE}`

必須

例:

baseURL: 'https://api.mistral.ai/v1'

または

baseURL: '${MISTRAL_BASE_URL}'

または

baseURL: 'user_provided'

注記:

  • 設定した baseURL が完全な補完エンドポイントである場合、directEndpoint フィールドを true に設定することで、それを直接使用できます。
    • これは、アプリがデフォルトで baseURL に "/chat/completions" または "/completion" を付加するために必要です。
  • provider: anthropic を使用する場合、baseURL には Anthropic SDK が呼び出すべき API ルート(https://api.anthropic.com や独自のゲートウェイルートなど)を設定してください。LibreChat は、そのプロバイダーに対してネイティブの Anthropic /v1/messages パスを使用します。

provider

キー:

KeyTypeDescriptionExample
providerStringデフォルトのOpenAI互換クライアントではなく、ネイティブプロバイダークライアント経由でカスタムendpointをルーティングします。Currently supports `anthropic`.

デフォルト: 省略。OpenAI互換のカスタムendpointパスが使用されます。

サポートされている値:

  • "anthropic" - このエンドポイントの baseURLapiKeyheadersaddParamsdropParams、および customParams.paramDefinitions を使用して、ネイティブの Anthropic /v1/messages クライアントを使用します。

例:

endpoints:
  custom:
    - name: 'Claude-Compatible'
      provider: 'anthropic'
      apiKey: '${ANTHROPIC_API_KEY}'
      baseURL: 'https://api.anthropic.com'
      headers:
        anthropic-version: '2023-06-01'
      models:
        default:
          - 'claude-sonnet-4-5'
          - 'claude-opus-4-5'
        fetch: false
      titleConvo: true
      titleModel: 'claude-sonnet-4-5'
      modelDisplayLabel: 'Claude (Compatible)'

注記:

  • Anthropic自体、またはネイティブのMessages APIに対応したAnthropic互換ゲートウェイを使用する場合は、provider: anthropicを使用してください。
  • models.default の下にモデルを明示的にリストしてください。OpenAI形式の models.fetch は、ネイティブの Anthropic カスタムエンドポイントには使用されません。
  • プロバイダーは、明示的に異なる customParams.defaultParamsEndpoint を設定しない限り、Anthropic UI パラメーターを意味します。
  • provider を持たない endpoint は、OpenAI 互換の動作を維持します。

iconURL

キー:

KeyTypeDescriptionExample
iconURLStringエンドポイントアイコンとして使用する画像URL、公開アセットパス、または組み込みのエンドポイントアイコンキー。

デフォルト: ""

例:

iconURL: https://github.com/danny-avila/LibreChat/raw/main/docs/assets/LibreChat.svg

または、組み込みの endpoint アイコンを再利用します:

iconURL: openAI

注記:

  • カスタムエンドポイントの name を、アイコンを再利用するためだけに組み込みエンドポイントの名前に設定しないでください。カスタムエンドポイント名は一意である必要があり、以下のようなデフォルトのエンドポイント値を使用してはいけません:
    • "openAI" | "azureOpenAI" | "google" | "anthropic" | "assistants" | "azureAssistants" | "agents" | "bedrock"
  • プロジェクトに含まれるendpointアイコンを使用するには、カスタムendpointのnameを一意に保ち、代わりにiconURLを組み込みのendpointキーのいずれかに設定してください。
    • "openAI" | "azureOpenAI" | "google" | "anthropic" | "assistants" | "azureAssistants" | "agents" | "bedrock"
  • カスタム画像を使用するには、iconURL を画像のURL、または /assets/my-icon.svg のように LibreChat によって提供されるパスに設定します。
  • また、アイコンが用意されている「既知のendpoint」(大文字・小文字は区別されません)も存在します。endpointの name が以下の名前と一致する場合は、このフィールドを省略してください:
    • Anyscale
    • APIpie
    • Cohere
    • Deepseek
    • 花火
    • groq
    • Helicone
    • Hugging Face
    • Mistral
    • MLX
    • Moonshot
    • ollama
    • OpenRouter
    • Perplexity
    • Qwen
    • ShuttleAI
    • together.ai
    • 統合
    • xai

models

キー:

KeyTypeDescriptionExample
modelsObjectモデルの設定

必須

プロパティ:

default

キー:

KeyTypeDescriptionExample
defaultArray of Strings使用するデフォルトモデルを示す文字列の配列。If fetching models fails, these defaults are used as a fallback.

必須

例:

default:
  - 'mistral-tiny'
  - 'mistral-small'
  - 'mistral-medium'

fetch

キー:

KeyTypeDescriptionExample
fetchBoolean`true` に設定すると、APIからモデルのリストを取得しようとします。May cause slowdowns during initial use of the app if the response is delayed. Defaults to `false`.

デフォルト: false

例:

fetch: true

userIdQuery

キー:

KeyTypeDescriptionExample
userIdQueryBoolean`true` に設定すると、LibreChat のユーザーIDを API モデルリクエストのクエリパラメータとして追加します。

デフォルト: false

例:

userIdQuery: true

titleConvo

キー:

KeyTypeDescriptionExample
titleConvoBoolean`true` に設定すると、会話のタイトル生成を有効にします。

デフォルト: false

例:

titleConvo: true

titleTiming

キー:

KeyTypeDescriptionExample
titleTimingString会話タイトルの生成タイミングを制御します。有効な値は "immediate" または "final" です。Defaults to "immediate".

デフォルト: "immediate"

利用可能な値:

  • "immediate" - ユーザーの最初のメッセージを使用して、リクエスト開始直後にモデルの応答と並行してタイトルを生成します。
  • "final" - タイトルの生成を完全な応答が完了するまで延期します。これにより、従来の動作が維持されます。

例:

titleTiming: 'final'

titleMethod

キー:

KeyTypeDescriptionExample
titleMethodString会話タイトルの生成に使用されるメソッドを制御します。Valid values: "completion" (default), "structured", "functions" (legacy alias for "structured")

デフォルト: "completion"

利用可能なメソッド:

  • "completion" - ツールや関数を使用しない標準の completion API を使用します。ほとんどの LLM と互換性があります。
  • "structured" - タイトル生成に構造化出力を使用します。プロバイダー/モデルによるサポートが必要です。
  • "functions" - "structured" のレガシーエイリアスです。機能的には同一です。

例:

titleMethod: 'completion'

titleModel

キー:

KeyTypeDescriptionExample
titleModelStringタイトルに使用するモデルを指定します。Defaults to "gpt-3.5-turbo" if omitted. May cause issues if "gpt-3.5-turbo" is not available. You can also dynamically use the current conversation model by setting it to "current_model".

デフォルト: "gpt-3.5-turbo"

例:

titleModel: 'mistral-tiny'
titleModel: 'current_model'

titlePrompt

キー:

KeyTypeDescriptionExample
titlePromptStringタイトル生成用のカスタムプロンプト。{convo} プレースホルダーを含める必要があります。Allows full control over how titles are generated.

デフォルト:

Analyze this conversation and provide:
1. The detected language of the conversation
2. A concise title in the detected language (5 words or less, no punctuation or quotation)

{convo}

注記:

  • 常に {convo} プレースホルダーを含める必要があります
  • {convo} プレースホルダーは、フォーマットされた会話に置き換えられます。

例:

titlePrompt: "Create a brief, descriptive title for the following conversation:\n\n{convo}\n\nTitle:"

titlePromptTemplate

キー:

KeyTypeDescriptionExample
titlePromptTemplateStringtitlePrompt内の {convo} を置き換える、会話コンテンツのフォーマット用テンプレート。Must include {input} and {output} placeholders.

デフォルト: "User: {input}\nAI: {output}"

注記:

  • {input}{output} の両方のプレースホルダーを含める必要があります
  • titlePrompt に挿入される際の会話のフォーマット方法を制御します。

例:

titlePromptTemplate: "Human: {input}\n\nAssistant: {output}"

titleEndpoint

キー:

KeyTypeDescriptionExample
titleEndpointStringタイトル生成に使用する代替のendpointを指定します。Allows using a different model/endpoint for titles.

デフォルト: 現在のカスタム endpoint を使用します

許容値:

  • openAI
  • azureOpenAI
  • google
  • anthropic
  • bedrock
  • 別のカスタム endpoint 名

例:

# Use a different custom endpoint for titles
endpoints:
  custom:
    - name: 'my-chat-endpoint'
      apiKey: '${CHAT_API_KEY}'
      baseURL: 'https://api.example.com/v1/chat'
      models:
        default: ['gpt-4']
      titleEndpoint: 'my-title-endpoint'
 
    - name: 'my-title-endpoint'
      apiKey: '${TITLE_API_KEY}'
      baseURL: 'https://api.example.com/v1/title'
      models:
        default: ['gpt-3.5-turbo']

modelDisplayLabel

キー:

KeyTypeDescriptionExample
modelDisplayLabelString現在のAIモデルのアイコンの横にメッセージ内で表示されるラベル。The display order is: 1. Custom name set via preset (if available), 2. Label derived from the model name (if applicable), 3. This value is used if the above are not specified. Defaults to "AI".

デフォルト: "AI"

例:

modelDisplayLabel: 'Mistral'

addParams

キー:

KeyTypeDescriptionExample
addParamsObject/Dictionaryリクエストに追加のパラメータを追加します。値には文字列、数値、ブール値、配列、またはネストされたオブジェクトを指定できます。リクエストでウェブ検索を有効にするための `web_search: true` をサポートしています。Adds/Overrides parameters. Useful for specifying API-specific options.

例:

addParams:
  safe_prompt: true
  max_tokens: 2048

注記:

  • addParams フィールドを使用すると、デフォルトのペイロードに含まれていない追加のパラメータを含めることができます("Default Parameters" セクションを参照してください)。これは、API固有のオプションを指定する場合に特に便利です。

dropParams

キー:

KeyTypeDescriptionExample
dropParamsArray/List of Stringsリクエストからデフォルトのパラメータを削除します。Excludes specified default parameters. Useful for APIs that do not accept or recognize certain parameters.

例:

dropParams:
  - 'stop'
  - 'user'
  - 'frequency_penalty'
  - 'presence_penalty'

注:

  • dropParams フィールドを使用すると、すべてのリクエストと共に送信される "Default Parameters" を削除できます。これは、特定のパラメータを受け付けない、または認識しないAPIを扱う際に役立ちます。

customParams

キー:

KeyTypeDescriptionExample
customParamsObject/Dictionaryプロバイダーのリクエストボディに含まれない、カスタムendpointの動作および設定メタデータを定義します。Used for endpoint-specific configuration such as reasoning parameter shape.

サブキー:

KeyTypeDescriptionExample
defaultParamsEndpointStringリクエストパラメータのメタデータに使用されるendpointのデフォルト値。デフォルトは `custom` です。`provider: anthropic` が設定されており、このフィールドが省略された場合、LibreChatはAnthropicのパラメータセットを使用します。defaultParamsEndpoint: custom
reasoningFormatStringOpenAI互換のカスタムエンドポイントへ推論パラメータを送信する方法を制御します。有効な値: `reasoning_effort`、`reasoning_object`、`disabled`。reasoningFormat: reasoning_object
reasoningKeyStringプロバイダーの推論コンテンツを読み取るために使用するレスポンスキーを制御します。有効な値は `reasoning` または `reasoning_content` です。reasoningKey: reasoning_content
paramDefinitionsArray/Listこのendpointのカスタム設定定義。See default parameter definitions.

推論フォーマット:

  • reasoning_effort - レガシーな reasoning_effort パラメータを送信します。
  • reasoning_object - 新しいOpenAI互換の形式に従うプロバイダー向けに、{ effort, summary } のような reasoning オブジェクトを送信します。
  • disabled - ユーザーまたは Model Specs が推論を選択した場合でも、推論パラメーターを抑制します。

Anthropic プロバイダーに関する注記:

カスタムエンドポイントでネイティブの Anthropic Messages API を使用する必要がある場合は、provider: anthropic を使用してください。OpenAI 互換のカスタムエンドポイントパスを維持しつつ、Anthropic スタイルのパラメータメタデータとリクエスト適応が必要な場合にのみ、provider を指定せずに customParams.defaultParamsEndpoint: anthropic を使用してください。

例:

customParams:
  reasoningFormat: reasoning_object
  reasoningKey: reasoning_content

tokenConfig

キー:

KeyTypeDescriptionExample
tokenConfigObject/Dictionaryこのカスタムendpointのモデル固有のコンテキストウィンドウと、100万トークンあたりの料金を定義します。Used by context usage, visible cost breakdowns, balance transactions, and multi-endpoint agent billing.

各キーはモデル名です。各モデルのエントリは以下をサポートしています:

KeyTypeDescriptionExample
promptNumber100万トークンあたりのプロンプト/入力トークン料金。Required
completionNumber100万トークンあたりの補完/出力トークンレートRequired
contextNumberモデルの最大コンテキストウィンドウ。Required
cacheReadNumber100万トークンあたりのキャッシュ入力読み取りレートOptional
cacheWriteNumber100万トークンあたりのキャッシュ入力書き込みレート。Optional

例:

tokenConfig:
  gpt-4o-mini:
    prompt: 0.15
    completion: 0.6
    context: 128000
    cacheRead: 0.075
    cacheWrite: 0.15

注記:

  • レートは、interface.currency による表示用の変換が適用される前の、100万トークンあたりの米ドル(USD)で表されます。
  • モデル名は、カスタム endpoint を通じて送信されるモデル値と一致している必要があります。
  • 複数のendpointを使用するAgentの場合、使用量とコストを記録する際には、一致するendpoint/modelのトークン設定が使用されます。

headers

キー:

KeyTypeDescriptionExample
headersObject/Dictionaryリクエストに追加のヘッダーを追加します。すべてのヘッダー値は文字列である必要があります。`{{LIBRECHAT_USER_*}}` を使用した動的なユーザーフィールド置換、`{{LIBRECHAT_BODY_*}}` を使用したリクエストボディのプレースホルダー、および `${ENV_VAR}` を使用した環境変数をサポートしています。The `headers` object specifies custom headers for requests. Useful for authentication and setting content types.

例:

headers:
  x-api-key: '${ENVIRONMENT_VARIABLE}'
  Content-Type: 'application/json'
  X-User-ID: '{{LIBRECHAT_USER_ID}}'
  X-User-Email: '{{LIBRECHAT_USER_EMAIL}}'

注: 動的な環境変数の値をサポートしており、"${VARIABLE_NAME}" という形式を使用します。

models.fetch: true が使用される場合、これらのヘッダーも解決され、管理者によって制御されるベースURLへのモデルリストリクエストに転送されます。設定された Authorization ヘッダーは、エンドポイントの apiKey フォールバックよりも優先されます。これは、ユーザーごとのモデルリストを返す認証対応プロキシにとって有用です。baseURL: "user_provided" が設定されている場合、LibreChatは設定されたヘッダーテンプレートをユーザーが提供した宛先に転送しません。provider: anthropic の場合、ヘッダーはOpenAI互換クライアントではなく、ネイティブのAnthropicクライアントを通じて転送されます。

利用可能なユーザーフィールドのプレースホルダー:

プレースホルダーユーザーフィールド説明
{{LIBRECHAT_USER_ID}}idStringユーザーの一意識別子
{{LIBRECHAT_USER_NAME}}nameStringユーザーの表示名
{{LIBRECHAT_USER_USERNAME}}usernameStringユーザーのユーザー名
{{LIBRECHAT_USER_EMAIL}}emailStringユーザーのメールアドレス
{{LIBRECHAT_USER_PROVIDER}}providerString認証プロバイダー (例: "email", "google", "github")
{{LIBRECHAT_USER_ROLE}}roleStringユーザーのロール (例: "user", "admin")
{{LIBRECHAT_USER_GOOGLEID}}googleIdStringGoogleアカウントID
{{LIBRECHAT_USER_FACEBOOKID}}facebookIdStringFacebookアカウントID
{{LIBRECHAT_USER_OPENIDID}}openidIdStringOpenIDアカウントID
{{LIBRECHAT_USER_SAMLID}}samlIdStringSAMLアカウントID
{{LIBRECHAT_USER_LDAPID}}ldapIdStringLDAPアカウントID
{{LIBRECHAT_USER_GITHUBID}}githubIdStringGitHubアカウントID
{{LIBRECHAT_USER_DISCORDID}}discordIdStringDiscordアカウントID
{{LIBRECHAT_USER_APPLEID}}appleIdStringAppleアカウントID
{{LIBRECHAT_USER_EMAILVERIFIED}}emailVerifiedBoolean → Stringメール認証ステータス ("true" または "false")
{{LIBRECHAT_USER_TWOFACTORENABLED}}twoFactorEnabledBoolean → String2FAステータス ("true" または "false")
{{LIBRECHAT_USER_TERMSACCEPTED}}termsAcceptedBoolean → String利用規約の同意ステータス ("true" または "false")

利用可能なリクエストボディのプレースホルダー:

プレースホルダーボディフィールド説明
{{LIBRECHAT_BODY_CONVERSATIONID}}conversationIdString現在の会話識別子
{{LIBRECHAT_BODY_PARENTMESSAGEID}}parentMessageIdString親メッセージ識別子
{{LIBRECHAT_BODY_MESSAGEID}}messageIdString現在のメッセージ識別子

リクエストボディのプレースホルダーを使用した例:

headers:
  X-Conversation-ID: '{{LIBRECHAT_BODY_CONVERSATIONID}}'
  X-Parent-Message-ID: '{{LIBRECHAT_BODY_PARENTMESSAGEID}}'
  X-Message-ID: '{{LIBRECHAT_BODY_MESSAGEID}}'

directEndpoint

キー:

KeyTypeDescriptionExample
directEndpointBoolean`true` に設定すると、設定された `baseURL` を使用するコンプリーションエンドポイントとして扱います

デフォルト: false

例:

directEndpoint: true

titleMessageRole

  • オプション: "system" | "user" | "assistant"

キー:

KeyTypeDescriptionExample
titleMessageRoleStringタイトル生成のメッセージペイロードで使用するロール値を指定します。`"system"`、`"user"`、`"assistant"` のいずれかである必要があります。Defaults to "system" if omitted. May cause issues if "system" is not a valid value, which is sometimes the case for single message payloads, as it is for title generation.

デフォルト: "system"

例:

titleMessageRole: 'user'

このガイドはいかがでしたか?