API Documentation

MORDIEM exposes a full OpenAI-compatible API — chat, embeddings, images, audio, and video. Point any OpenAI-compatible client at https://api.mordiem.com/api/v1 with your MORDIEM API key and you’re good to go.

Requests are routed across upstream providers automatically; endpoint request/response schemas follow the upstream API reference for every model on the exchange.

Quick Start

# Chat completions
curl https://api.mordiem.com/api/v1/chat/completions \
  -H "Authorization: Bearer mr_sk_..." \
  -H "Content-Type: application/json" \
  -d '{"model":"llama-3.3-70b","messages":[{"role":"user","content":"Hello!"}]}'

Authentication

Mordiem uses two types of API keys, both passed as Bearer tokens in the Authorization header. Generate keys on the API Keys page.

Key TypePrefixPurpose
Compute API Keymr_sk_...Inference requests (/api/v1/chat/completions, etc.)
Account Admin Keymr_ak_...Account management (/api/v1/account/*)

Keys are shown once at creation; store them securely. Admin keys cannot be used for inference and Compute keys cannot access account management endpoints.

Base URL

EnvironmentBase URL
Web dashboardhttps://mordiem.com
API (programmatic)https://api.mordiem.com/api/v1

Mordiem-Specific Endpoints

These endpoints are unique to Mordiem and not part of the Venice API.

GET/api/v1/models

Returns all active models on the Morpheus marketplace with Mordiem-specific pricing fields.

Response includes standard OpenAI model fields plus:

FieldTypeDescription
morpheus_model_idstringOn-chain Morpheus model identifier (bytes32)
mor_wei_per_tokenstringPrice per token in MOR wei (uint256 decimal string)

Venice Pass-Through Endpoints

All /api/v1/* paths are forwarded directly to Venice with identical request/response schemas. Mordiem transparently:

  • Swaps your API key for an eligible Venice key
  • Opens a Morpheus compute session on first use per model
  • Meters token usage against your daily MOR credits
  • Streams SSE responses through unchanged

Supported endpoint families:

POST/api/v1/chat/completions

Generate chat completions. Supports streaming, multimodal inputs (text, images, audio, video, files), and reasoning models. Metered by input + output tokens.

Venice docs: Chat Completions

POST/api/v1/image/generate

Generate images from text prompts. Supports multiple models, style presets, aspect ratios, and resolution tiers. Also available via the OpenAI-compatible /api/v1/images/generations endpoint.

Venice docs: Image Generation

POST/api/v1/embeddings

Generate vector embeddings for text inputs. Metered by total tokens.

Venice docs: Embeddings

ANY/api/v1/*

All other Venice endpoints (audio, files, fine-tuning, etc.) are forwarded through. Endpoints without token-based pricing in the Morpheus registry are passed through without metering.

Full Venice API reference: docs.venice.ai/api-reference


Account Admin API

These endpoints are authenticated with an Account Admin Key (prefix mr_ak_...). Admin keys grant access to account management but cannot be used for inference. Generate admin keys on the API Keys page.

GET/api/v1/account

Returns a summary of your account: seller earnings, staking rewards, DIEM/MOR balances, compute key count, and daily credit status.

FieldDescription
sellerEarningsTotal and today's MOR earned from selling compute
stakingRewardsAccrued staking rewards balance and rate
stakedDiemCurrent staked DIEM balance
stakedMorMDM capital MOR principal used for compute allocation. ledgerWei is leftover custodial stake still counted for credit until migrated.
computeApiKeysNumber of active Compute API keys
creditsDaily MOR credit allowance, used today, remaining, and refresh time

GET/api/v1/account/usage

Today's API usage breakdown by Compute API key and by model.

FieldDescription
byKey[]Calls, tokens, MOR charged per Compute API key
byModel[]Calls, tokens, MOR charged per model

GET/api/v1/account/keys

List all active (non-revoked) Compute API keys.


POST/api/v1/account/keys

Create a new Compute API key. The plaintext key is returned once in the response.

BodyTypeDescription
labelstring (optional)Human-readable label for the key

PATCH/api/v1/account/keys/:id

Pause, resume, or revoke a Compute API key.

BodyTypeDescription
action"pause" | "resume" | "revoke"Action to perform on the key

DELETE/api/v1/account/keys/:id

Permanently revoke a Compute API key (same as PATCH with action "revoke").


Metering & Daily Credits

API usage is metered against your daily MOR credits, calculated from MOR you deposited as MDM capital (plus any leftover ledger still pending migration). Credits refresh every day at midnight UTC. Staked MOR is never reduced by API usage. Deposit from Buy Inference or Sell Compute— the legacy treasury and builders subnets are closed.

Endpoint FamilyHow Metered
/chat/completions(input_tokens × input_price) + (output_tokens × output_price)
/embeddingstotal_tokens × mor_per_token
/image/generate, /images/*Per image at model-specific rate
Everything elseForwarded without charge

Check your daily credit allowance, usage, and remaining credits on the Usage page.


Client Libraries

Since Mordiem is fully OpenAI-compatible, you can use any existing client library by changing the base URL:

Python (openai)

from openai import OpenAI

client = OpenAI(
    api_key="mr_sk_...",
    base_url="https://api.mordiem.com/api/v1",
)

response = client.chat.completions.create(
    model="llama-3.3-70b",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)

JavaScript / TypeScript (openai)

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "mr_sk_...",
  baseURL: "https://api.mordiem.com/api/v1",
});

const res = await client.chat.completions.create({
  model: "llama-3.3-70b",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(res.choices[0].message.content);

cURL

curl https://api.mordiem.com/api/v1/chat/completions \
  -H "Authorization: Bearer mr_sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "model": "llama-3.3-70b", "messages": [{"role": "user", "content": "Hello!"}], "stream": true }'

Errors

StatusMeaning
401Invalid or missing API key
429Daily credits exhausted — deposit more MOR or wait until midnight UTC
4xx / 5xxUpstream Venice error (passed through as-is)

Mordiem mirrors the full Venice API. For detailed request/response schemas and model capabilities, see the Venice API Reference.