Skip to content
Skills Library
Security · Tool integration

api-credentials

/api-credentials

Securely manages API credentials for multiple providers (Anthropic Claude, Google Gemini, GitHub). Use when skills need to access stored API keys for external service invocations.

Licence
MIT
Last repository change
25.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/credentials.py

What it does and when to use it

Securely manages API credentials for multiple providers (Anthropic Claude, Google Gemini, GitHub). Use when skills need to access stored API keys for external service invocations.

Original author description

Securely manages API credentials for multiple providers (Anthropic Claude, Google Gemini, GitHub). Use when skills need to access stored API keys for external service invocations.

How it works

  1. Supported Providers
  2. Purpose
  3. Usage by Other Skills
  4. Setup Instructions
  5. Priority
  6. Security Notes
  7. File Structure
  8. Error Handling
  9. Available Functions
  10. Adding New Providers
Original SKILL.md headings · 200 lines, 677 words
SKILL.md preview
---
name: api-credentials
description: Securely manages API credentials for multiple providers (Anthropic Claude, Google Gemini, GitHub). Use when skills need to access stored API keys for external service invocations.
metadata:
  version: 0.0.4
---

# 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:
- [orchestrating-chat-agents](../orchestrating-chat-agents/SKILL.md#setup)
- [invoking-gemini](../invoking-gemini/SKILL.md#setup)
- [invoking-github](../invoking-github/SKILL.md#quick-start)

**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

```python
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

```python
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

```python
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:
```bash
cp /home/user/claude-skills/api-credentials/assets/config.json.example \
   /home/user/claude-skills/api-credentials/config.json
```

2. Edit `config.json` and add your API keys:
```json
{
  "anthropic_api_key": "sk-ant-api03-...",
  "google_api_key": "AIzaSy...",
  "github_api_key": "ghp_..."
}
```

3. Ensure the config file is in `.gitignore` (already configured)

### Option 2: Environment Variables

Set environment variables for the providers you need:

```bash
# 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`:
   ```python
   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.
Files in this package (6)
  • .gitignore 1 KB
  • CHANGELOG.md 1 KB
  • README.md 1 KB
  • SKILL.md 6 KB
  • assets/config.json.example 1 KB
  • scripts/credentials.py 8 KB

Versions

The database has no other skills named api-credentials.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 50ca98fe09e1 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100secrets-management
    Manages API keys, credentials, and sensitive configuration using secrets.json patterns with environment variable fallbacks. Use when working with API keys, credentials, .env files, or any sensitive configuration.
  • 85elbab
    Use credentials kept in elbab, the age-encrypted local store, without exposing them. Use when a task needs an API key, password, token, SSH key, cloud CLI login or .env value, or when a credential should be stored or protected.
  • 95claude-api
    Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.
  • 100ai-key-map
    List every place an AI provider API key (OpenAI, Anthropic, Gemini, OpenRouter, DeepSeek, Groq and more) is stored on this machine, which copies are the same key, and give a rotation checklist. Use after a key leak or provider breach, before rotating keys, when the user asks…
  • 100clade-install-auth
    Install and configure the Anthropic SDK for Claude API access. Use when setting up Claude integration, configuring API keys, or initializing the Anthropic client in your project. Trigger with phrases like "install anthropic", "setup claude api", "anthropic auth", "configure anthropic API key".
  • 100claude-api
    Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.