hai-api-client

Official

Unified, type-safe HTTP client with token management

Authorhai-series
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Solves the need for a unified, type-safe HTTP client across web and mobile apps by providing a singleton api object, automatic token handling, and contract-driven calls.

Core Features & Use Cases

  • Unified API access across platforms via api.init and api.call with EndpointDef contracts.
  • Automatic Bearer token management, including storage, attachment, and refresh retries.
  • Streaming support (SSE / ReadableStream) and strong runtime validation with Zod.

Quick Start

Initialize the client at app startup with baseUrl and auth settings, then perform authenticated requests using api.call with a typed EndpointDef.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: hai-api-client
Download link: https://github.com/hai-series/hai-framework/archive/main.zip#hai-api-client

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.