ドキュメントへ移動
ダッシュボードを開く
このページの内容

認証

APIキーの利用料金は所有アカウントに請求されます。OAuthでは接続ユーザーが自分のクレジットを使えます。

API キー#

自分のアカウントにはサーバー側のAPIキーを、顧客ごとのアカウントにはOAuthを使用します。プロンプトやツール引数にキーを含めないでください。

HTTP
Authorization: Bearer $TONG_API_KEY

OAuthディスカバリー#

APIキーの利用料金は所有アカウントに請求されます。OAuthでは接続ユーザーが自分のクレジットを使えます。

curl 'https://platform.tongai.io/.well-known/oauth-authorization-server'
設定
curl --version
HTTP
GET /.well-known/oauth-protected-resourceGET /.well-known/oauth-protected-resource/mcp

認可と同意#

OAuthはS256 PKCE、完全一致のリダイレクトURI、RESTとMCPの個別リソースを使用します。同意はTongで行い、更新トークンは使用のたびにローテーションします。

JSON
{  "response_type": "code",  "client_id": "https://your-app.example/oauth/client.json",  "redirect_uri": "https://your-app.example/oauth/callback",  "resource": "https://platform.tongai.io/mcp",  "scope": "catalog:read operations:read generation:write quotes:write credits:spend",  "code_challenge_method": "S256",  "code_challenge": "BASE64URL_SHA256_OF_VERIFIER",  "state": "RANDOM_SESSION_STATE"}
HTTP
code_expires_in: 60 secondsaccess_token_expires_in: 300 secondsrefresh_token_expires_in: 30 daystoken_endpoint_auth_method: noneclient_id_metadata_document_supported: true

権限#

有料ツールには credits:spend も必要です。削除権限は別に設定します。