Skip to main content

Text Generation APIs

Access 20+ large language models through Hyperbolic’s OpenAI-compatible chat completions API. Generate text, have conversations, write code, and more with state-of-the-art open-source models.

Chat Completions

The chat completions endpoint is the primary way to interact with text generation models.

Endpoint

Basic Request

Request Parameters

Messages Format

Messages are an array of objects with role and content fields:
Roles:
  • system: Sets the behavior and context for the assistant
  • user: Messages from the user
  • assistant: Previous responses from the model (for conversation history)

Response Format

Multi-turn Conversations

To maintain conversation context, include the full message history in each request:

Streaming Responses

Enable real-time token streaming for responsive chat applications:
For tool calling (function calling) capabilities, see the Tool Calling section below.

System Prompts

Use system prompts to set the model’s behavior, persona, or instructions:

Tool Calling

Tool calling (also known as function calling) allows models to invoke external tools and APIs. The model generates structured JSON arguments that your application can use to call functions, then the results can be passed back to continue the conversation.

Supported Models

The following models support tool calling:
  • meta-llama/Llama-3.3-70B-Instruct
  • Qwen/Qwen3-Coder-480B-A35B-Instruct

Example

The tool_choice parameter controls how the model uses tools: "auto" lets the model decide, "none" disables tool use, or specify a tool name to force its use.

Text Completions (Base Models)

Sunset Notice: Llama 3.1 405B BASE is being discontinued. This model will be removed in a future update. Please plan your migration accordingly.
For raw text completion without chat formatting, use the completions endpoint with base models like Llama 3.1 405B BASE.

Endpoint

Example

Base models are ideal for text completion, fill-in-the-middle tasks, and custom prompting strategies where chat formatting isn’t needed.

Available Models

Instruct Models (Chat Completions)

OpenAI SDK Compatibility

The API is fully compatible with OpenAI’s SDK. Just change the base URL and API key:

Error Handling

Basic tier allows 60 requests/minute. Upgrade to Pro tier (minimum $5 deposit) for 600 requests/minute.

Next Steps

Vision Language Models

Process images with multimodal AI models

Image APIs

Generate images from text prompts

Audio APIs

Text-to-speech and audio generation