One SDK. Any API. Fully typed.
The type-safe API layer for TypeScript apps. Connect to REST, GraphQL, Firebase, WebSockets, SSE — all with one consistent interface and the best type safety in the ecosystem.
Documentation | Quick Start | Guides
import { createClient } from "@hyper-fetch/core";
// Create a client — this is the single entry point for all your API calls
const client = createClient({ url: "https://api.example.com" });
// Define a typed request — response shape is inferred everywhere from here
const getUsers = client.createRequest<{ response: { id: number; name: string }[] }>()({
endpoint: "/users",
method: "GET",
});
// Send it — data, error, and status are fully typed
const { data, error, status } = await getUsers.send();
npx @hyper-fetch/cli generate --url https://api.example.com/openapi.json
import { sdk } from "./generated";
// Every endpoint from your schema is available as a typed method
const { data } = await sdk.users.list.send();
any<a href="https://github.com/sponsors/prc5?tier=Platinum">
<img width="830" src="https://raw.githubusercontent.com/prc5/sponsors/main/assets/Platinum.png" alt="Platinum sponsor banner"/>
</a>
<a href="https://github.com/sponsors/prc5?tier=Platinum">
<img width="830" src="https://raw.githubusercontent.com/prc5/sponsors/main/packages/platinum/sponsorkit/sponsors.svg" alt="Platinum sponsors"/>
</a>
<a href="https://github.com/sponsors/prc5?tier=Gold">
<img width="830" src="https://raw.githubusercontent.com/prc5/sponsors/main/assets/Gold.png" alt="Gold sponsor banner"/>
</a>
<a href="https://github.com/sponsors/prc5?tier=Gold">
<img width="830" src="https://raw.githubusercontent.com/prc5/sponsors/main/packages/gold/sponsorkit/sponsors.svg" alt="Gold sponsors"/>
</a>
// Send and destructure — all return values are typed
const { data, error, status } = await getUsers.send();
// Params go in the URL, data goes in the body — both fully typed
const { data, error, status } = await createUser.send({
params: { teamId: 1 },
data: { name: "Jane", email: "jane@example.com" },
});
import { useFetch } from "@hyper-fetch/react";
const UserList = () => {
// useFetch triggers the request on mount and returns typed state
const { data, loading, error } = useFetch(getUsers);
if (loading) return
Loading...
;
if (error) return
Error loading users
;
return <ul>{data?.map((u) => <li key={u.id}>{u.name}</li>)}</ul>;
};
<img width="830" src="https://raw.githubusercontent.com/prc5/sponsors/main/assets/Silver.png" alt="Silver sponsor banner"/>
<img width="830" src="https://raw.githubusercontent.com/prc5/sponsors/main/packages/silver/sponsorkit/sponsors.svg" alt="Silver sponsors"/>
<a href="https://github.com/sponsors/prc5">
<img src="https://raw.githubusercontent.com/prc5/sponsors/main/packages/other/sponsorkit/sponsors.svg?raw=true" alt="Sponsors" />
</a>
$ claude mcp add hyper-fetch \
-- python -m otcore.mcp_server <graph>