[{"data":1,"prerenderedAt":170},["ShallowReactive",2],{"doc-key-zh-get-openai-key":3},{"id":4,"title":5,"body":6,"description":158,"extension":159,"meta":160,"navigation":165,"path":166,"seo":167,"stem":168,"__hash__":169},"pages\u002Fzh\u002Fdoc\u002Fget-key\u002Fget-openai-key.md","获取 OpenAI API Key",{"type":7,"value":8,"toc":145},"minimark",[9,13,22,26,31,42,46,75,78,82,89,93,116,119,127,130],[10,11,5],"h1",{"id":12},"获取-openai-api-key",[14,15,16,17,21],"p",{},"如果你已经有 OpenAI 开发者账号，把 Key 贴进 WriteX 就能用官方 GPT 系列。注意：聊天站 ChatGPT 和开发者平台是两套东西，Key 在 ",[18,19,20],"strong",{},"Platform"," 里创建。",[23,24,25],"h2",{"id":25},"步骤",[27,28,30],"h3",{"id":29},"_1-登录-platform","1. 登录 Platform",[14,32,33,34,41],{},"打开 ",[35,36,40],"a",{"href":37,"rel":38},"https:\u002F\u002Fplatform.openai.com\u002F",[39],"nofollow","platform.openai.com","，用开发者账号登录（不是只登录 chat.openai.com）。",[27,43,45],{"id":44},"_2-创建-secret-key","2. 创建 Secret Key",[47,48,49,58,68],"ol",{},[50,51,52,53],"li",{},"进入 ",[35,54,57],{"href":55,"rel":56},"https:\u002F\u002Fplatform.openai.com\u002Fapi-keys",[39],"API keys",[50,59,60,63,64],{},[18,61,62],{},"Create new secret key","，起名如 ",[65,66,67],"code",{},"WriteX",[50,69,70,71,74],{},"复制 ",[65,72,73],{},"sk-…","（或项目显示的新格式密钥）并立刻保存",[14,76,77],{},"密钥通常只完整展示一次。不要提交到 Git、不要写进公开前端代码。",[27,79,81],{"id":80},"_3-确认-billing","3. 确认 Billing",[14,83,84,85,88],{},"在 ",[18,86,87],{},"Billing"," 绑定付款方式并确认有额度。没余额时请求会失败。组织 \u002F 项目权限不对也会 401\u002F403，检查自己是否在正确的 org 下。",[27,90,92],{"id":91},"_4-填进-writex","4. 填进 WriteX",[47,94,95,105,108,111],{},[50,96,97,98,101,102],{},"WriteX → ",[18,99,100],{},"设置 → 模型 \u002F Provider"," → ",[18,103,104],{},"OpenAI",[50,106,107],{},"Base URL 用默认（或以控制台文档为准）",[50,109,110],{},"粘贴 Key，选一个你账号里能用的模型",[50,112,113],{},[18,114,115],{},"测试并保存",[23,117,118],{"id":118},"网络提示",[14,120,121,122,126],{},"部分地区无法直连 OpenAI。连不上时，可改用公司网关，或其它 ",[35,123,125],{"href":124},"\u002Fdoc\u002Fget-key\u002Fget-other-key","OpenAI 兼容接口","。",[23,128,129],{"id":129},"相关阅读",[131,132,133,139],"ul",{},[50,134,135],{},[35,136,138],{"href":137},"\u002Fguides\u002Fconfigure-byok","在 WriteX 中配置 BYOK",[50,140,141],{},[35,142,144],{"href":143},"\u002Fdoc\u002Fget-key","全部 API Key 教程",{"title":146,"searchDepth":147,"depth":147,"links":148},"",2,[149,156,157],{"id":25,"depth":147,"text":25,"children":150},[151,153,154,155],{"id":29,"depth":152,"text":30},3,{"id":44,"depth":152,"text":45},{"id":80,"depth":152,"text":81},{"id":91,"depth":152,"text":92},{"id":118,"depth":147,"text":118},{"id":129,"depth":147,"text":129},"在 OpenAI Platform 创建 secret key、确认账单，再配置到 WriteX。","md",{"seoTitle":161,"summary":162,"provider":163,"order":164},"获取 OpenAI API Key｜WriteX 教程","官方 GPT 接口；需能访问 Platform 并完成计费设置。","openai",5,true,"\u002Fzh\u002Fdoc\u002Fget-key\u002Fget-openai-key",{"title":5,"description":158},"zh\u002Fdoc\u002Fget-key\u002Fget-openai-key","XlJ9EYl7OmjNHmCHOLj9y-xgA0hsbk1J_At-AEBtelc",1785483020199]