Documentation

API Documentation

DevForge exposes a streaming API powered by MiMo V2.5 Pro. All endpoints return Server-Sent Events.

Endpoint

http
POST /api/analyze
Content-Type: application/json

Request Body

json
{
  "type": "audit" | "learn" | "prompts" | "diff" | "rfc" | "playground",
  "input": "your code or text here",
  "options": {
    // optional model parameters
    "temperature": "0.7",
    "max_tokens": "8192"
  }
}

Module Types

audit

Smart contract security audit — severity ratings, PoC, remediation

learn

Code education — walkthrough, concepts, quizzes, practice

prompts

Prompt quality scoring — clarity, specificity, context, structure

diff

Diff analysis — risk score, breaking changes, changelog

rfc

RFC generation — architecture, API design, migration plan

playground

General code analysis — bugs, improvements, explanation

Example

javascript
const res = await fetch("/api/analyze", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    type: "audit",
    input: contractCode,
  }),
});

const reader = res.body.getReader();
const decoder = new TextDecoder();

while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  const text = decoder.decode(value, { stream: true });
  // Parse SSE: each line starts with "data: "
  for (const line of text.split("
")) {
    if (line.startsWith("data: ")) {
      const json = JSON.parse(line.slice(6));
      const content = json.choices?.[0]?.delta?.content;
      if (content) process.stdout.write(content);
    }
  }
}

Response Format

Responses are streamed as Server-Sent Events (SSE). Each event contains a JSON object in OpenAI-compatible format:

json
{
  "choices": [{
    "delta": {
      "content": "chunk of text..."
    }
  }]
}

The stream ends with data: [DONE]

Powered By

Xiaomi MiMo V2.5 Pro

All analysis runs on Xiaomi's MiMo V2.5 Pro model, a 100T parameter reasoning model optimized for code understanding, mathematical reasoning, and technical analysis.