# API Client Generation

> Generate an API client from a documented contract with typed inputs, response validation, timeout policy, and error handling.

- Skill: `samotech/api-client-generation` (Agent Skill)
- Install (CLI): `npx get-skill add samotech/api-client-generation`
- Raw SKILL.md: https://api.skillmd.com/api/skills/samotech/api-client-generation/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: SamoTech (https://skillmd.com/u/samotech)
- Updated: 2026-11-21
- Page: https://skillmd.com/skills/samotech/api-client-generation

---


# Api Client Generation

## Description

Generate an API client from a documented contract with typed inputs, response validation, timeout policy, and error handling.

## When to Use

- Use when the code task has explicit acceptance criteria.
- Preserve repository conventions and existing security gates.
- Verify behavior before reporting completion.

## Inputs / outputs / failure modes

| Input | Output | Failure mode |
|---|---|---|
| Requirements | Code or analysis | Ambiguous requirement |
| Repository context | Compatible change | Convention mismatch |
| Tests/evidence | Verification result | Regression |
| Security constraints | Safe implementation | Gate bypass |

## Runnable Example

```python
def build_request(base_url, path, token):
    if not base_url or not path or not token: raise ValueError('missing client input')
    return {'url': base_url.rstrip('/') + '/' + path.lstrip('/'), 'token': token}

print(build_request('https://api.example', '/items', 'TOKEN'))
```

## Failure modes

- Implementing behavior not supported by the requirements.
- Changing unrelated code.
- Skipping regression or security verification.
- Claiming correctness without evidence.

## Related

- `api-call.md`
- `api-response-parsing.md`

## Evidence

- AI_CONSTITUTION.md
- AGENTS.md
- Repository validation and security workflows

Evidence status: repository-backed implementation guidance; no benchmark claim.

