Quickstart
Hypnex is a community-built developer toolkit for the Morpheus AI inference network. Pick the SDK that matches what you're building.
I want to call Morpheus inference from my code
bash
pip install hypnex-openai
# or
npm install hypnex-openaipython
from hypnex_openai import HypnexOpenAI
client = HypnexOpenAI(api_key="mor_...") # get a key at https://app.mor.org
r = client.chat.completions.create(
model="mistral-31-24b",
messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)ts
import { HypnexOpenAI } from "hypnex-openai";
const client = new HypnexOpenAI({ apiKey: "mor_..." });
const r = await client.chat.completions.create({
model: "mistral-31-24b",
messages: [{ role: "user", content: "Hello" }],
});
console.log(r.choices[0].message.content);I want to stake into the Morpheus capital pool
bash
pip install hypnex-staking
# or
npm install hypnex-stakingThe friendly path: stake.hypnex.xyz. One signature, no email, MRC 73 referrer auto-filled.
The library path:
python
from hypnex_staking import StakingClient
c = StakingClient(private_key="0x...") # or wagmi/walletconnect on the frontend
c.stake(asset="USDC", amount_usd=100, lock_days=180, referrer="0x22B5...57D8")I want to register an agent on Morpheus
bash
pip install hypnex-registry
# or
npm install hypnex-registrypython
from hypnex_registry import Registry
r = Registry(chain="arbitrum") # or "base"
agent_id = r.register(
namespace="hypnex",
name="summarizer",
metadata_uri="ipfs://Qm...",
capabilities=["chat"],
price_per_call_wei=10**15,
model_id="glm-5",
)I want to benchmark Morpheus models
bash
pip install hypnex-bench
hypnex-bench models
hypnex-bench run --model mistral-31-24b --limit 10Drop-in compatibility
Any framework that accepts a base_url accepts the Morpheus inference API.
| Framework | Swap |
|---|---|
| LangChain (Python) | ChatOpenAI(base_url="https://api.mor.org/api/v1", api_key=...) |
| LangChain.js | new ChatOpenAI({ configuration: { baseURL: "https://api.mor.org/api/v1" } }) |
| CrewAI | LLM(model="openai/<morpheus-model>", base_url=..., api_key=...) |
| llama-index | OpenAILike(api_base=..., is_chat_model=True) |
| AutoGen | config_list = [{ "base_url": ..., "api_key": ... }] |
| Vercel AI SDK | createOpenAI({ baseURL: ..., apiKey: ... }) |
| dspy | dspy.OpenAI(api_base=..., api_key=...) |
| instructor | instructor.from_openai(HypnexOpenAI()) |
| Cursor / Cline / Aider | set HYPNEX_API_KEY and use the base URL above |