openai-platform-api-key
预览截图
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "openai-platform-api-key":https://skillpi.com/zh/skills/deepskill-2016dd4ba0b02a09a3bdfdf1874eb01973d641bd6880cec1e398bff476241eda。安装前核对上游来源和版本:https://github.com/openai/plugins。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
用于在 Codex 被要求构建、运行、测试、调试或配置基于 OpenAI(或未指定提供商)的 AI 应用、用户界面、脚本、命令行工具、生成器或工具时使用,尤其适用于请求仅表述为“使用 AI”或由表单/用户输入驱动的生成器场景;同样适用于设置 OPENAI_API_KEY 或 sk-proj。将其视为凭证管理层:需要安全地检查密钥,在调用 API 之前询问是重用现有密钥还是创建新密钥,并且绝不能以明文方式暴露密钥。
介绍来源: third_party · openai · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 当 Codex 被要求构建,运行,测试,调试,或配置 OpenAI 后置或提供者未指定的 AI app, UI, 脚本, CLI, 生成器, 或工具时使用, 特别是请求只使用“ 使用 AI” 或 由窗体/用户输入驱动的生成器; 也用于 OPENAI API KEY 或 sk-proj 设置 。 将此作为证书门:安全检查,在API工作前询问再使用-vs-新,从不暴露纯文本.
- 适合谁
- 使用此技能作为API支持的作品的认证门,而不是应用,docs,或前端执行技能. 使用时:用户请求 OpenAI API 密钥, `OPENAI_API_KEY` ,或一个 `sk-proj` 键。 Codex将构建,执行,运行,测试,调试,或配置一个应用程序,脚本,CLI,生成器,UI,或调用OpenAI API的工具,甚至在直播请求之前,甚至一个可用的密钥已经存在. 用户要求 Codex 构建,执行,运行,或配置一个应用,脚本,CLI,生成器,或使用AI生成用户输入输出的工具. 用户请求一个AI-power app或UI,从一个或多个输入字段,窗体,提示,文件或其他用户提供的值生成输出.
- 实测状态
- 未测试
文件浏览
Frontmatter
name: openai-platform-api-key
description: 'Use when Codex is asked to build, run, test, debug, or configure an OpenAI-backed or provider-unspecified AI app, UI, script, CLI, generator, or tool, especially requests phrased only as "using AI" or generators driven by forms/user input; also use for OPENAI_API_KEY or sk-proj setup. Treat this as the credential gate: inspect safely, ask reuse-vs-new before API work, and never expose plaintext.'OpenAI API Key
Use this skill only in Codex local/app sessions. Create keys through the secure OpenAI Platform connector, keep plaintext out of normal tool output, and write secrets only to a confirmed local destination.
When To Use
Use this skill as the credential gate for API-backed work, not as the app, docs, or frontend implementation skill.
Use it when:
- The user asks for an OpenAI API key,
OPENAI_API_KEY, or ansk-projkey. - Codex will build, implement, run, test, debug, or configure an app, script, CLI, generator, UI, or tool that calls the OpenAI API, even before a live request and even if a usable key already exists.
- The user asks Codex to build, implement, run, or configure an app, script, CLI, generator, or tool that uses AI to produce outputs from user input.
- The user asks for an AI-powered app or UI that generates output from one or more input fields, forms, prompts, files, or other user-provided values.
- The user says "using AI" in an app/script/build request and does not name a different provider.
Do not use it when:
- The user only wants documentation, citations, model or API guidance, conceptual explanation, or code examples without asking Codex to build, run, configure, or debug an API-backed artifact.
- The user asks for a static frontend, visual mockup, design concept, or placeholder UI with no API-backed behavior.
- The user only asks Codex to write a one-off output directly and no app, script, generator, or API-backed tool is being built or run.
- The user names a different AI provider for the artifact.
If API access is needed and no usable key is found, offer secure key provisioning instead of leaving only placeholder docs or manual setup steps.
Coordination With Implementation Skills
When another implementation skill also applies, run this skill first only to inspect credentials safely and send the credential decision message. Until reuse-existing-key vs create-new-key is resolved, it outranks design-first and implementation-first flows, including build-web-apps:frontend-app-builder; do not design UI, choose architecture, inspect API examples, write code, or run smoke tests. After the user answers, hand off to the appropriate implementation, docs, or frontend skill.
Safety Rules
- Never request, print, summarize, quote, or paste a plaintext API key.
- Never inspect credentials with commands that can print secret values, such as
cat .env*,grep OPENAI_API_KEY .env*, orrg OPENAI_API_KEY .env*. Use silent exit-status checks or redacted summaries only. - Use the Platform connector
open_codex_api_key_setuptool when it is available. Do not send local workspace paths, env-file paths, or target arrays to the picker. - Do not use the ChatGPT-only browser/widget
_start_api_key_setupflow from Codex. - Only pass public JWK material (
kty,n,e) to the connector. - Before creating a key or writing any secret, obtain explicit confirmation. Prefer the hosted Platform picker plus local destination confirmation when it is available; if it is unavailable, fall back to a typed local destination question, then wait.
- Prefer ignored or untracked env files. In git repos, avoid tracked targets unless the user explicitly confirms that choice.
- The local helper may handle plaintext in memory and write it to the confirmed file. Its stdout/stderr must not include the key.
- When decrypting in a repo, pass the repo root as
--workspace; the helper refuses symlink targets and targets outside that workspace. - Keep user-facing messages concise. Unless the user asks or a failure requires it, say only that Codex will create the key securely and write it to the confirmed env file.
- Do not narrate deterministic mechanics such as helper discovery, encryption, decryption, RSA, JWKs, ciphertext, temporary files, cleanup, permissions checks, or redacted verification unless an error requires user action.
- Report only safe metadata: path, env var name, key name, org/project names, and whether an existing env var was updated.
Mandatory First Step
Before editing, testing, running, debugging, or configuring any code that calls the OpenAI API:
- Inspect for a usable
OPENAI_API_KEYwithout printing it. - Unless the user explicitly asked for a new key, ask whether to reuse an existing key or create a new one. If none exists, ask whether to create one.
- Stop until the user answers.
This applies even if:
- a usable key already exists
- no live API call will be made
- no secret will be written
- the task is "just create a script"
Finding an existing key is not permission to proceed. It only changes the question you ask.
The credential decision is a hard stop. Before the user answers, do not create directories, scaffold files, draft implementation plans, wire API-dependent code, run smoke tests, or give placeholder/manual key setup instructions. The only allowed pre-gate work is safe repo convention discovery and credential presence checks that do not print secrets.
Credential Decision Messages
Required progress updates before or during credential inspection may be brief and limited to saying that Codex is checking credentials or opening secure key setup. They must not describe implementation plans, architecture, file choices, local destination details, or credential conclusions before the credential decision or picker handoff.
After inspecting credentials, the next substantive user-facing message must be the credential decision message. Do not send another substantive message before this decision.
Use one of these branches:
- Existing usable key found, and the user did not explicitly ask for a new key: make clear that the OpenAI API will power the app, script, or project, say that an existing usable
OPENAI_API_KEYwas found without revealing it, then ask whether to reuse that key or create a new one. - No usable key found: make clear that the OpenAI API will power the app, script, or project, say that no usable
OPENAI_API_KEYwas found, then ask whether to create one securely. - User explicitly asked for a new key: skip the reuse question and open the Platform picker directly when available.
After sending the credential decision message, stop until the user answers.
Workflow
- Inspect before acting:
- look for a usable key without printing secret values in the current environment and likely local env files such as
.env.local,.env, and ignored framework-specific env files - inspect env files only with no-output checks that reveal presence/absence, never with commands that echo matching lines or whole files
- check README/setup docs,
OPENAI_BASE_URL, and framework env docs for repo conventions separately from secret-bearing env files - prefer ignored or untracked env files; avoid tracked targets unless the user explicitly confirms that choice
- default to
.env.localandOPENAI_API_KEYwhen no stronger convention exists
- look for a usable key without printing secret values in the current environment and likely local env files such as
- Based on that inspection:
- for tasks that will call the OpenAI API, when asking this up-front question, mention that the OpenAI API will power the app, script, or project before mentioning whether an existing key was found in the environment or local env files
- if the user explicitly asked for a new key, no reuse decision is needed
- otherwise, before building, implementing, running, testing, debugging, or configuring an app or script that calls the OpenAI API, ask up front whether to reuse an existing usable key or create a new one
- if no usable key exists, ask whether to create one before building the rest of the app
- ask this up front even before any live request; after asking, stop without adding an app plan, file list, code sketch, manual
OPENAI_API_KEYinstructions, or fallback placeholder setup - do not silently reuse a detected key for implementation, verification, smoke tests, or other live requests just because the user did not ask about credentials
- treat requests to create or configure a key as ambiguous unless the user says they want a new key
- if the user chooses reuse and a persistent file write is still needed, confirm the destination file/env var before writing
- When creation is the chosen path, confirm the destination file/env var before writing. If the user has not already explicitly asked for a new key, ask whether to create one first.
- Prefer the hosted Platform picker:
- use
tool_searchto loadopen_codex_api_key_setup - call
open_codex_api_key_setupdirectly with no arguments ({}). Do not send a key name, local paths, workspace arguments, or target arrays. The picker collects the key name, automatically loads organization/project choices, and sends a later widget-authored follow-up with the confirmed key name plus selected opaque ids - after
open_codex_api_key_setupreturns without an error, end the current turn immediately and wait for the widget-generated follow-up prompt. Do not inspect or interpret the launch payload, search for connector contract details, run local-save steps, make another tool call, or send any non-empty user-facing message, including a picker-open confirmation, in that turn
- use
- After the widget follow-up, or if the picker tool is unavailable or fails before the widget opens, choose the best local env-file target from repo conventions, defaulting to
.env.localandOPENAI_API_KEY. - Use
tool_searchto load the OpenAI Developers MCPconfirm_openai_api_key_local_destinationtool. If available, call it with the absolute workspace root, the recommended env-file target, andOPENAI_API_KEY. The form shows the recommended location and lets the user replace it before continuing. - If the local destination tool returns
approved, use its returnedtargetPathexactly and do not ask a second destination question. If it is declined or canceled, stop. - If the local destination tool is unavailable, ask exactly one short question and stop:
Save the new key to <path>? Reply yes to continue, another workspace-relative env-file path to change it, or decline.If the user declines, stop; otherwise use the confirmed path. - Silently check whether the selected target is tracked. If it is tracked, stop and obtain explicit confirmation that a secret will be written there. In this local fallback, do not claim the user selected an explicit organization/project target.
- Prefer the hosted Platform picker:
- After confirmation, run the app tool preflight:
- use
tool_searchto loadcreate_encrypted_openai_api_key - if missing and
tool_suggestis available, suggest installing connectorconnector_2de447f3f15448ebab48783d7e4f5d81 - if unavailable or auth fails, ask the user to connect OpenAI Platform from
/appsor the$app picker, then retrytool_searchafter they finish
- use
- Run
prepare, keepprivate_key_path, and send onlyrecipient_public_key_jwkto the connector. - Call
create_encrypted_openai_api_keywith the confirmed key name plus the picker-confirmedorganization_idandproject_idwhen the picker path was used. In the text-only fallback, omit those fields so the connector preserves its default organization/project behavior. - Run
decryptwith the encrypted ciphertext, confirmed target path, env var name, and repo root as--workspace. - Verify by running the relevant project command when practical. Do not reveal or inspect the secret value directly.
Helper
Use the helper by absolute path. prepare creates the temporary private key file plus a request JSON containing only the public JWK and requested key name:
node "<plugin root>/scripts/openai-platform-api-key.mjs" prepare --name "Codex"
After the connector returns encrypted_api_key.ciphertext, decrypt and write the key locally:
node "<plugin root>/scripts/openai-platform-api-key.mjs" decrypt \
--private-key "<private key path from prepare>" \
--ciphertext "<encrypted_api_key.ciphertext from connector result>" \
--target "<confirmed env file path>" \
--workspace "<repo root>" \
--env-name OPENAI_API_KEY
The decrypt command updates or appends the env var, prints only safe write metadata, and refuses symlink or out-of-workspace targets.
References
references/evals.md: trigger and routing eval cases for this skill.
当前收录版本
0.0.1
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 高价值/高频刚需:作为 OpenAI API 集成的凭证关卡,直接解决用户在使用 OpenAI API 时的核心痛点——安全地管理和配置 API Key
- 广泛适用性:适用于构建、运行、测试、调试或配置基于 OpenAI 的 AI 应用、UI、脚本、CLI、生成器或工具
- 明确的价值定位:专注于凭证管理而非应用实现,确保安全性和合规性
亮点
- 触发词精准完整:详细列出了各种使用场景(如请求 OpenAI API key、构建 AI 应用等)和排除场景
- 边界清晰:明确区分了何时使用该 Skill 和何时不使用,避免了与其他 Skill 的重叠
- 覆盖多种变体:涵盖了从显式请求 API key 到隐式使用 AI 的各种情况
亮点
- 结构清晰:包含 When To Use、Coordination With Implementation Skills、Safety Rules、Mandatory First Step、Credential Decision Messages、Workflow、Helper、References 等完整章节
- 步骤明确:提供了详细的 Workflow 和 Helper 使用示例,包括具体的命令行操作
- 文档完整:frontmatter 完整,单文件内容详实但不过长,易于理解
亮点
- 工具来源明确:详细描述了使用的工具和连接器(如 open_codex_api_key_setup、create_encrypted_openai_api_key 等)
- 参数正确:提供了具体的命令行参数和使用方法
- 覆盖主要异常:详细描述了各种异常情况的处理方式(如工具不可用、认证失败等)
- 不可逆操作有确认机制:在创建 key 和写入文件前都要求用户确认
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
账号、密钥或授权
使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。
主文档提及 · 第 2, 3, 6, 12, 16 行
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。