Integrations
Hyperbolic’s OpenAI-compatible API makes it easy to integrate with your existing tools and frameworks. Simply change the base URL and API key to start using Hyperbolic models with your favorite libraries.
OpenAI SDK
The fastest way to integrate with Hyperbolic. Just change base_url and api_key.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_HYPERBOLIC_API_KEY",
base_url="https://api.hyperbolic.xyz/v1"
)
response = client.chat.completions.create(
model="meta-llama/Llama-3.3-70B-Instruct",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.HYPERBOLIC_API_KEY,
baseURL: 'https://api.hyperbolic.xyz/v1'
});
const response = await client.chat.completions.create({
model: 'meta-llama/Llama-3.3-70B-Instruct',
messages: [
{ role: 'user', content: 'Hello!' }
]
});
console.log(response.choices[0].message.content);
Installation
LangChain
Build AI applications, chains, and agents with LangChain.
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
openai_api_key="YOUR_HYPERBOLIC_API_KEY",
openai_api_base="https://api.hyperbolic.xyz/v1",
model_name="meta-llama/Llama-3.3-70B-Instruct"
)
response = llm.invoke("What is the capital of France?")
print(response.content)
Installation
pip install langchain langchain-openai
LlamaIndex
Build RAG applications and knowledge-augmented AI with LlamaIndex.
from llama_index.llms.openai_like import OpenAILike
llm = OpenAILike(
api_key="YOUR_HYPERBOLIC_API_KEY",
api_base="https://api.hyperbolic.xyz/v1",
model="meta-llama/Llama-3.3-70B-Instruct"
)
response = llm.complete("Explain quantum computing in simple terms")
print(response.text)
Installation
pip install llama-index llama-index-llms-openai-like
Hugging Face
Access Hyperbolic models through the Hugging Face ecosystem.
from huggingface_hub import InferenceClient
client = InferenceClient(
provider="hyperbolic",
api_key="YOUR_HYPERBOLIC_API_KEY"
)
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-R1",
messages=[
{"role": "user", "content": "What is the capital of France?"}
],
max_tokens=500
)
print(response.choices[0].message.content)
Authentication Options
| Method | API Key | Billing |
|---|
| Direct | Hyperbolic API key | Billed to Hyperbolic account |
| Routed | Hugging Face token | Billed to Hugging Face account |
Installation
pip install huggingface_hub>=0.29.0
Gradio
Build interactive ML demos with Gradio.
import gradio as gr
from openai import OpenAI
client = OpenAI(
api_key="YOUR_HYPERBOLIC_API_KEY",
base_url="https://api.hyperbolic.xyz/v1"
)
def chat(message, history):
response = client.chat.completions.create(
model="meta-llama/Llama-3.3-70B-Instruct",
messages=[{"role": "user", "content": message}]
)
return response.choices[0].message.content
demo = gr.ChatInterface(chat)
demo.launch()
Installation
pip install gradio openai
Other Compatible Frameworks
Hyperbolic’s OpenAI-compatible API works with any framework that supports the OpenAI API format:
- AutoGen - Multi-agent conversations
- CrewAI - AI agent orchestration
- Semantic Kernel - Microsoft’s AI orchestration SDK
- Haystack - NLP pipelines and RAG
- DSPy - Programming with language models
To use any OpenAI-compatible framework with Hyperbolic, set the base URL to https://api.hyperbolic.xyz/v1 and use your Hyperbolic API key.
Next Steps