hypnex-openai
v0.1.1
Published
Drop-in OpenAI client for the Morpheus decentralized inference network (mor.org)
Maintainers
Readme
hypnex-openai (TypeScript)
Drop-in OpenAI client for the Morpheus decentralized inference network (mor.org).
npm install hypnex-openai
# or pnpm add hypnex-openai
# or yarn add hypnex-openaiAffiliation & monetization
This SDK is published by Hypnex Labs. It is a thin OpenAI-compatible client; calls go directly to api.mor.org and are billed by Morpheus AI to the API-key holder. This SDK does not currently route fees to Hypnex Labs. Hypnex's revenue comes from the sister SDK hypnex-staking (MRC 73 capital referral) and the stake.hypnex.xyz onramp. Hypnex is not affiliated with the Morpheus AI Foundation.
import { HypnexOpenAI } from "hypnex-openai";
const client = new HypnexOpenAI({ apiKey: "mor_..." }); // get one at https://app.mor.org
const r = await client.chat.completions.create({
model: "mistral-31-24b",
messages: [{ role: "user", content: "Hello" }],
});
console.log(r.choices[0].message.content);HypnexOpenAI extends OpenAI from the openai npm package and points it at https://api.mor.org/api/v1. Streaming, tools, async, structured output — all work unchanged.
Models
The Morpheus network exposes 60+ models. List them programmatically:
await client.morpheus.activeModels(); // full registry
await client.morpheus.modelsByType("LLM"); // filter
await client.morpheus.findModel("glm-5"); // lookupFeatured LLMs: mistral-31-24b, glm-5, qwen3-235b, qwen3-coder-480b-a35b-instruct, deepseek-r1:70b, minimax-m25. Embeddings: text-embedding-bge-m3. TTS: tts-kokoro. STT: whisper-1.
Drop-in for popular frameworks
Any framework that takes a baseURL accepts Morpheus.
// Vercel AI SDK
import { createOpenAI } from "@ai-sdk/openai";
const morpheus = createOpenAI({
apiKey: process.env.HYPNEX_API_KEY,
baseURL: "https://api.mor.org/api/v1",
});
// then: morpheus("qwen3-235b")
// LangChain.js
import { ChatOpenAI } from "@langchain/openai";
const llm = new ChatOpenAI({
modelName: "qwen3-235b",
apiKey: process.env.HYPNEX_API_KEY,
configuration: { baseURL: "https://api.mor.org/api/v1" },
});Cursor, Cline, Aider, Continue — same pattern (baseURL + apiKey).
Morpheus-specific endpoints
client.morpheus.* exposes endpoints with no OpenAI equivalent:
| Method | Description |
|---|---|
| balance() | Current MOR balance |
| transactions(limit) | Billing history |
| spending() | Cumulative usage |
| me() | User profile |
| listKeys() / createKey(name) / deleteKey(id) / setDefaultKey(id) | API keys |
| linkWallet(addr, sig, msg) / getWallet() / unlinkWallet() | Wallet binding |
| activeModels() / findModel(name) / modelsByType(type) | Public registry |
Environment
HYPNEX_API_KEY— your API key (required)HYPNEX_BASE_URL— override base URL (defaulthttps://api.mor.org/api/v1)
Tests
npm install
npm test # public smoke tests
HYPNEX_API_KEY=mor_... npm test # also run authenticated testsLicense
MIT
