GitBlock API Documentation
Free AI inference powered by Xiaomi MiMo. OpenAI-compatible API — drop in and start building.
Plug & Play Setup
Get from zero to AI-powered in under 3 minutes. No credit card needed.
Create a free MiMo account
Go to platform.xiaomimimo.com and sign up. You'll get free credits instantly — no credit card required.
Generate an API key
In the MiMo Console, navigate to API Keys and create a new key. Copy it — you'll need it in the next step.
# It will be a long string like:
sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Start building
Use the Playground (paste your key in Settings) or make API calls directly. That's it — you're live!
The API is fully OpenAI-compatible. If you've used OpenAI, Anthropic, or any OpenAI-compatible provider before, you already know how to use GitBlock — just change the base URL and API key.
Your first API call (copy & paste)
curl -X POST https://api.xiaomimimo.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_MIMO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mimo-v2.5-pro",
"messages": [{"role": "user", "content": "Hello! What can you do?"}]
}'
from openai import OpenAI client = OpenAI(api_key="YOUR_MIMO_API_KEY", base_url="https://api.xiaomimimo.com/v1") response = client.chat.completions.create(model="mimo-v2.5-pro", messages=[{"role": "user", "content": "Hello!"}]) print(response.choices[0].message.content)
const res = await fetch("https://api.xiaomimimo.com/v1/chat/completions", { method: "POST", headers: { "Authorization": "Bearer YOUR_MIMO_API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({ model: "mimo-v2.5-pro", messages: [{ role: "user", content: "Hello!" }] }) }); const data = await res.json(); console.log(data.choices[0].message.content);
Quick Start
Get up and running in under 2 minutes.
Get your API key
Sign up at platform.xiaomimimo.com → Console → API Keys. Free credits included.
Set environment variables
Export your key and the base URL in your terminal.
Make your first request
Use any of the code examples below. Same API format as OpenAI.
export MIMO_API_KEY=your_api_key_here export MIMO_BASE_URL=https://api.xiaomimimo.com/v1
Authentication
Two ways to authenticate. Use whichever fits your setup.
Option A: Authorization header (recommended)
Option B: api-key header
Your API key is stored locally in the Playground and never sent to our servers. Get your key from the MiMo Console.
Endpoints
GitBlock exposes MiMo's OpenAI-compatible endpoints.
All endpoints are relative to https://api.xiaomimimo.com/v1
Models
Choose the right model for your use case.
Python
Use the requests library or the OpenAI Python SDK.
import requests response = requests.post( "https://api.xiaomimimo.com/v1/chat/completions", headers={ "Authorization": "Bearer YOUR_MIMO_API_KEY", "Content-Type": "application/json" }, json={ "model": "mimo-v2.5-pro", "messages": [{"role": "user", "content": "Hello!"}] } ) print(response.json()["choices"][0]["message"]["content"])
stream = client.chat.completions.create(
model="mimo-v2.5-pro",
messages=[{"role": "user", "content": "Write a haiku."}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
resp = client.chat.completions.create(
model="mimo-v2.5-pro",
messages=[{
"role": "user",
"content": "Write a Python function to find prime numbers."
}]
)
code = resp.choices[0].message.content
print(code)
JavaScript
Use fetch or the OpenAI Node.js SDK.
const res = await fetch("https://api.xiaomimimo.com/v1/chat/completions", { method: "POST", headers: { "Authorization": "Bearer YOUR_MIMO_API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({ model: "mimo-v2.5-pro", messages: [{ role: "user", content: "Hello!" }] }) }); const data = await res.json(); console.log(data.choices[0].message.content);
cURL
Test directly from your terminal.
curl -X POST https://api.xiaomimimo.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_MIMO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mimo-v2.5-pro",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Run a Node
Contribute compute to the network by running a node. Coming in Phase 3.
Node software is under development. In Phase 3, you'll be able to contribute GPU compute and earn tokens. Stay tuned on GitHub for updates.
OpenAI SDK
Drop-in replacement. Change the base URL and you're live.
from openai import OpenAI client = OpenAI( api_key="YOUR_MIMO_API_KEY", base_url="https://api.xiaomimimo.com/v1" ) response = client.chat.completions.create( model="mimo-v2.5-pro", messages=[{"role": "user", "content": "Explain quantum computing."}] ) print(response.choices[0].message.content)
LangChain
Use MiMo as the LLM backend for LangChain chains and agents.
from langchain_openai import ChatOpenAI llm = ChatOpenAI( api_key="YOUR_MIMO_API_KEY", base_url="https://api.xiaomimimo.com/v1", model="mimo-v2.5-pro" ) result = llm.invoke("What is decentralized AI?") print(result.content)
Hermes Agent
Configure MiMo as a provider in Hermes Agent.
# In your hermes-agent config (config.yaml): providers: mimo: type: openai api_key: YOUR_MIMO_API_KEY base_url: https://api.xiaomimimo.com/v1 model: mimo-v2.5-pro
# Or via environment variables:
export HERMES_PROVIDER=openai
export OPENAI_API_KEY=YOUR_MIMO_API_KEY
export OPENAI_BASE_URL=https://api.xiaomimimo.com/v1