Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计通过

api-credentialsAPI credentials 文档

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

749

周安装

30

GitHub Stars

118

下载量

242
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:api-credentials(API credentials 文档)
来源仓库:https://github.com/oaustegard/claude-skills
仓库路径:skills/api-credentials
安装命令:
npx skills add https://github.com/oaustegard/claude-skills --skill api-credentials
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/oaustegard/claude-skills --skill api-credentials

简介

管理 API 凭证读取与注入,支持从知识文件或 JSON 配置加载密钥信息。

  • 适用于本地开发与托管环境,提供向后兼容的旧式凭证处理方式。
  • 使用时需将凭证存储于 ANTHROPIC_API_KEY.txt 等文件中,禁止提交含真实密钥的代码。
  • 安装方式:通过 npx skills add 从指定仓库获取,兼容 Codex、Claude 等宿主环境。
  • 注意:该技能已弃用,新项目应直接使用环境变量或安全 vault 机制管理凭证。

SKILL.md

API Credentials Management

🚨 DEPRECATED: This skill is no longer needed for hosted skills environments.

New approach: Skills now read credentials directly from project knowledge files:

  • ANTHROPIC_API_KEY.txt, GOOGLE_API_KEY.txt, GITHUB_API_KEY.txt (recommended)
  • Or API_CREDENTIALS.json (combined file)

See updated skill documentation:

Legacy use only: This skill may still be useful for local development environments or backward compatibility.


⚠️ WARNING: This is a PERSONAL skill - DO NOT share or commit with actual credentials!

This skill provides secure storage and retrieval of API credentials for multiple providers. It serves as a dependency for other skills that need to invoke external APIs programmatically.

Supported Providers

  • Anthropic (Claude API)
  • Google (Gemini API, Vertex AI, etc.)
  • GitHub (GitHub API, Personal Access Tokens)
  • Extensible for additional providers

Purpose

  • Centralized credential storage for multiple API providers
  • Secure retrieval methods for dependent skills
  • Clear error messages when credentials are missing
  • Support for multiple credential sources (config file, environment variables)

Usage by Other Skills

Skills that need to invoke APIs should reference this skill:

Anthropic Claude API

import sys
sys.path.append('/home/user/claude-skills/api-credentials/scripts')
from credentials import get_anthropic_api_key

try:
    api_key = get_anthropic_api_key()
    # Use api_key for Claude API calls
except ValueError as e:
    print(f"Error: {e}")

Google Gemini API

import sys
sys.path.append('/home/user/claude-skills/api-credentials/scripts')
from credentials import get_google_api_key

try:
    api_key = get_google_api_key()
    # Use api_key for Gemini API calls
except ValueError as e:
    print(f"Error: {e}")

GitHub API

import sys
sys.path.append('/home/user/claude-skills/api-credentials/scripts')
from credentials import get_github_api_key

try:
    api_key = get_github_api_key()
    # Use api_key for GitHub API calls
except ValueError as e:
    print(f"Error: {e}")

Setup Instructions

Option 1: Configuration File (Recommended)

  1. Copy the example config:
cp /home/user/claude-skills/api-credentials/assets/config.json.example \
   /home/user/claude-skills/api-credentials/config.json
  1. Edit config.json and add your API keys:
{
  "anthropic_api_key": "sk-ant-api03-...",
  "google_api_key": "AIzaSy...",
  "github_api_key": "ghp_..."
}
  1. Ensure the config file is in .gitignore (already configured)

Option 2: Environment Variables

Set environment variables for the providers you need:

# Anthropic Claude
export ANTHROPIC_API_KEY="sk-ant-api03-..."

# Google Gemini
export GOOGLE_API_KEY="AIzaSy..."

# GitHub
export GITHUB_TOKEN="ghp_..."
# or
export GITHUB_API_KEY="ghp_..."

Add to your shell profile (~/.bashrc, ~/.zshrc) to persist.

Priority

Credential retrieval follows this priority for each provider:

  1. config.json in the skill directory (highest priority)
  2. Environment variable (ANTHROPIC_API_KEY or GOOGLE_API_KEY)
  3. ValueError raised if neither is available

Security Notes

  • Never commit config.json with real credentials
  • The config.json file should be in.gitignore
  • Only config.json.example should be version controlled
  • Consider using environment variables in shared/production environments
  • Rotate API keys regularly
  • Skills should never log or display full API keys

File Structure

api-credentials/
├── SKILL.md              # This file
├── config.json           # YOUR credentials (gitignored)
├── scripts/
│   └── credentials.py    # Credential retrieval module
└── assets/
    └── config.json.example  # Template for users

Error Handling

When credentials are not found, the module raises ValueError with clear guidance:

  • Where to place config.json
  • How to set environment variables
  • Links to provider consoles for key generation

Skills should catch ValueError exceptions and handle appropriately.

Available Functions

get_anthropic_api_key() → str

  • Returns Anthropic API key
  • Raises ValueError if not configured

get_google_api_key() → str

  • Returns Google API key
  • Raises ValueError if not configured

get_github_api_key() → str

  • Returns GitHub API token (Personal Access Token)
  • Raises ValueError if not configured

get_api_key_masked(api_key) → str

  • Returns masked version for safe logging
  • Example: "sk-ant-...xyz"

verify_credential(provider) → bool

  • Checks if provider is configured
  • Returns True/False without raising exceptions
  • Providers: 'anthropic', 'google', 'github'

Adding New Providers

To support additional providers:

  1. Add field to assets/config.json.example
  2. Add getter function to scripts/credentials.py: def get_provider_api_key() -> str: # Follow existing pattern with config file + env var pass
  3. Add to verify_credential() mapping
  4. Update this documentation

Token Efficiency

This skill uses ~300 tokens when loaded but saves repeated credential management code across multiple skills that invoke external APIs. It provides a single, consistent pattern for all credential handling.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.36%
按下载量换算90

Claude

27.38%
按下载量换算66

Cursor

19.44%
按下载量换算47

Gemini CLI

8.8%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills