# API credentials

> API credentials is an open-source agent skill for security. Loads stored API keys for Claude, Gemini and GitHub so other skills can call those. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/oaustegard/claude-skills/tree/main/api-credentials
- **Repository:** https://github.com/oaustegard/claude-skills
- **GitHub stars:** 428
- **License:** MIT
- **Skill name:** api-credentials
- **Collection:** https://github.com/oaustegard/claude-skills
- **Categories:** [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-12-04

## About

This skill is a shared helper that other agent skills use to fetch API keys for Anthropic Claude, Google Gemini and GitHub. It provides a small Python module with getter functions for each provider, a masked-key helper for safe logging, and a check that reports whether a provider is configured without raising an error.

Keys are read from a local config.json file in the skill folder first, then from environment variables such as ANTHROPIC_API_KEY, GOOGLE_API_KEY and GITHUB_TOKEN. When a key is missing, the module raises a ValueError with guidance on where to place the key, so calling skills can catch it and respond.

The skill expects a Python environment and a config file copied from the bundled example template or shell environment variables set by the user. The README and SKILL.md mark it as deprecated in favor of newer setup approaches, and it is intended mainly for local development or backward compatibility.

## When your agent uses 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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs Python scripts](https://github.com/oaustegard/claude-skills/tree/HEAD/api-credentials)
- [No network calls found in its scripts](https://github.com/oaustegard/claude-skills/tree/HEAD/api-credentials)
- [License: MIT](https://github.com/oaustegard/claude-skills/tree/HEAD/api-credentials)

## Features

- **Multi-provider key retrieval:** Getter functions return the Anthropic, Google Gemini and GitHub keys for dependent skills.
- **Config file and environment fallback:** Keys are looked up in a local config.json first, then in environment variables.
- **Clear missing-key errors:** A ValueError explains where to place the config file or which variables to set.
- **Safe key masking:** A helper returns a shortened version of a key suitable for log output.
- **Configuration check:** A verification function reports whether a provider is set up without raising errors.
- **Deprecation notice:** The documentation points users to newer credential approaches for hosted environments.

## Good for

- Store API keys locally so another skill can call the Claude API
- Check whether a Gemini key is configured before running a task
- Fetch a GitHub token from environment variables for an API script
- Mask stored keys before printing diagnostic output

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/api-credentials` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/oaustegard/claude-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/api-credentials &&
cp -R "$tmp/api-credentials" ~/.claude/skills/api-credentials &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/api-credentials` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/api-credentials` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/oaustegard/claude-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/api-credentials &&
cp -R "$tmp/api-credentials" ~/.agents/skills/api-credentials &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/api-credentials` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/api-credentials` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/oaustegard/claude-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/api-credentials &&
cp -R "$tmp/api-credentials" ~/.cursor/skills/api-credentials &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/api-credentials` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/oaustegard/claude-skills.git --path api-credentials
```

Or copy the folder to `~/.gemini/skills/api-credentials` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/api-credentials`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/oaustegard/claude-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/api-credentials &&
cp -R "$tmp/api-credentials" ~/.copilot/skills/api-credentials &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/api-credentials` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/oaustegard/claude-skills.git
```

Then copy `claude-skills/api-credentials` into your agent's skills folder as `api-credentials`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Where does the skill look for API keys?

It checks config.json in the skill directory first, then environment variables such as ANTHROPIC_API_KEY, GOOGLE_API_KEY, GITHUB_TOKEN or GITHUB_API_KEY.

### What happens when a key is missing?

The getter raises a ValueError with guidance on configuring the key, and calling skills are expected to catch it.

### Is API credentials still recommended?

No. The documentation marks it as deprecated for hosted skills environments and suggests reading credentials from project knowledge files; it remains for local development or backward compatibility.

### Which providers are supported?

Anthropic Claude, Google Gemini and GitHub are supported, and the docs describe adding other providers by extending the module.

### How do I install API credentials in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/api-credentials to use it in all your projects, or to .claude/skills/api-credentials in one project.

### Does API credentials run scripts?

Yes. It runs Python scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use API credentials?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to API credentials?

The closest alternatives to API credentials are Axiom security, Sh kb secrets, Azure keyvault py, Secrets in git history and Auth.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Axiom security](https://ai-powered.com/skills/axiom-security-charleswiltgen-2): Axiom security is an open-source agent skill for security.
- [Sh kb secrets](https://ai-powered.com/skills/sh-kb-secrets): Sh kb secrets is an open-source agent skill for security.
- [Azure keyvault py](https://ai-powered.com/skills/azure-keyvault-py): Azure keyvault py is an open-source agent skill for cloud and infrastructure.
- [Secrets in git history](https://ai-powered.com/skills/secrets-in-git-history): Secrets in git history is an open-source agent skill for security.
- [Auth](https://ai-powered.com/skills/auth-maxwell2732): Auth is an open-source agent skill for databases.
- [Swift security expert](https://ai-powered.com/skills/swift-security-expert): Swift security expert is an open-source agent skill for security.
- [Auth and rbac](https://ai-powered.com/skills/auth-and-rbac): Auth and rbac is an open-source agent skill for security.
- [Envault](https://ai-powered.com/skills/envault-mildynora): Envault is an open-source agent skill for security.

---
Source: https://ai-powered.com/skills/api-credentials
