Three names keep coming up when developers talk about AI models for Python projects: Hyperbolic (a fast, low-cost host for open-source models), Claude (Anthropic's model family) and Cursor (the AI code editor with its own Composer models). They look similar from the outside, but they work in different ways. This guide explains what each one is, when to use it, and how to call it from Python.
Quick Comparison
| Feature | Hyperbolic | Claude | Cursor |
|---|---|---|---|
| What it is | Serverless hosting for open-source models | Anthropic's own model family | AI code editor with its own agent and Composer model |
| Main models | DeepSeek V3, DeepSeek R1 and other open models | Claude Opus, Sonnet and Haiku | Composer 2.5 (plus other models inside the editor) |
| Python package | openai (change the base URL) | anthropic | cursor-sdk (public beta) |
| Type of API | Chat completions (OpenAI-compatible) | Messages API | Agent SDK (runs coding agents) |
| Best for | Cheap, flexible open-model inference | Reasoning, writing, long documents, coding, tool use | Automating coding tasks on a codebase |
1. Hyperbolic with Python
What it is
Hyperbolic provides serverless access to open-source models through simple APIs, with no GPU management or setup. Its API is OpenAI-compatible, so you can use the standard openai Python library and only change the base_url and API key. It is popular because pay-as-you-go pricing is often lower than big cloud providers, and you can switch between open models such as DeepSeek V3 (fast and efficient) and DeepSeek R1 (a reasoning model).
Setup
pip install openai
export HYPERBOLIC_API_KEY="your-key-here"
Example: basic chat
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["HYPERBOLIC_API_KEY"],
base_url="https://api.hyperbolic.xyz/v1",
)
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V3",
messages=[
{"role": "user", "content": "Explain Python decorators in simple words."}
],
max_tokens=500,
temperature=0.7,
)
print(response.choices[0].message.content)
Example: streaming
stream = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V3",
messages=[{"role": "user", "content": "Write a REST API in Python"}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
https://api.hyperbolic.xyz/v1.2. Claude with Python
What it is
Claude is Anthropic's family of AI models, available as Opus (most capable), Sonnet (balanced) and Haiku (fast and light). You call it through the official anthropic Python SDK and the Messages API. Claude is strong at careful reasoning, long documents, writing, coding, and tool use (letting the model call your own Python functions).
Setup
pip install anthropic
export ANTHROPIC_API_KEY="your-key-here"
Example: basic message
import anthropic
client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY automatically
message = client.messages.create(
model="claude-sonnet-5-5",
max_tokens=1024,
system="You are a helpful senior Python engineer.",
messages=[
{"role": "user", "content": "What is the difference between a list and a tuple?"}
],
)
print(message.content[0].text)
Example: multi-turn conversation
The API is stateless, so you keep the history yourself and send it every time.
history = [{"role": "user", "content": "Give me a Python tip."}]
reply = client.messages.create(
model="claude-sonnet-5-5", max_tokens=500, messages=history
)
history.append({"role": "assistant", "content": reply.content[0].text})
history.append({"role": "user", "content": "Show me an example of that."})
reply = client.messages.create(
model="claude-sonnet-5-5", max_tokens=500, messages=history
)
print(reply.content[0].text)
Example: streaming
with client.messages.stream(
model="claude-sonnet-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Write a haiku about APIs."}],
) as stream:
for text in stream.text_stream:
print(text, end="", flush=True)
max_tokens is required in every Claude request. Use the Haiku model for quick, cheap tasks and Opus for the hardest problems.3. Cursor with Python
What it is
Cursor is best known as an AI code editor, but it also lets you script its coding agent from your own Python code through the cursor-sdk package, currently in public beta and requiring Python 3.10 or later. The agent is powered by Cursor's own Composer model (Composer 2.5 at the time of writing), the same agent that runs in the Cursor editor, CLI and web app. You can run it locally against your files or in Cursor-hosted cloud VMs with your repo cloned in.
Setup
pip install cursor-sdk
# Create an API key in the Cursor Dashboard, under API Keys
Example: create a local agent
from cursor_sdk import Agent, LocalAgentOptions
agent = Agent.create(
model="composer-2.5",
local=LocalAgentOptions(cwd="."), # work on files in this folder
)
# Then send your task to the agent and read its streamed output.
# The exact run/send methods are in the official docs:
# https://cursor.com/docs/sdk/python
Example: list models and pick parameters
from cursor_sdk import Cursor, ModelSelection, ModelParameterValue
# See which models and options your account supports
for m in Cursor.models.list():
print(m.id, m.parameters)
selection = ModelSelection(
id="composer-2.5",
params=[ModelParameterValue(id="fast", value="true")],
)
Which One Should You Choose?
- Choose Hyperbolic when you want low-cost access to open-source models and an API that works with existing OpenAI-style code.
- Choose Claude when you need strong reasoning, long-context work, polished writing, reliable coding help or tool use in your own app.
- Choose Cursor when you want an AI agent that edits real codebases, in the editor or automated from Python scripts and CI pipelines.
They also combine well: for example, use Cursor to write and maintain your project, call Claude for the hard reasoning steps, and use Hyperbolic for cheap bulk tasks.
Security Best Practices
- Never hard-code API keys. Use environment variables or a
.envfile (withpython-dotenv). - Add
.envto your.gitignore. - Handle errors and rate limits with
try/exceptand retries. - Watch your token usage so costs stay predictable.
Conclusion
Hyperbolic, Claude and Cursor solve different problems: open-model hosting, a general-purpose frontier model, and a coding agent. Pick the one that matches your task, install the matching Python package, and you can be running your first request in a few minutes.
Official docs: Hyperbolic | Claude API | Cursor Python SDK

0 Comments