http-client-integration

http-client-integration is a skill for Claude Code, Codex from robhowley/py-pit-skills. It costs 57 tokens per session (1,132 once invoked), scanned A, original, MIT.

A disciplined integration pattern for making asynchronous calls to outside HTTP APIs from Python backend services.

In plain words
What is it for?
Use it when adding or refactoring vendor API clients, outbound requests, retry and timeout handling, external payload validation, or ad-hoc HTTP integrations.
Why use it?
It replaces scattered request code with a reusable boundary that covers timeouts, retries, typed data validation, error mapping, and testing.

Skill for Claude CodeCodex

Part of the py-pit plugin — 16 skills, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/robhowley/py-pit-skills/http-client-integration
Any agent
npx skills add robhowley/py-pit-skills --skill http-client-integration
Clone the repo
git clone --depth 1 https://github.com/robhowley/py-pit-skills

Made for: Claude Code, Codex.

Or install py-pit, the plugin that ships this one along with the rest of its 16 skills, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for http-client-integration

README.md
[![agentmods](https://agentmods.dev/badge/skills/robhowley/py-pit-skills/http-client-integration.svg)](https://agentmods.dev/skills/robhowley/py-pit-skills/http-client-integration)
Your own site
<a href="https://agentmods.dev/skills/robhowley/py-pit-skills/http-client-integration"><img src="https://agentmods.dev/badge/skills/robhowley/py-pit-skills/http-client-integration.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,132 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00057 $0.01132
Opus 5 $0.00028 $0.00566
Sonnet 5 $0.00011 $0.00226
Haiku 4.5 $0.00006 $0.00113

Measured 4d ago against content hash 9a333bc2a7bc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

http-client-integration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/http-client-integration/SKILL.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Skill: http-client-integration

Core position

Treat external HTTP APIs as infrastructure boundaries, not ad-hoc utility calls.

This skill creates a centralized async integration layer using httpx.AsyncClient, explicit timeout policy, tenacity-based retries, typed payload validation, structured error mapping, and testable client design.

The goal is not merely to make a request, but to make outbound HTTP calls safe, observable, reusable, and easy to test.

Inspect first

Before changing code, inspect the repo for:

  • Existing HTTP client patterns or a shared base client
  • Dependency injection or app lifecycle conventions
  • Existing configuration patterns for base URLs, timeouts, retries, and credentials
  • Logging, metrics, tracing, and error-handling conventions
  • Existing tests and mocking style for integrations

Reuse the repo's established patterns when they are sound. Do not introduce a second HTTP client architecture without a clear reason.

Core rules

  • Put outbound HTTP calls behind a dedicated client or integration module
  • Use httpx.AsyncClient, not requests or sync clients in async apps
  • Reuse a managed client instance; do not create a fresh client per call
  • Vendor clients should be constructed once during application startup or service initialization and reused rather than instantiated at call sites
  • Manage AsyncClient lifecycle using the application's startup/lifespan mechanism rather than module-level globals
  • Always configure explicit timeouts
  • Use tenacity for retries; do not hand-roll retry loops
  • Retry only transient failures and only idempotent operations by default
  • Validate external payloads into typed schemas before broader app use
  • Map upstream failures into domain-specific integration errors
  • Log and instrument at the integration boundary without leaking secrets
  • Keep auth, base URL, headers, and user agent construction centralized
  • Include the correlation ID header on all outbound requests (see request-correlation skill)
  • Make the integration layer easy to mock in tests
  • Fail clearly on malformed upstream data
  • Source timeout values, retry counts, base URLs, and credentials from application configuration, not hardcoded constants

Read the full file on GitHub · 138 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 138 lines · 57 tokens per session scan A 9a333bc2a7bc

Subscribe to this mod's changes

http-client-integration is a skill published in the GitHub repository robhowley/py-pit-skills (5 stars, last pushed 5mo ago), licensed MIT. It adds 57 tokens to every session and 1,132 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

database

Relational database authority — PostgreSQL, async ORM (SQLAlchemy 2 / asyncpg), Alembic schema migrations, Supabase Python and JS clients, query optimisation, index strategy, connection pooling, transaction patterns, and bulk operations across Python and Node stacks.

LuuOW/meridian-mcp · 54 tokens

fastapi-endpoint

Plan and build production-ready FastAPI endpoints with async SQLAlchemy, Pydantic v2 models, dependency injection for auth, and pytest tests. Uses interview-driven planning to clarify data models, authentication method, pagination strategy, and caching before writing any code.

alirezaebrahimi5/ai-senior-engineer-template · 56 tokens

python

Use when building FastAPI applications, implementing async endpoints, setting up Pydantic schemas, working with SQLAlchemy, or writing pytest tests for Python backend services.

MadAppGang/claude-code · 34 tokens

pytest

Advanced Python unit testing framework for customer support tech enablement, covering FastAPI, SQLAlchemy, PostgreSQL, async operations, mocking, fixtures, parametrization, coverage, and comprehensive testing strategies for backend support systems.

manutej/luxor-claude-marketplace · 44 tokens

FastAPI Testing Patterns

FastAPI application testing with TestClient, dependency injection overrides, async testing, database testing with SQLAlchemy, and OpenAPI validation.

PramodDutta/qaskills · 31 tokens

datamodel-code-generator

Use this skill when the user wants Python data models, Pydantic models, dataclasses, TypedDicts, msgspec structs, or type-safe Python classes generated from OpenAPI, AsyncAPI, JSON Schema, GraphQL, JSON/YAML/CSV sample data, MCP tool schemas, Protocol Buffers, XML Schema, Apache Avro, or existing Python model objects.…

koxudaxi/datamodel-code-generator · 147 tokens