openai-platform-api-key

Provision and configure OpenAI API keys securely for API-backed apps and scripts.

5.3k|765|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/openai/plugins --skill openai-platform-api-key
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openai-platform-api-key
Source: https://github.com/openai/plugins/tree/main/plugins/openai-developers/skills/openai-platform-api-key
Command: npx skills add https://github.com/openai/plugins --skill openai-platform-api-key

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Building or running any app, script, CLI, or generator that calls the OpenAI API requires a valid OPENAI_API_KEY, and handling that credential incorrectly risks leaking plaintext secrets into logs, chat output, or tracked files. This Skill acts as a credential gate that inspects for existing keys without printing them, asks whether to reuse or create a key before any implementation work, and provisions new keys through an encrypted flow that never exposes plaintext.

Core Features & Use Cases

  • Safe credential inspection: Checks the environment and local env files (.env, .env.local) for a usable OPENAI_API_KEY using silent exit-status checks that never print secret values.
  • Secure key creation: Uses the OpenAI Platform connector picker and a public-JWK-only encrypted creation flow, with a local helper script that decrypts and writes the key only to a confirmed, in-workspace env file.
  • Credential decision gate: Stops all implementation, scaffolding, and smoke testing until the user explicitly chooses reuse-existing-key or create-new-key.
  • Use Case: A user asks to build an app that generates jokes from two input fields using AI. The Skill activates even though no key was mentioned, detects an existing key without revealing it, asks whether to reuse it or create a new one, and only then hands off to the implementation skill.

Quick Start

Ask Codex to build an app or script that uses the OpenAI API, and it will check your credentials and ask whether to reuse an existing key or create a new one before writing any code.

Frequently Asked Questions about openai-platform-api-key

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new OpenAI API key for my project?

Ask Codex to create a new API key and it opens the OpenAI Platform picker, which collects the key name and organization or project selection. The key is created through an encrypted flow and written to a confirmed local env file such as .env.local without ever printing the plaintext value.

How do I set up OPENAI_API_KEY in a .env file safely?

The Skill inspects existing env files using silent checks that never echo secret values, then asks whether to reuse an existing key or create a new one. New keys are written only to a confirmed, preferably ignored or untracked env file, defaulting to .env.local with the OPENAI_API_KEY variable.

Does this activate when I just ask for an AI-powered app?

Yes. Requests phrased only as "using AI" or describing generators driven by form input trigger the credential gate even without mentioning keys. It does not activate for documentation questions, static mockups, or when a different provider like Claude or Gemini is named.

Can the API key ever be printed or exposed in output?

No. The Skill forbids printing, quoting, or summarizing plaintext keys and prohibits inspection commands like cat or grep on env files. Only safe metadata such as file path, env var name, and organization or project names are reported.

What happens if the OpenAI Platform picker is unavailable?

The Skill falls back to a text-only flow: it asks one short question to confirm the local env-file destination, creates the key through encrypted public-JWK exchange, and writes it with a helper script that refuses symlink or out-of-workspace targets.

When should this Skill not be used?

Do not use it for documentation lookups, conceptual API questions, one-off text generation with no app being built, static frontend mockups, or projects that name a different AI provider. Those cases route to docs, troubleshooting, or implementation skills instead.