概覽
使用 OpenAI 服務時,務必確保你的 API Key 和帳戶安全。透過這些最佳做法,防範 API Key 洩露和帳戶遭到接管。
如果你擔心你的帳戶遭到入侵或 API 金鑰被盜用,請立即聯絡 OpenAI 支援團隊。你可以在任一說明中心頁面右下角開啟新的聊天對話,與 OpenAI 支援團隊聯絡。
守護帳戶安全
安全是共同責任。OpenAI 致力於保護帳戶存取安全,這些步驟有助於降低未經授權使用的風險。如果帳戶憑證遭未經許可使用,請盡快回報此問題。
使用強度高且唯一的登入憑證
若要使用密碼,請使用未在其他網站重複使用過的唯一密碼。建議你使用密碼管理工具來產生並儲存密碼。如果您認為密碼可能已外洩、重複使用或分享,請立即變更密碼。
啟用多因素驗證 (MFA)
啟用多重驗證 (MFA),以在登入時增加一個額外的驗證步驟。如需更多資訊,請參閱:啟用或停用多重驗證 (MFA)。
即使有人取得你的密碼,仍需要第二個驗證因素才能存取你的帳戶。
啟用多重驗證 (MFA) 不會讓現有的登入狀態失效。若要阻止任何已存取你的帳戶的使用者,請先重設密碼,然後再啟用多重驗證 (MFA)。
如果你想要硬體支援的帳戶保護,且尚未擁有安全金鑰,符合資格的 OpenAI 使用者可以了解 OpenAI + Yubico YubiKey 組合方案。若要深入了解,請參閱:OpenAI + Yubico YubiKey 組合方案。
使用進階帳戶安全性
針對符合資格的消費者 ChatGPT 帳戶,進階帳戶安全性會新增更嚴格的登入要求與更嚴密的帳戶防護措施。如需更多資訊,請參閱:進階帳戶安全性。此功能不適用於 ChatGPT Enterprise 使用者、由企業管理的帳戶,或與企業管理網域相關聯的帳戶。
請謹慎處理電子郵件和連結
請謹慎處理要求提供帳戶憑證,或引導使用者前往需要輸入帳戶詳細資料之網頁的電子郵件。
請務必再次確認電子郵件地址和 URL,確保它們來自可信的來源。
Review account activity and manage sessions
Security history shows past security events. Use Active sessions to review and manage current sessions.
Review your security history
Security history shows recent security events for your OpenAI account. Examples include sign-ins, sign-outs, password changes, and changes to multi-factor authentication (MFA), passkeys, and other security settings.
To open your security history on the web:
In ChatGPT, go to Settings.
Select Security and login.
Select Security history.
Review the event type and time alongside the location and device details. Some details may be approximate or unavailable.
If you see activity you didn’t perform or authorize, follow the steps in Respond to a suspected compromise.
登出所有工作階段
你可以登出所有裝置上的所有有效工作階段。如需操作說明,請參閱:登出所有工作階段。在 ChatGPT 中:
Go設定。
選取 安全性。
選取 作用中的工作階段。
前往登出所有工作階段。
選取 全部登出。
在確認對話方塊中,選取登出所有裝置。
這會讓你登出所有裝置上的有效工作階段,包括目前的工作階段。最多可能需要 30 分鐘。在平台上,前往你的個人檔案 > 安全性,然後選取登出所有裝置。
其他 ChatGPT 工作階段最多可能需要 30 分鐘才會登出。
Protect your API keys
If you use the OpenAI API, protect your API keys as well as your sign-in credentials. An exposed API key can allow unauthorized API usage through your account, which can result in charges or activity that violates our terms of service.
Use environment variables
Store your API key in environment variables within your development environment. This helps keep the key out of application code and reduces the risk of exposure.
If you use GitHub Actions, use GitHub secrets to store your API key.
不要把 API 金鑰包含在程式碼或應用程式中一併發布
為了避免針對行動應用程式或類似使用案例運行伺服器,可能會想直接將 API Key 嵌入應用程式中。不過,這會讓 API Key 容易遭到濫用。
使用第三方產品時請謹慎
使用要求存取你 API 金鑰的第三方程式庫、框架和工具時,請務必謹慎。即使某項產品看似聲譽良好,仍然存在金鑰外洩或遭誤用的風險。
在使用需要您 API 金鑰的第三方產品之前,請仔細審查該公司及其產品。查看評論、閱讀隱私權政策,並留意社群提出的任何安全疑慮。
Review code before publishing
Before pushing code to public repositories, review it to make sure no sensitive information, such as API keys, is exposed.
Use automated scanning tools that can flag potential leaks. You can also review GitHub's secret scanning tutorial for more guidance.
When OpenAI detects an API key on the public internet, or leaked inside an app in an app store, the API key is disabled immediately.
實作金鑰輪替
請定期輪替 API 金鑰:透過 API 金鑰儀表板 刪除舊金鑰並建立新金鑰。
Monitor API spending and usage
Set multiple spend thresholds, such as 90% and 95%, against a monthly budget at the organization or project level to monitor monthly spend.
Configure custom email recipients to integrate with mailing lists, incident management platforms, and messaging platforms. This can be configured in Platform settings.
You can also enforce an organization or project hard limit to stop affected API requests when tracked spend reaches that amount. Enforcement is not instantaneous, so recorded spend may slightly exceed the limit. For more information, see: Spend limits.
Use separate API keys for each feature, team, product, or project to make usage easier to track. For more information, see: tracking usage by API key.
因應疑似安全漏洞的情況
如果你認為 API 金鑰已遭盜用,或懷疑帳戶有未經授權的活動,務必迅速採取行動。
Secure your account after suspected unauthorized access
If you use a password and think it was exposed, reused, or shared, change it right away.
Log out of all sessions using the instructions above.
If you use the OpenAI API, delete your API keys and review your API usage for unexpected activity.
Review your security history for unfamiliar activity. Keep details that may help with account recovery.
刪除 API 金鑰
請透過「API 金鑰儀表板」刪除你的 API 金鑰。
OpenAI 也支援依 API 金鑰追蹤使用狀況。只要為每個功能、團隊、產品或專案分別使用不同的 API 金鑰,即可更輕鬆地依功能、團隊、產品或專案查看使用狀況。
聯絡 OpenAI 支援團隊
愈早回報問題,OpenAI 就能愈快協助解決,並降低潛在的損害。請在任一說明中心頁面開啟新的聊天對話,聯絡 OpenAI 支援團隊。
