モデルAPIキーは、埋め込み API および再ランクAPIの認証および承認メカニズムとして機能し、 APIからVoyage AIモデルにアクセスできるようにします。このページでは、 Atlas UIでAPIキーを作成および管理する方法について説明します。
注意
Atlas の他のAPIキーと区別するために、モデルAPIキー という名前が付けられています。このキーは、他のモデルプロバイダーのAPIキーと同じ方法で使用します。
モデルAPIキーの作成と管理
Atlas UIから組織とプロジェクトレベルでモデルAPIキーを作成および管理できます。レート制限は、APIキーに対して、組織レベルまたはプロジェクトレベルで作成されたかどうかに基づいて適用されます。
必要な権限
モデルAPIキーを作成、更新、削除するには、次の手順に従います。
Organization Owner組織レベルでは、Atlas への アクセス権が必要です。プロジェクトレベルでは、Atlas
Project Model OwnerProject Ownerへの 、 以上のアクセス権が必要です。
モデルAPIキーを表示するには:
Organization Read Only組織レベルとプロジェクトレベルで、Atlas への 以上のアクセス権が必要です。Project Read Onlyプロジェクトレベルのみで、Atlas への 以上のアクセス権が必要です。
各ロールの権限の完全なリストについては、「組織とプロジェクトのアクセス」を参照してください。
API キーの作成
組織レベルでモデルAPIキーを作成したら、そのキーをプロジェクトにリンクします。キーを作成した後は、キーがリンクされているプロジェクトを変更することはできません。レート制限は、プロジェクト内の各キーに適用されます。
注意
If you create a model API key through Atlas, as described in the following procedure, the key authenticates requests to the ai.mongodb.com endpoints. Conversely, if you create a key through VoyageAI directly, it will authenticate requests to https://api.voyageai.com/v1/embeddings.
You also set the key's scope when you create it. To learn more, see Key Scope.
組織レベルでモデルAPIキーを作成するには、次の手順を実行します。
Atlas にログインします。
モデルAPIキーを作成します。
[Create new model API key] をクリックします。
キーの名前を入力します。
モデルAPIキーは、250 文字を超えることはできません。
ドロップダウンから、 APIキーにリンクするプロジェクトを選択します。
Select a cloud provider from the Cloud provider dropdown.
Select
anyto leave the cloud dimension unscoped.Optional. Select a geography from the Geography dropdown.
Most keys don't need a Geography. Select
anyto leave the geography dimension unscoped.Atlas displays the read-only API Endpoint for the scope that you select. The key authenticates against this endpoint.
[Create] をクリックします。
プロジェクトレベルでモデルAPIキーを作成するには、次の手順を実行します。
Atlas にログインします。
モデルAPIキーを作成します。
まだ表示されていない場合は、ナビゲーション バーから [Model API Keys] を選択します。
[Create model API key] をクリックします。
キーの名前を入力します。
モデルAPIキーは、250 文字を超えることはできません。
Select a cloud provider from the Cloud provider dropdown.
Select
anyto leave the cloud dimension unscoped.Optional. Select a geography from the Geography dropdown.
Most keys don't need a Geography. Select
anyto leave the geography dimension unscoped.Atlas displays the read-only API Endpoint for the scope that you select. The key authenticates against this endpoint.
[Create] をクリックします。
Key Scope
注意
パブリック プレビュー
ヨーロッパ地理とそのエンドポイントである eu.ai.mongodb.com は、パブリック プレビュー機能として利用できます。機能および関連するドキュメントは、プレビュー期間中にいつでも変更される可能性があります。
When you create a model API key, you supply a cloud and a geography. Together these set the key's scope, which determines the endpoint that the key authenticates against.
Set either value to any to leave that dimension unscoped. A key with cloud and geography both set to any is an unscoped key and works against ai.mongodb.com.
エンドポイント | 地理 |
|---|---|
| スコープが設定されていない。 Atlas はどの地域からのリクエストも処理できます。 |
| ヨーロッパ |
| 米国 |
スコープ付きエンドポイントはパターン <geography>.ai.mongodb.com に従います。ここでは、<geography> はリクエストで送信したモデルAPIキーの geography 値です。
To learn what a Geography is and when to scope a key to one, see Geographies for Voyage AI Inference.
Consider the following when you scope a key:
The scope is fixed when you create the key. To use a different cloud or Geography, delete the key and create a new one. A
PATCHrequest to a model API key changes only the key's name.The key prefix encodes the scope. For example, a key scoped to Europe begins with
al-eu-. Use the prefix to identify a key's scope without recreating it.Scoped keys require a paid usage tier. You can't scope a key on the free trial. To learn more, see Usage Tiers.
model API keys that you created before Geographies were available read as cloud=any and geography=any. These keys keep working against ai.mongodb.com and are not migrated. To use a scope, create a new key.
Restrict Model API Key Scope Using a Resource Policy
You can configure a resource policy at the organization level to require that new model API keys be created in a given cloud, a given Geography, or both. To do this, add a forbid rule written in Cedar that targets the Embedding and Reranking API action.
The policy governs key creation. It does not constrain where an existing key is used. If you configure this policy, users can't create keys outside the scope you allow. However, the policy doesn't revoke or re-scope keys that already exist. Those keys keep working. To remove a key that predates the policy, see Delete an API Key.
You can allow specific scopes by using the unless clause in the forbid rule.
forbid (principal, action == ResourcePolicy::Action::"project.aiModelAPI.modify", resource) unless { <exception> };
To learn more about setting the resource policy, see Atlas Resource Policies.
APIキーの表示
組織の所有者は、組織のすべてのモデルAPIキーを組織レベルで表示および編集できます。プロジェクト所有者は、アクセス権を持つプロジェクトのモデルAPIキーのみを表示および編集できます。
組織レベルでモデルAPIキーを表示するには、次の手順を実行します。
Atlas にログインします。
各モデルAPIキーについて、ページには以下が表示されます:
列名 | 列の値の説明 |
|---|---|
Name | モデル API キーの名前。 |
Secret Key | モデル API キー名に関連するモデル API キーを隠しました。 |
Created On (UTC) | ユーザーがモデル API キーを作成した時の UTC での日付。 |
Last Used (UTC) | モデル API キーが最後に使用された日付(UTC)。キーが新規であるか、または使用されたことがない場合、値は |
Project | モデル API キーにリンクされているプロジェクトの名前。 |
Created By | キーを作成したユーザーの名前。 |
Actions | キーで実行できるアクション。次のコマンドをクリックできます。
|
プロジェクトレベルでモデルAPIキーを表示するには、次の手順を実行します。
Atlas にログインします。
モデル API キーごとに、ページにキーに関する次の情報が表示されます。
列名 | 列の値の説明 |
|---|---|
Name | モデル API キーの名前。 |
Secret Key | モデル API キー名に関連するモデル API キーを隠しました。 |
Created On (UTC) | ユーザーがモデル API キーを作成した時の UTC での日付。 |
Last Used (UTC) | モデル API キーが最後に使用された日付(UTC)。キーが新規であるか、または使用されたことがない場合、値は |
Project | モデル API キーにリンクされているプロジェクトの名前。 |
Created By | キーを作成したユーザーの名前。 |
Actions | キーで実行できるアクション。次のコマンドをクリックできます。
|
APIキーの編集
API キーを削除する
モデルAPIキーを削除すると、 MongoDB はすぐにキーを無効にし、削除されたキーを使用して行われたAPIリクエストを拒否します。キーを削除すると、表示、復元、または変更することはできません。
次のステップ
モデルAPIキーを作成すると、次のことができます。
APIキーの使用状況をリアルタイムでモニターします。