Skip to main content
OpenAPI TypeScript supports multiple HTTP clients to match your project’s needs and framework requirements. Each client provides type-safe API calls with full TypeScript support.

Available Clients

Fetch

Native browser Fetch API client. Zero dependencies, works everywhere.

Axios

Popular HTTP client with request/response interceptors and advanced features.

Angular

Native Angular HttpClient integration with dependency injection support.

Ky

Tiny, elegant HTTP client built on the Fetch API with retry support.

Next.js

Optimized for Next.js with server components and caching support.

Nuxt

Native Nuxt integration with composables and SSR support.

ofetch

Universal fetch wrapper with advanced features and interceptors.

Custom

Build your own client adapter for any HTTP library.

Quick Comparison

Common Features

All clients share these core capabilities:

Type Safety

Configuration

All clients support a common configuration interface:

Authentication

Built-in support for API key and HTTP authentication:

Request/Response Interceptors

Most clients support interceptors for request and response transformation:

Server-Sent Events (SSE)

All clients support SSE for real-time data streaming:

Response Styles

Most clients support two response styles:

Fields Style (Default)

Returns an object with data, error, request, and response fields:

Data Style

Returns only the data (or undefined on error):

Error Handling

Two approaches to error handling:

Check error field (default)

Throw errors

Choosing a Client

1

Consider your framework

If you’re using Angular, use @hey-api/client-angular. For Next.js, use @hey-api/client-next. For Nuxt, use @hey-api/client-nuxt.
2

Evaluate dependencies

If you want zero dependencies, use @hey-api/client-fetch. If you already use Axios, use @hey-api/client-axios.
3

Check feature requirements

Need retry logic? Use @hey-api/client-ky. Need advanced Node.js features? Use @hey-api/client-ofetch.
4

Start simple

When in doubt, start with @hey-api/client-fetch. It’s the default and works everywhere.

Next Steps

Get Started

Start with the Fetch client

Configuration

Learn about client configuration

Authentication

Set up API authentication

Interceptors

Add request/response interceptors