> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MiMo Code

> Route MiMo Code model calls through the Orq.ai AI Gateway and connect the Orq MCP server for unified observability, cost tracking, and model governance.

Route every model call MiMo Code makes through the [**Orq.ai AI Gateway**](/docs/ai-studio/ai-gateway/quickstart). MiMo Code supports OpenAI-compatible providers, so pointing it at the router opens the full **AI Gateway** catalog. Requests appear in [Traces](/docs/ai-studio/observability/traces) automatically.

## Prerequisites

* [MiMo Code](https://mimo.xiaomi.com) installed:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -fsSL https://mimo.xiaomi.com/install | bash
```

* Active **Orq.ai** account with **AI Gateway** access
* [Orq.ai API key](/docs/ai-studio/organization/api-keys)

## Setup

Start MiMo Code inside a project directory, then add **Orq.ai** as a custom provider:

1. Type `/login` and select **other provider**, then **custom provider**.
2. Enter the connection details:
   * **id**: `orq`
   * **base URL**: `https://api.orq.ai/v3/router`
   * **API key**: your [Orq.ai API key](/docs/ai-studio/organization/api-keys)
   * **model**: any identifier from the **AI Gateway** catalog, for example `anthropic/claude-sonnet-4-6`

Switch models at any time with `/model`.

<Note>
  MiMo Code requests `max_tokens: 32000` by default, which exceeds the output cap of some models. For example, `openai/gpt-4o` allows at most 16384 completion tokens and returns an error. Use a model with a larger output budget, such as `anthropic/claude-sonnet-4-6` (64000), or lower MiMo Code's maximum output tokens.
</Note>

## Verification

Send a prompt in MiMo Code. The response appears in the terminal and the trace appears in [**Orq.ai** Traces](/docs/ai-studio/observability/traces) with the model identifier you selected.

## Connect via MCP

MiMo Code is a fork of OpenCode and keeps its MCP support, so the [**Orq MCP**](/docs/ai-studio/integrations/code-assistants/orq-mcp) server can run alongside the gateway routing above. With both connected, MiMo Code routes model calls through the **AI Gateway** and manages **Agents**, experiments, **Datasets**, and **Traces** through the **Orq MCP** tools.

Add the **Orq MCP** server to the MiMo Code config (`~/.config/mimocode/mimocode.json`, or `.mimocode/mimocode.json` for a single project):

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "mcp": {
    "orq": {
      "type": "remote",
      "url": "https://my.orq.ai/v2/mcp",
      "enabled": true,
      "headers": {
        "Authorization": "Bearer YOUR_ORQ_API_KEY"
      }
    }
  }
}
```

Replace `YOUR_ORQ_API_KEY` with an [API key](/docs/ai-studio/organization/api-keys). See the [MCP Quickstart](/docs/ai-studio/integrations/code-assistants/orq-mcp) for the full tool reference.

<Note>
  **Orq.ai** API keys are scoped to a single project, so the **Orq MCP** server only exposes the **Agents**, experiments, **Datasets**, and **Traces** within that project. Use a key from the project whose entities MiMo Code should manage.
</Note>
