Developer quickstart

Take your first steps with the Hyperfold API.

The Hyperfold API provides a simple interface to state-of-the-art AI models for text generation, natural language processing, computer vision, and more. Get started by creating an API key and running your first API call. Discover how to generate text, analyze images, build agents, and more.

Create and export an API key

Before you begin, create an API key in the dashboard, which you'll use to securely access the API. Store the key in a safe location, like a .zshrc file or another text file on your computer. Once you've generated an API key, export it as an environment variable in your terminal.

export HYPERFOLD_API_KEY="your-api-key-here"

Hyperfold SDKs are configured to automatically read your API key from the system environment.

Install the Hyperfold SDK and Run an API Call

1
npm install hyperfold

To use the Hyperfold API in server-side JavaScript/TypeScript environments like Node.js, Deno, or Bun, you can use the official Hyperfold SDK for TypeScript and JavaScript. Get started by installing the SDK using your preferred package manager.

With the Hyperfold SDK installed, create a file called example.js and copy the example code into it.

Run a basic API request

1
2
3
4
5
6
7
8
9
10
import Hyperfold from "hyperfold";
const client = new Hyperfold();
const response = await client.responses.create({
model: "hf-2.0",
input: "Write a haiku about recursion in programming.",
});
console.log(response.output_text);

Execute the code with node example.js (or the equivalent command for Deno or Bun). In a few moments, you should see the output of your API request.

Learn more on GitHub

Explore more SDK features and options on the library's GitHub README.

Responses multi-turn

Start building with the Responses API.

Text generation and prompting

Learn prompting strategies, managing tokens, and building conversational apps.

Add credits to keep building

Congrats on running a free test API request! Start building real applications with higher limits and our complete models by purchasing text, audio, image, video and more.

Access dashboard features designed to help you ship faster:

Chat Playground

Rapidly test conversational prompts and embed them in your app.

Agent Builder

Build and customize reusable agent workflows.

Analyze images and files

Send image URLs, uploaded files, or PDF documents directly to the model to extract text, classify content, or detect visual elements.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import Hyperfold from "hyperfold";
const client = new Hyperfold();
const response = await client.responses.create({
model: "hf-2.0",
input: [
{ type: "text", text: "What's in this image?" },
{
type: "image_url",
image_url: { url: "https://example.com/image.jpg" }
}
],
});
console.log(response.output_text);

Build agents

Create intelligent agents that can use tools, maintain context, and complete complex tasks. Learn more in our agents documentation.