Skip to content
Skillpedia
APIs & servers (backend)48k · #2164

api-sdk-generator

Lets your agent create libraries for using APIs in different languages. This simplifies system integration.

What it does

This tool automatically creates code (called SDKs) that simplifies communication with APIs (online services). It generates libraries so other programs can use these services more easily and organized, defining how data should be sent and received.

When to use it

  • ✓When you need a program to communicate with an online service (API).
  • ✓When creating a new application that will use data from an existing API.
  • ✓To organize and simplify API access in your code.

Example of what to ask your AI

“Generate a Python SDK for the user management API, including request/response models and error handling.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/api-sdk-generator/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/api-sdk-generator/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool analyzes the API's description and generates code files that define how to connect, send commands, and receive responses. It organizes this code into folders for easier use.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add sickn33/agentic-awesome-skills --skill api-sdk-generator

Or download just the file:

curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/api-sdk-generator/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

API SDK & Codegen Skill

When to Use

Use this skill when you need generates client SDK code, API wrapper libraries, request/response models, and language-specific usage patterns for any REST API. Use whenever the user asks to "generate an SDK", "write a client library", "create API wrappers", "generate TypeScript types from my API", "write a Python...

Generate production-quality client libraries and SDK code for any API in any language.


SDK Structure (any language)

sdk/
├── client.{ext}          — main client class with base URL, auth, retry
├── resources/
│   ├── users.{ext}       — one file per API resource
│   ├── orders.{ext}
│   └── ...
├── models/
│   ├── user.{ext}        — request/response data models
│   └── ...
├── errors.{ext}          — typed error classes
└── utils/
    ├── retry.{ext}
    └── pagination.{ext}

Base Client Pattern

Python

import httpx
from typing import Optional
import time

class APIClient:
    def __init__(self, api_key: str, base_url: str = "https://api.example.com/v1"):
        self.base_url = base_url
        self._headers = {
            "Authorization": f"Bearer {api_key}",
            "Content-Type": "application/json",
            "User-Agent": "example-sdk-python/1.0.0"
        }
        self._client = httpx.Client(timeout=30.0)

    def _request(self, method: str, path: str, **kwargs) -> dict:
        url = f"{self.base_url}{path}"
        for attempt in range(3):
            try:
                resp = self._client.request(method, url, headers=self._headers, **kwargs)
                if resp.status_code == 429:
                    retry_after = int(resp.headers.get("Retry-After", 2 ** attempt))
                    time.sleep(retry_after)
                    continue
                resp.raise_for_status()
                return resp.json()
            except httpx.HTTPStatusError as e:
                raise APIError(e.response.status_code, e.response.json()) from e
        raise RateLimitError("Max retries exceeded")

TypeScript

class APIClient {
  private readonly baseUrl: string;
  private readonly headers: Record<string, string>;

  constructor(apiKey: string, baseUrl = 'https://api.example.com/v1') {
    this.baseUrl = baseUrl;
    this.headers = {
      'Authorization': `Bearer ${apiKey}`,
      'Content-Type': 'application/json',
    };
  }

  async request<T>(method: string, path: string, body?: unknown): Promise<T> {
    const res = await fetch(`${this.baseUrl}${path}`, {
      method,
      headers: this.headers,
      body: body ? JSON.stringify(body) : undefined,
    });
    if (!res.ok) {
      const err = await res.json();
      throw new APIError(res.status, err.message);
    }
    return res.json() as T;
  }
}

Resource Class Pattern

Python

from dataclasses import dataclass
from typing import Optional, List

@dataclass
class User:
    id: str
    name: str
    email: str
    created_at: str
    role: Optional[str] = None

class UsersResource:
    def __init__(self, client: APIClient):
        self._client = client

    def list(self, page: int = 1, limit: int = 20) -> List[User]:
        data = self._client._request("GET", f"/users?page={page}&limit={limit}")
        return [User(**u) for u in data["data"]]

    def get(self, user_id: str) -> User:
        data = self._client._request("GET", f"/users/{user_id}")
        return User(**data)

    def create(self, name: str, email: str, role: Optional[str] = None) -> User:
        payload = {"name": name, "email": email}
        if role:
            payload["role"] = role
        data = self._client._request("POST", "/users", json=payload)
        return User(**data)

    def delete(self, user_id: str) -> None:
        self._client._request("DELETE", f"/users/{user_id}")

Typed Error Classes

class APIError(Exception):
    def __init__(self, status_code: int, message: str):
        self.status_code = status_code
        self.message = message
        super().__init__(f"HTTP {status_code}: {message}")

class AuthenticationError(APIError): pass   # 401
class AuthorizationError(APIError): pass    # 403
class NotFoundError(APIError): pass         # 404
class ValidationError(APIError): pass       # 422
class RateLimitError(APIError): pass        # 429
class ServerError(APIError): pass           # 5xx

Pagination Helper

def paginate(resource_method, **kwargs):

…
FAQ

What is an SDK?

SDK stands for 'Software Development Kit'. It's a set of tools and code that helps developers build applications that interact with a specific service, like an API.

What is an API?

API stands for 'Application Programming Interface'. It's a set of rules and definitions that allows different software programs to communicate with each other.

Why use an automatically generated SDK?

It saves time and ensures that communication with the API is done in a standardized and correct way, following best programming practices.

Details

Original description by the author

Generates client SDK code, API wrapper libraries, request/response models, and language-specific usage patterns for any REST API.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#2164
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills