Skip to content

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-openai
python
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);

More on hypnex-openai →

I want to stake into the Morpheus capital pool

bash
pip install hypnex-staking
# or
npm install hypnex-staking

The 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")

More on hypnex-staking →

I want to register an agent on Morpheus

bash
pip install hypnex-registry
# or
npm install hypnex-registry
python
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",
)

More on hypnex-registry →

I want to benchmark Morpheus models

bash
pip install hypnex-bench
hypnex-bench models
hypnex-bench run --model mistral-31-24b --limit 10

More on hypnex-bench →

Drop-in compatibility

Any framework that accepts a base_url accepts the Morpheus inference API.

FrameworkSwap
LangChain (Python)ChatOpenAI(base_url="https://api.mor.org/api/v1", api_key=...)
LangChain.jsnew ChatOpenAI({ configuration: { baseURL: "https://api.mor.org/api/v1" } })
CrewAILLM(model="openai/<morpheus-model>", base_url=..., api_key=...)
llama-indexOpenAILike(api_base=..., is_chat_model=True)
AutoGenconfig_list = [{ "base_url": ..., "api_key": ... }]
Vercel AI SDKcreateOpenAI({ baseURL: ..., apiKey: ... })
dspydspy.OpenAI(api_base=..., api_key=...)
instructorinstructor.from_openai(HypnexOpenAI())
Cursor / Cline / Aiderset HYPNEX_API_KEY and use the base URL above

Released under the MIT License.