Agent skill

API Integration

by seb1n in seb1n/awesome-ai-agent-skills

Integrate with external APIs using REST clients, webhook consumers, SDK wrappers, and polling patterns with proper authentication, error handling, and retry logic.

MITAuto-check passedBackend & APIs

Install API Integration

skills CLI
$ npx skills add seb1n/awesome-ai-agent-skills --skill api-integration -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install seb1n/awesome-ai-agent-skills api-integration --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/seb1n/awesome-ai-agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/api-and-integration/api-integration .claude/skills/api-integration && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
api-integration
GitHub stars
206
Token cost
~3k tokens
SKILL.md length
763 words
Files
1
Skills in repo
91
Repo updated
First seen
Licence
MIT

At a glance

Integrate with external APIs using REST clients, webhook consumers, SDK wrappers, and polling patterns with proper authentication, error handling, and retry logic.

  • Works in 6 steps: Analyze the target API: Review the API… → Choose an integration pattern: Select… → Implement authentication: Configure the… → …
  • The user requests api integration
  • SKILL.md covers Workflow, Supported Technologies, Usage and Examples, plus 2 more sections
  • Reaches api.stripe.com and api.github.com; needs STRIPE_SECRET_KEY and GITHUB_TOKEN

What it does

API Integration is an agent skill from seb1n/awesome-ai-agent-skills. Integrate with external APIs using REST clients, webhook consumers, SDK wrappers, and polling patterns with proper authentication, error handling, and retry logic. Use when the user requests api integration or provides relevant inputs for this workflow.

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Third-party API integration and Error handling. The repository describes itself as: 103 ready-to-use AI agent skills for Claude Code, OpenAI Codex, Gemini CLI, Cursor, GitHub Copilot, Windsurf, and other Agent Skills-compatible tools. Complete SKILL.md… The licence is MIT.

When your agent uses it

  • The user requests api integration
  • Provides relevant inputs for this workflow

Example prompts

  • “/api-integration”

Requirements

  • Python 3
  • Node.js
  • A credential in STRIPE_SECRET_KEY
  • A credential in GITHUB_TOKEN

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Analyze the target API: Review the API documentation, OpenAPI spec, or SDK reference to understand available endpoints, authentication…
  2. Choose an integration pattern: Select the appropriate pattern based on the use case. Use a REST client for on-demand request/response…
  3. Implement authentication: Configure the correct authentication method—API key in headers, OAuth 2.0 bearer tokens, JWT-based service auth…
  4. Build the client with error handling: Write the integration code with structured error handling. Catch HTTP errors by status code…
  5. Add retry and circuit breaker logic: Implement exponential backoff with jitter for transient failures. Set a maximum retry count…
  6. Test and monitor: Write integration tests using recorded HTTP fixtures (VCR pattern) so tests don't hit live APIs. Monitor integration…

What it can do on your machine

Read from SKILL.md and the folder at commit 75865a5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.stripe.com
    • api.github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • STRIPE_SECRET_KEY
    • GITHUB_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

API Integration loads about 3k tokens when it runs. Until then it costs about 67 tokens; SKILL.md has 763 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from seb1n/awesome-ai-agent-skills at commit 75865a5, republished under its MIT licence (© seb1n). 763 words, ~2,959 tokens.

Download SKILL.mdSave it as .claude/skills/api-integration/SKILL.md (or your agent's skills folder).
name
api-integration
description
Integrate with external APIs using REST clients, webhook consumers, SDK wrappers, and polling patterns with proper authentication, error handling, and retry logic. Use when the user requests api integration or provides relevant inputs for this workflow.
license
MIT
metadata.author
awesome-ai-agent-skills
metadata.version
1.0.0

API Integration

This skill enables an AI agent to integrate applications with external APIs reliably. The agent selects the right integration pattern (REST client, webhook consumer, polling, SDK wrapper), implements authentication (API keys, OAuth, JWT), handles errors with retries and circuit breakers, and respects rate limits. The result is production-grade integration code that handles real-world failure modes.

Workflow

  1. Analyze the target API: Review the API documentation, OpenAPI spec, or SDK reference to understand available endpoints, authentication requirements, rate limits, and response formats. Identify whether the API supports webhooks for push-based updates or requires polling. Note any idiosyncrasies like non-standard error formats or pagination schemes.

  2. Choose an integration pattern: Select the appropriate pattern based on the use case. Use a REST client for on-demand request/response interactions. Use webhook consumers for real-time event-driven data. Use polling when the API has no webhook support but you need near-real-time updates. Wrap official SDKs when they exist to add retry logic, logging, and a consistent interface.

  3. Implement authentication: Configure the correct authentication method—API key in headers, OAuth 2.0 bearer tokens, JWT-based service auth, or basic auth. Store credentials securely using environment variables or a secrets manager. For OAuth flows, implement token refresh logic so long-running integrations don't break when access tokens expire.

  4. Build the client with error handling: Write the integration code with structured error handling. Catch HTTP errors by status code category: 4xx for client errors (don't retry), 429 for rate limiting (retry with backoff), 5xx for server errors (retry with exponential backoff). Parse error response bodies for actionable messages. Log all requests and responses at debug level for troubleshooting.

  5. Add retry and circuit breaker logic: Implement exponential backoff with jitter for transient failures. Set a maximum retry count (typically 3-5). Implement a circuit breaker that opens after consecutive failures and periodically allows a test request through. This prevents cascading failures when a downstream API is degraded.

  6. Test and monitor: Write integration tests using recorded HTTP fixtures (VCR pattern) so tests don't hit live APIs. Monitor integration health with metrics for request latency, error rates, and rate limit headroom. Set up alerts for sustained error rates above threshold.

Supported Technologies

  • HTTP clients: requests (Python), httpx (Python async), axios (Node.js), fetch, HttpClient (.NET), OkHttp (Java)
  • Authentication: API keys, OAuth 2.0, JWT, Basic Auth, HMAC signatures
  • Resilience: tenacity (Python), retry (Node.js), Polly (.NET), resilience4j (Java)
  • Testing: responses (Python), nock (Node.js), VCR.py, WireMock
  • GraphQL clients: gql (Python), graphql-request (Node.js), Apollo Client

Usage

Provide the agent with the target API name or documentation URL, the operations you need to perform, and the programming language. Specify authentication method and any constraints (rate limits, data volume). The agent will produce a complete integration module with error handling, retries, and usage examples.

Examples

Show full SKILL.md (305 more words)Show less
Example 1: Stripe API Integration in Python
python
import os
import time
import logging
from typing import Optional
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry

logger = logging.getLogger(__name__)

class StripeClient:
    """Production-ready Stripe API client with retries and error handling."""

    BASE_URL = "https://api.stripe.com/v1"

    def __init__(self, api_key: Optional[str] = None):
        self.api_key = api_key or os.environ["STRIPE_SECRET_KEY"]
        self.session = self._build_session()

    def _build_session(self) -> requests.Session:
        session = requests.Session()
        session.headers.update({
            "Authorization": f"Bearer {self.api_key}",
            "Content-Type": "application/x-www-form-urlencoded",
            "Stripe-Version": "2024-06-20",
        })
        retry_strategy = Retry(
            total=4,
            backoff_factor=1,
            status_forcelist=[429, 500, 502, 503, 504],
            allowed_methods=["GET", "POST", "DELETE"],
            respect_retry_after_header=True,
        )
        adapter = HTTPAdapter(max_retries=retry_strategy)
        session.mount("https://", adapter)
        return session

    def create_customer(self, email: str, name: str, metadata: Optional[dict] = None) -> dict:
        """Create a Stripe customer."""
        payload = {"email": email, "name": name}
        if metadata:
            for key, value in metadata.items():
                payload[f"metadata[{key}]"] = value
        response = self._request("POST", "/customers", data=payload)
        return response

    def create_payment_intent(self, amount_cents: int, currency: str = "usd",
                              customer_id: Optional[str] = None) -> dict:
        """Create a payment intent for a given amount."""
        payload = {"amount": amount_cents, "currency": currency}
        if customer_id:
            payload["customer"] = customer_id
        return self._request("POST", "/payment_intents", data=payload)

    def list_charges(self, customer_id: str, limit: int = 10) -> list:
        """List charges for a customer with automatic pagination."""
        charges = []
        params = {"customer": customer_id, "limit": limit}
        while True:
            data = self._request("GET", "/charges", params=params)
            charges.extend(data["data"])
            if not data["has_more"]:
                break
            params["starting_after"] = data["data"][-1]["id"]
        return charges

    def _request(self, method: str, path: str, **kwargs) -> dict:
        url = f"{self.BASE_URL}{path}"
        try:
            resp = self.session.request(method, url, **kwargs)
            resp.raise_for_status()
            return resp.json()
        except requests.exceptions.HTTPError as e:
            error_body = e.response.json().get("error", {})
            logger.error(
                "Stripe API error: type=%s code=%s message=%s",
                error_body.get("type"),
                error_body.get("code"),
                error_body.get("message"),
            )
            if e.response.status_code == 429:
                retry_after = int(e.response.headers.get("Retry-After", 5))
                logger.warning("Rate limited. Retry after %ds", retry_after)
            raise
        except requests.exceptions.ConnectionError:
            logger.error("Connection failed to Stripe API")
            raise

# Usage
client = StripeClient()
customer = client.create_customer("alice@example.com", "Alice Smith")
payment = client.create_payment_intent(2500, customer_id=customer["id"])
print(f"Payment intent {payment['id']} for ${payment['amount']/100:.2f}")
Example 2: GraphQL API Integration with requests
python
import requests
from typing import Any, Optional

class GraphQLClient:
    """Lightweight GraphQL client with error handling and variable support."""

    def __init__(self, endpoint: str, headers: Optional[dict] = None):
        self.endpoint = endpoint
        self.session = requests.Session()
        if headers:
            self.session.headers.update(headers)

    def execute(self, query: str, variables: Optional[dict] = None) -> dict:
        """Execute a GraphQL query or mutation."""
        payload = {"query": query}
        if variables:
            payload["variables"] = variables

        response = self.session.post(self.endpoint, json=payload, timeout=30)
        response.raise_for_status()
        result = response.json()

        if "errors" in result:
            error_messages = [e["message"] for e in result["errors"]]
            raise GraphQLError(error_messages, result.get("data"))

        return result["data"]

class GraphQLError(Exception):
    def __init__(self, messages: list, partial_data: Any = None):
        self.messages = messages
        self.partial_data = partial_data
        super().__init__(f"GraphQL errors: {'; '.join(messages)}")

# Usage: Query a GitHub-style GraphQL API
client = GraphQLClient(
    endpoint="https://api.github.com/graphql",
    headers={"Authorization": f"Bearer {os.environ['GITHUB_TOKEN']}"},
)

# Fetch repositories with pagination
query = """
query($owner: String!, $cursor: String) {
  user(login: $owner) {
    repositories(first: 10, after: $cursor, orderBy: {field: UPDATED_AT, direction: DESC}) {
      pageInfo {
        hasNextPage
        endCursor
      }
      nodes {
        name
        description
        stargazerCount
        primaryLanguage { name }
      }
    }
  }
}
"""

repos = []
cursor = None
while True:
    data = client.execute(query, {"owner": "octocat", "cursor": cursor})
    page = data["user"]["repositories"]
    repos.extend(page["nodes"])
    if not page["pageInfo"]["hasNextPage"]:
        break
    cursor = page["pageInfo"]["endCursor"]

for repo in repos:
    lang = repo["primaryLanguage"]["name"] if repo["primaryLanguage"] else "N/A"
    print(f"{repo['name']} ({lang}) - {repo['stargazerCount']} stars")

Best Practices

  • Never hardcode credentials. Use environment variables or a secrets manager. Rotate API keys on a regular schedule and immediately on suspected compromise.
  • Respect rate limits proactively. Parse X-RateLimit-Remaining headers and slow down before hitting the limit rather than reacting to 429 responses after the fact.
  • Use idempotency keys for POST requests to payment and financial APIs. This prevents duplicate charges or operations when retrying after network failures.
  • Implement request/response logging at debug level with sensitive fields (tokens, card numbers) redacted. This is invaluable for debugging integration issues in production.
  • Set explicit timeouts on all HTTP requests (connect timeout of 5s, read timeout of 30s). Never use infinite timeouts—a hung connection will block your entire application.
  • Version-pin API integrations by sending explicit API version headers (e.g., Stripe-Version). This prevents breaking changes from affecting your integration unexpectedly.

Edge Cases

  • API deprecation: Monitor for Deprecation and Sunset headers in responses. Log warnings when these appear so you can migrate before the endpoint is removed.
  • Partial responses: Some APIs return 200 OK with an errors array (common in GraphQL). Always check for error fields even on successful HTTP status codes.
  • Clock skew: APIs that use timestamp-based signatures (HMAC, JWT) can reject requests if your server clock is skewed. Use NTP and allow a small tolerance window.
  • Large payloads: When fetching large datasets, use streaming responses and pagination rather than loading everything into memory. Watch for APIs that silently truncate results.
  • Network partitions: A request may succeed on the server but the response is lost. This is why idempotency keys matter—you can safely retry without causing duplicate side effects.
  • Webhook vs. polling race conditions: If you use both webhooks and polling for the same data, implement deduplication to avoid processing the same event twice.

© seb1n, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in api-and-integration/api-integration of seb1n/awesome-ai-agent-skills.

Open the folder on GitHubat commit 75865a5

Compare with similar skills

API Integration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

API Integration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
API Integration this skillseb1n/awesome-ai-agent-skills206—~3kAutomated safety check: PassMIT
API IntegrationHack23/cia239—~1.9kAutomated safety check: PassApache-2.0
Retry Logic Helperjeremylongshore/tons-of-skills-marketplace2.8k1 repos~557Automated safety check: PassMIT
API Integration Specialistaiskillstore/marketplace4302 repos~2.2kAutomated safety check: PassNone
Vercel SDK Patternsjeremylongshore/tons-of-skills-marketplace2.8k—~2.3kAutomated safety check: PassMIT
Zodjasonjgardner/blockbench-mcp-plugin4913 repos~1.4kAutomated safety check: PassGPL-3.0

Similar skills

  • API Integration

    Hack23/cia

    External API integration patterns, retry logic, circuit breakers, caching, rate limiting for government data APIs

    239 GitHub stars~1.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • Retry Logic Helper

    jeremylongshore/tons-of-skills-marketplace

    Assist with retry logic helper operations. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub starsUsed in 1 repo~557 tokens
    Backend & APIsAuto-check passed
  • API Integration Specialist

    aiskillstore/marketplace

    Expert in integrating third-party APIs with proper authentication, error handling, rate limiting, and retry logic.

    430 GitHub starsUsed in 2 repos~2.2k tokens
    Backend & APIsAuto-check passed
  • Vercel SDK Patterns

    jeremylongshore/tons-of-skills-marketplace

    Production-ready Vercel REST API patterns with typed fetch wrappers and error handling.

    2.8k GitHub stars~2.3k tokensUpdated today
    Backend & APIsAuto-check passed
  • Zod

    jasonjgardner/blockbench-mcp-plugin

    Zod schema validation best practices for type safety, parsing, and error handling.

    491 GitHub starsUsed in 3 repos~1.4k tokens
    DevelopmentAuto-check passed
  • Adynato Mobile API

    majiayu000/claude-skill-registry

    API integration patterns for Adynato mobile apps. An agent skill from majiayu000/claude-skill-registry.

    666 GitHub starsUsed in 1 repo~2.5k tokens
    MobileAuto-check passed

More from seb1n/awesome-ai-agent-skills

All 91 skills in this repo
  • Agent Red Teaming

    seb1n/awesome-ai-agent-skills

    Plan, execute, document, and retest authorized security assessments of AI agents and multi-agent workflows using safe adversarial cases, synthetic identities, canaries, and evidence-based findings.

    206 GitHub stars~2.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Eu AI Act Readiness

    seb1n/awesome-ai-agent-skills

    Build a preliminary, evidence-based EU AI Act readiness assessment across AI-system inventory, territorial scope, operator roles, prohibited-practice screening, risk classification, transparency…

    206 GitHub stars~3.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Human In The Loop

    seb1n/awesome-ai-agent-skills

    Design and verify auditable human oversight, approval gates, escalation paths, and safe state transitions for AI agent workflows.

    206 GitHub stars~2.5k tokensUpdated 1 mo ago
    Auto-check passed
  • MCP Server Building

    seb1n/awesome-ai-agent-skills

    Design, implement, harden, and verify Model Context Protocol (MCP) servers with precise tool contracts, least-privilege authorization, safe transports, structured errors, and interoperability tests.

    206 GitHub stars~2.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Skill Supply Chain Audit

    seb1n/awesome-ai-agent-skills

    Audit agent skills, plugins, prompts, manifests, scripts, dependencies, and bundled assets for provenance, prompt-injection, permission, execution, exfiltration, persistence, and update risk.

    206 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Spreadsheet Analysis

    seb1n/awesome-ai-agent-skills

    Inspect, profile, clean, reconcile, analyze, visualize, and verify spreadsheet data while preserving formulas, formatting, types, and source files.

    206 GitHub stars~2.5k tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about API Integration

What does API Integration do?

Integrate with external APIs using REST clients, webhook consumers, SDK wrappers, and polling patterns with proper authentication, error handling, and retry logic. API Integration is an agent skill from seb1n/awesome-ai-agent-skills. Integrate with external APIs using REST clients, webhook consumers, SDK wrappers, and polling patterns with proper authentication, error handling, and retry logic.

When should I use API Integration?

API Integration fits situations like: the user requests api integration; provides relevant inputs for this workflow.

How do I install API Integration in Claude Code?

Run `npx skills add seb1n/awesome-ai-agent-skills --skill api-integration -a claude-code`. Or copy the skill folder (api-and-integration/api-integration in seb1n/awesome-ai-agent-skills) into .claude/skills/api-integration in your project. Claude Code loads it when a task matches its description.

How do I install API Integration in Codex?

Run `npx skills add seb1n/awesome-ai-agent-skills --skill api-integration -a codex`. Or copy the skill folder (api-and-integration/api-integration in seb1n/awesome-ai-agent-skills) into .agents/skills/api-integration in your project. Codex loads it when a task matches its description.

Can I use API Integration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add seb1n/awesome-ai-agent-skills --skill api-integration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/api-integration, .gemini/skills/api-integration, .github/skills/api-integration and .opencode/skills/api-integration in your project.

What does API Integration need to run?

Going by SKILL.md and its folder, API Integration needs credentials named STRIPE_SECRET_KEY and GITHUB_TOKEN. Our summary lists: Python 3; Node.js; A credential in STRIPE_SECRET_KEY; A credential in GITHUB_TOKEN.

Does API Integration access the network?

SKILL.md names 2 domains. In commands or code: api.stripe.com and api.github.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is API Integration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does API Integration use?

API Integration is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does API Integration use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to API Integration?

Skills that share tags, products or a category with API Integration: API Integration (Hack23/cia, 239 stars), Retry Logic Helper (jeremylongshore/tons-of-skills-marketplace, 2.8k stars), API Integration Specialist (aiskillstore/marketplace, 430 stars) and Vercel SDK Patterns (jeremylongshore/tons-of-skills-marketplace, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains API Integration?

seb1n (a GitHub user) maintains it in seb1n/awesome-ai-agent-skills, which has 206 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on August 9, 2026.

Source: seb1n/awesome-ai-agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.