0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

watsonx.ai software版でのベアラートークンの取得方法

Posted at

watsonx.ai の APIを使用するには、ベアラートークンが必要とのことです。

A bearer token is required to use any of the watsonx.ai APIs.
For more information, see the Authorization section of the Platform API reference.

ベアラートークンを生成するのに、API キーを使用するため、はじめにAPI キーを作成します。

認証用 API キーの生成

次のいずれかを作成します。

  • プラットフォーム API キー
  • インスタンス API キー

今回はプラットフォームAPIキーを作成します。

プラットフォーム API キーの作成

プラットフォーム API キーがあれば、IBM watsonxWeb クライアントにログインしたときに通常アクセスできるすべてのものにアクセスできます。

プラットフォーム API キーを生成するには、以下のようにします。

  1. Web クライアントにログインします。
  2. ツールバーから、アバターをクリックします。
  3. 「プロファイルと設定」をクリックします。

image.png
4. 「API 鍵」 > 「新規鍵の生成」をクリックします。
image.png
image.png
5. 「生成」をクリックします。
image.png
6. 「コピー」 をクリックして、鍵を安全な場所に保存します。 この鍵を紛失した場合、リカバリーすることはできません。
image.png

ベアラートークンの生成

前のステップで生成したAPI キーを使用して、 authorize エンドポイントを使用して Bearer トークンを生成します。
<instance_route><username><api_key> を、お使いの環境に合った正しい値に置き換えて実行してください。レスポンスにベアラートークンが返されます。

curl -X POST \
  'https://<instance_route>/icp4d-api/v1/authorize'\
  -H 'Content-Type: application/json' \
  -d' {
    "username":"<username>",
    "api_key":"<api_key>"
}'
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?