DevForge exposes a streaming API powered by MiMo V2.5 Pro. All endpoints return Server-Sent Events.
POST /api/analyze Content-Type: application/json
{
"type": "audit" | "learn" | "prompts" | "diff" | "rfc" | "playground",
"input": "your code or text here",
"options": {
// optional model parameters
"temperature": "0.7",
"max_tokens": "8192"
}
}auditSmart contract security audit — severity ratings, PoC, remediation
learnCode education — walkthrough, concepts, quizzes, practice
promptsPrompt quality scoring — clarity, specificity, context, structure
diffDiff analysis — risk score, breaking changes, changelog
rfcRFC generation — architecture, API design, migration plan
playgroundGeneral code analysis — bugs, improvements, explanation
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);
}
}
}Responses are streamed as Server-Sent Events (SSE). Each event contains a JSON object in OpenAI-compatible format:
{
"choices": [{
"delta": {
"content": "chunk of text..."
}
}]
}The stream ends with data: [DONE]