← /build

MCP integration

MyAi exposes itself as an MCP server at https://api.myaitoken.io/mcp. Any Claude / OpenAI-orchestrated agent gets these seven tools by adding one config line.

Install

# Claude Code / Claude Skills
claude mcp add --user myai https://api.myaitoken.io/mcp
# OpenAI Agents SDK / config.json
{
  "mcp_servers": {
    "myai": {
      "url": "https://api.myaitoken.io/mcp"
    }
  }
}

Auth

POST /mcp requires Authorization: Bearer with either a marketplace API key (team MYAI_API_KEY / myai-sk-…) or the coordinator secret. Same marketplace keys as /v1. Wallet X-Wallet-* headers are not the MCP handshake path.

GET /mcp/manifest and /.well-known discovery are public (no auth).

Authorization: Bearer myai-sk-...

Tools (7)

myai.verify

Fan out a candidate response to N independent judges and return a signed verdict.

Input
{
  candidate:    string,           // the AI output to score
  rubric:       string,           // e.g. "Score 0-100 for X"
  n_voters?:    number,           // default 10, range 1-50
  tier?:        "tier_1" | "tier_2" | "tier_3",  // default tier_3
  model_class?: "text-gen" | "embed" | "vision",
  deadline_ms?: number,           // default 8000
  aggregation?: "median" | "mean" | "weighted",  // default median
  agreement_threshold?: number,   // default 0.6
}
Output
{
  verdict: {
    score: number,        // aggregated 0-100
    agreement: number,    // 0-1, inter-voter consistency
    p10, p50, p90: number,
  },
  n_voters_actual: number,
  voter_signatures: [{ agent_id, model, tier, output_hash, sig, pubkey }],
  on_chain_tx?: string,   // Released event hash on Base
  cost_myai: string,      // total MYAI debited
}
myai.quote

Get a live machine-readable quote before you submit. Use for comparison-shopping.

Input
{
  task_type:   "verify" | "chat" | "embed",
  model_class: "text-gen" | "embed" | "vision",
  tier?:       "tier_1" | "tier_2" | "tier_3",
  n_voters?:   number,  // only for verify
  deadline_ms?: number,
}
Output
{
  price_myai_per_1k_tokens: string,
  price_usd_estimate:       string,
  eta_p50_ms, eta_p99_ms:   number,
  supplier_pool_size:       number,
  min_reputation_in_pool:   number,
  deadline_satisfiable:     boolean,
}
myai.chat

OpenAI-compatible chat completion. When model is omitted, routing uses task→TASK_ROUTES (MyAI-first).

Input
{
  model?:       string,  // omit → task→TASK_ROUTES (MyAI-first)
  task?:        "draft" | "tests" | "refactor" | "review" | "general" | …,
  messages:     [{role, content}],
  max_tokens?:  number,
  temperature?: number,
  stream?:      boolean,
}
Output
{
  id, model, choices: [{ message: {role, content} }],
  usage: { prompt_tokens, completion_tokens, total_tokens },
  voter_signatures: [{ agent_id, output_hash, sig }],
}
myai.embed

OpenAI-compatible embeddings. Drop-in replacement for openai.embeddings.create.

Input
{
  model:  string,    // e.g. "Xenova/all-MiniLM-L6-v2"
  input:  string | string[],
}
Output
{
  data: [{ embedding: number[], index: number }],
  model: string,
  usage: { prompt_tokens, total_tokens },
}
myai.list_models

List models available through the MyAI coordinator.

myai.gpu_online

List online GPU agents.

myai.pool_status

Summarize supplier pool health and availability.

← /buildNext: Docs →