TradeMarketsCreditsSearch
Medusa Logo
Medusa
  • Trade
  • Markets
  • Launchpad
  • AI Credits
  • AnalyticsDocumentationAPI Reference
/
1.00Credits
Elysium
QuickstartAPI Reference
/OpenAI Compatible
Claim API Key

Build AI Agents on Elysium in Under 2 Minutes

Medusa is a 100% OpenAI-compatible AI inference platform. Powered by Elysium DEX Trade-to-Compute credits: swap tokens to earn free compute, or claim your developer key with zero credit card required.

100% OpenAI API
Zero custom SDK lock-in
DeepSeek R1 & Claude
Top reasoning LLMs
Trade-to-Compute
DEX volume funds AI
Autonomous Agents
Native MCP & Cursor support
Connect the way you build

Your first call starts here.

Choose your interface. Connect through MCP, use the key from your API key dashboard, build with the SDK, or let an autonomous agent sign its own key with its Web3 wallet. Paid calls use your available Trade-to-Compute CREDIT balance.

Get an API keyBrowse models & tools

Connect your AI client.

Choose your client to add Medusa’s models and DeFi tools through Model Context Protocol (MCP).

Install the Medusa MCP endpoint, then start Claude Code:

claude mcp add medusa https://medusa.finance/api/mcp

Open /mcp in Claude Code → Medusa → Authenticate. Exposes medusa_get_quote, medusa_get_bonding_curve, and medusa_get_price automatically.

1

Get Your Medusa API Key

Every connected Elysium wallet automatically receives a 1.0 free trial AI credit to make inference calls immediately. Keys start with the prefix mdsa_live_.

Web3 Wallet Status
Wallet not connected - connect MetaMask, Rabby, or Phantom to claim free credits.
Generate Key in Dashboard
Prefer the CLI? You can also generate keys programmatically:
curl -X POST http://localhost:3000/api/ai/keys \
  -H "Content-Type: application/json" \
  -d '{"walletAddress": "0xYourWalletAddress...", "name": "Agent Key"}'
2

Configure Environment Variables

Because Medusa adopts the standard OpenAI v1 specification, you simply route your SDK’s baseURL to the Medusa API gateway.

.env.local
# Medusa 100% OpenAI-Compatible Endpoint
OPENAI_BASE_URL="http://localhost:3000/api/ai/v1"
OPENAI_API_KEY="mdsa_live_your_key_here"

# Optional default model (DeepSeek R1, Claude, or Llama)
DEFAULT_MODEL="deepseek/deepseek-r1"
3

Install the Official OpenAI SDK

No proprietary packages needed. Use the standard OpenAI libraries for TypeScript, Python, or raw HTTP.

pnpm add openai
4

Build Your Application (Ready-to-Run Examples)

Choose a starter pattern below to see how to run reasoning completions, streaming chat, and agent tool calling.

chat-completion.ts
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "http://localhost:3000/api/ai/v1",
  apiKey: process.env.OPENAI_API_KEY, // mdsa_live_...
});

async function main() {
  const response = await client.chat.completions.create({
    model: "deepseek/deepseek-r1",
    messages: [
      { role: "system", content: "You are an on-chain quantitative analyst on Elysium." },
      { role: "user", content: "Evaluate the fair-launch liquidity metrics for BLOB token." },
    ],
  });

  console.log(response.choices[0].message.content);
}

main();

Next Steps & Deep Dive

Full API Reference

Inspect JSON schemas, MCP server manifests, status codes, and model rate cards across all endpoints.

Credits & Key Management

Monitor your compute consumption ledger, track trade rebates, and create scoped API keys for autonomous bots.