Quick Start

Get up and running with LLM Hub in under 5 minutes. This guide will walk you through creating your first AI-powered request.

Prerequisites

LLM Hub Account

Sign up at api.llmhub.one to get your API key. New accounts receive €1 in free credits.

Development Environment

Node.js 18+, Python 3.8+, Go 1.21+, or any HTTP client like cURL.

1

Get Your API Key

  1. Go to api.llmhub.one/dashboard/api-keys
  2. Click "Create New API Key"
  3. Give your key a descriptive name (e.g., "Development")
  4. Copy the key and store it securely — you won't see it again!

Security tip: Never commit API keys to version control. Use environment variables instead.

2

Install the SDK

LLM Hub is fully compatible with the official OpenAI SDKs. Just install the OpenAI package for your language:

Bash
npm install openai
3

Set Environment Variables

Store your API key in an environment variable:

Linux / macOS

Bash
export LLMHUB_API_KEY="your-api-key-here"

Windows (PowerShell)

powershell
$env:LLMHUB_API_KEY = "your-api-key-here"

.env file (recommended)

Bash
LLMHUB_API_KEY=your-api-key-here
4

Make Your First Request

Create a file with the following code and run it. The key difference from OpenAI is setting the baseURL to https://api.llmhub.one/v1.

TypeScript
import OpenAI from 'openai';
import type { ChatCompletionMessageParam } from 'openai/resources';

const client = new OpenAI({
  baseURL: 'https://api.llmhub.one/v1',
  apiKey: process.env.LLMHUB_API_KEY!
});

async function main(): Promise<void> {
  const messages: ChatCompletionMessageParam[] = [
    { role: 'system', content: 'You are a helpful assistant.' },
    { role: 'user', content: 'Hello! What can you help me with?' }
  ];

  const response = await client.chat.completions.create({
    model: 'gpt-4o',
    messages
  });

  console.log(response.choices[0].message.content);
}

main();

Expected Output

If everything is set up correctly, you should see a response like:

Hello! I'm here to help you with a wide range of tasks. I can assist with:

• Answering questions and providing information
• Writing and editing text
• Coding and debugging
• Creative projects and brainstorming
• And much more!

What would you like help with today?

Next Steps