# API OAUTH API Keys

> Select credential models for APIs: API keys vs OAuth2 client credentials vs authorization code + PKCE, including scopes. Use when designing developer credentials or user-delegated access.

- Skill: `deangrant/api-oauth-api-keys` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add deangrant/api-oauth-api-keys`
- Raw SKILL.md: https://api.skillmd.com/api/skills/deangrant/api-oauth-api-keys/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: deangrant (https://skillmd.com/u/deangrant)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/deangrant/api-oauth-api-keys

---


# OAuth 2.0 and API Keys

Use this skill when choosing **credential models** for humans and machines.

---

## 1. Selection

| Model | Use |
| ----- | --- |
| **API keys** | Simple service access; header-only (never query); rotate |
| **Client credentials** | M2M confidential clients |
| **Auth code + PKCE** | User-delegated apps (public/native) |
| **Refresh tokens** | Long sessions with short-lived access tokens |

Scopes = least privilege. Audit client scope usage.

---

## 2. Quick checklist

- [ ] Keys in headers only; stored hashed server-side when possible.
- [ ] Right OAuth flow for client type.
- [ ] Short-lived access tokens; scoped.
- [ ] Rotation without downtime.

See [reference.md](reference.md) and [examples.md](examples.md).

