用一条提示词让 Claude 通过你自己的 API 账号干活
这是 Lenny Rachitsky 分享的一条即用型提示词,能让 Claude 用你自己付费的 API Key 干活,把起草外包给模型、让 Agent 只做审核。比起让 Agent 全权生成,这种分工能省订阅额度,还带失败回退和密钥安全处理,适合经常写重复性稿件的开发者。
Lenny Rachitsky 分享一条可直接粘贴的提示词,让 Claude Code(或其它 Agent)通过用户自己的 Anthropic API 账号执行任务,例如撰写播客嘉宾准备资料。流程包括:通过安全密钥输入框索取 API Key 和 Workspace ID,不在聊天中明文输入或显示。
技术实现上,提示词要求编写一个调用 Anthropic Messages API(api.anthropic.com/v1/messages)的辅助脚本,使用 x-api-key 和 anthropic-version 请求头,如有 Workspace ID 则附加 anthropic-workspace-id 请求头。随后通过 GET /v1/models 列出可用模型供用户选择,发送测试消息验证连通性,失败时给出具体错误(如余额不足)并指向 console.anthropic.com 处理。
工作流设计为分工模式:指定的 Claude 模型负责生成初稿,Agent 本身负责审核和事实核查;只保留返回内容中的 text 类型块,过滤 thinking 块;API 调用失败时回退为 Agent 自行起草。配置保存到长期记忆中,后续同类任务无需重新设置。
完整提示词: 我希望你通过我自己的 Anthropic API 账号,使用 Claude 模型完成指定任务:[例如撰写播客嘉宾准备资料]。 通过安全的密钥输入框向我索取 Anthropic API Key,绝不要在聊天中输入或显示。如果 API Key 属于特定 Anthropic Workspace,也通过相同的安全方式索取 Workspace ID。 只在你的计算机上保存 API Key,绝不打印或暴露。编写一个调用 Anthropic Messages API 的辅助脚本。 API 地址: api.anthropic.com/v1/messages 请求时使用 x-api-key 和 anthropic-version 请求头。如果我提供了 Workspace ID,还需要添加 anthropic-workspace-id 请求头。 查询我的 API Key 可以使用哪些模型。 通过 GET /v1/models 获取可用模型列表,并展示给我,让我选择需要使用的模型。 发送一条简短的测试消息,确认 API 调用正常。 如果调用失败,告诉我具体错误,例如 API 余额不足,以便我前往 Anthropic 控制台处理账单问题。 控制台: console.anthropic.com 测试成功后,更新你的 Skill 和所有相关日常任务流程。 让指定的 [模型] 负责生成初稿,再由你负责审核和事实核查。 注意,部分模型会在正式文本前返回 thinking 内容,只保留 text 类型的内容块。 如果 API 调用失败,就由你自行完成初稿,并告诉我失败原因。 将这套配置保存到你的长期记忆或持久配置中,确保以后执行类似任务时能够继续使用,不需要每次重新设置。 x.com/lennysan/statu… Lenny Rachitsky @lennysan Here's the prompt: I want you to use Anthropic's Claude models through my own Anthropic API account for [task, e.g. drafting my podcast guest briefs]. 1. Ask me for my Anthropic API key with a secure secret field (never in chat). If my key belongs to a specific Anthropic workspace, ask for that workspace ID the same way. 2. Store it only on your computer and never print it. Write a small helper script that calls the Anthropic Messages API ( api.anthropic.com/v1/messages ) with the x-api-key and anthropic-version headers, plus the anthropic-workspace-id header if I gave you one. 3. List the models my key can use (GET /v1/models) and show them to me so I can pick one. 4. Send a short test message and confirm it works. If it fails, tell me the exact error (e.g. credit balance too low) so I can fix billing at console.anthropic.com . 5. Once it works, update your skill and any routines so [model] writes the first draft and you review and fact-check it. Some models return a thinking block before the text, so keep only the text blocks. If a call fails, fall back to drafting yourself and tell me why. 6. Save this setup to your memory so it sticks. 🔗 View Quoted Tweet
本条情报归属 AITOP「技巧」核心栏目,重点聚焦北美前沿实验室与硅谷科技巨头。在跨区域产业观察坐标中,该动态直接关联「AI 开发者工具链、Coding Agent 与工程化实践」研究主线,反映出当前技术演进与商业落地的最新风向。涉及核心实体与技术议题包括:Claude、Anthropic、提示词工程、API,读者可通过下方标签进入对应专题页查阅历史脉络与关联对比。
信源核验说明:本文原始线索采编自「AI Will」(@FinanceYF5),经 AITOP 多维评分管线结构化提炼。截至目前,全网已有 11 家独立信源对该事件进行交叉印证与跟进报道(含 shao__meng、TestingCatalog、Yuchen Jin 等),属于近期高关注度行业信号。