AGENT SKILL

OpenAI API 错误排查

openai-api-troubleshooting

当 OpenAI API 请求失败或用户询问某个错误的含义时使用,包括无法访问 api.openai.com、401 invalid_api_key、缺少 OPENAI_API_KEY、429 insufficient_quota、429 rate_limit_exceeded 或 403 model_not_found。对失败进行分类,指出下一步,将凭证设置转给 openai-platform-api-key,将最新指南转给 openai-docs。

适用职业AI 工程师
License 许可
Apache-2.0
最近更新
2026-11-03
Stars
★ 44
Forks
16

01 前言 Front Matter

description
Use when an OpenAI API request fails or the user asks what an error means, including blocked access to api.openai.com, 401 invalid_api_key, missing OPENAI_API_KEY, 429 insufficient_quota, 429 rate_limit_exceeded, or 403 model_not_found. Classify the failure, name the next step, route credential setup to openai-platform-api-key, and current guidance to openai-docs.

02 资源文件 4

03 SKILL.md 正文

OpenAI API Troubleshooting

Use this for runtime OpenAI API failures after a request has already been made. Keep key setup in openai-platform-api-key and current guidance in openai-docs.

Routing

  1. Sandboxed or blocked outbound network access

    • Treat DNS errors, connection timeouts, connection resets, or inability to reach api.openai.com before any API response as transport problems first.
    • If the failure came from a sandboxed or restricted run, explicitly recommend retrying the actual request with network access enabled or outside that restriction; only classify API-side auth, quota, rate-limit, or model access after a concrete OpenAI response exists.
  2. Authentication or missing-key errors

    • Route 401, invalid_api_key, missing OPENAI_API_KEY, or malformed-key cases to authentication.
    • If a key must be created or configured, explicitly hand off to openai-platform-api-key; do not stop at generic "create a fresh key" advice.
  3. Quota or credit exhaustion

    • Treat insufficient_quota, "current quota", "billing quota", "run out of credits", or "no balance left" as billing/quota exhaustion, not ordinary throttling.
    • For exhausted credits, prompt the user to add credits and include Add API credits. Do not purchase credits or change billing settings.
    • Link usage caps to https://platform.openai.com/settings/organization/limits.
    • If ambiguous, say it may be credits or a spend limit and consult openai-docs; when useful, note that ChatGPT subscriptions and API billing are separate.
  4. Rate limits

    • Route rate_limit_exceeded, requests-per-minute, tokens-per-minute, or retry-after guidance without quota language to throttling.
    • Recommend pacing, batching, exponential backoff, or lower concurrency; do not suggest buying credits unless the error also indicates quota exhaustion.
  5. Model, project, or organization access

    • Treat 403, model_not_found, org/project mismatch, or permission failures as reached-OpenAI-but-not-authorized cases.
    • Check the model, project, organization, and key scope before guessing.

Rules

  • Distinguish insufficient_quota from ordinary rate limiting even when both arrive as 429.
  • Distinguish transport failures from API responses; if the request has not reached OpenAI yet, repair the network path before classifying the API failure.
  • Prefer the concrete API error code and message over generic heuristics.
  • Keep user-facing answers short: likely class, reason, next action.
  • Do not rotate or create keys here.
  • Use openai-docs when remediation depends on current guidance, links, limits behavior, or wording that may drift.

04 同仓库更多 Skills

openai
openai/openai-developers-for-claude

OpenAI API 密钥配置

openai-platform-api-key

当 Claude Code 被要求构建、运行、测试、调试或配置由 OpenAI 驱动或未指定提供方的 AI 应用、UI、脚本、CLI、生成器或工具时使用,尤其是仅以“使用 AI”表述的请求或由表单/用户输入驱动的生成器;也用于 OPENAI_API_KEY 或 sk-proj 的设置。不要阻碍那些可以通过源码编辑和离线验证进行的模型或提示词迁移。否则,将其视为凭证关口:安全地进行检查,在开展 API 工作前询问是复用还是新建凭证,必要时指导手动本地设置,验证凭证是否存在,且绝不暴露明文。

AI 工程师凭证与密钥管理
★ 44
openai
openai/openai-developers-for-claude

OpenAI 产品与 API 文档查询

openai-docs

每当用户询问有关 OpenAI 产品、API、模型或 SDK 的任何问题时使用,包括事实查询、编码请求、最新/当前/默认模型选择、提示词指导、模型升级和引用请求。在调用任何 openaiDeveloperDocs MCP 工具之前调用。

AI 工程师开发参考
★ 44
openai
openai/openai-developers-for-claude

ChatGPT App 提交文件生成

chatgpt-app-submission

当开发者需要从 MCP 服务器获得 ChatGPT Apps 提交导入文件时使用。检查实现,生成包含应用信息、工具提示(tool-hint)理由、正面和负面测试用例的 chatgpt-app-submission.json,然后报告审查发现和输出模式(outputSchema)警告。

AI 工程师ChatGPT 应用开发
★ 44
openai
openai/openai-developers-for-claude

ChatGPT App 应用开发

build-chatgpt-app

当用户明确想要开发 ChatGPT App、Apps SDK 项目、MCP 服务器加组件(widget)UI、ChatGPT 兼容的工具 UI,或针对该平台的提交/部署工作时使用。从 Claude Code 中构建、搭建脚手架、重构或排查这些项目,在生成代码前查阅 openai-docs,并在任何需要实时 OpenAI API 凭证的应用路径前使用 openai-platform-api-key。

AI 工程师ChatGPT 应用开发
★ 44
openai
openai/openai-developers-for-claude

OpenAI Agents SDK 应用开发

agents-sdk

当用户想要从 Claude Code 构建、适配、运行或评估 OpenAI Agents SDK 应用时使用。优先采用文档优先(docs-first)的工作流程,并在开展任何涉及 API 的工作之前,通过 openai-platform-api-key 处理 API 凭证相关的决策。

AI 工程师智能体开发
★ 44