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
- Python
- cURL
Request Parameters
Messages Format
Messages are an array of objects withrole and content fields:
system: Sets the behavior and context for the assistantuser: Messages from the userassistant: 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:- Python
- cURL
Streaming Responses
Enable real-time token streaming for responsive chat applications:- Python
- cURL
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-InstructQwen/Qwen3-Coder-480B-A35B-Instruct
Example
- Python
- cURL
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)
For raw text completion without chat formatting, use the completions endpoint with base models like Llama 3.1 405B BASE.Endpoint
Example
- Python
- cURL
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:- Python
- Node.js
Error Handling
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

