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

# 快速开始

> 只需简单三步，即可开始使用 MixRoute 访问各种 AI 模型

<link rel="alternate" hrefLang="en" href="https://mixroute.ai/docs/quickstart" />

<link rel="alternate" hrefLang="zh-Hans" href="https://mixroute.ai/docs/zh-hans/quickstart" />

<link rel="alternate" hrefLang="zh-Hant" href="https://mixroute.ai/docs/zh-hant/quickstart" />

<link rel="alternate" hrefLang="ja" href="https://mixroute.ai/docs/ja/quickstart" />

<link rel="alternate" hrefLang="x-default" href="https://mixroute.ai/docs/quickstart" />

## 第一步：注册并登录

打开 [MixRoute 控制台](https://console.mixroute.ai/)，完成账号注册并登录。

<Info>
  新用户注册即可获赠 \$5 试用额度，无需先充值即可发起首次请求。
</Info>

## 第二步：复制已有 API Key

注册后，系统会自动创建首个 API Key。

1. 在控制台导航中打开 **API Keys**。
2. 复制已有 Key，填入下方请求示例。
3. 仅在需要为其他应用使用独立 Key 时，再创建额外的 Key。

请妥善保管 API Key，不要放在浏览器端代码或公开仓库中。

## 第三步：开始调用

### 3.1 获取接入信息

| 配置项 | 值 |
| - | - |
| API 地址（Base URL） | `https://api.mixroute.ai/v1` |
| API 密钥 | 从 API Keys 复制的密钥 |
| 请求格式 | 完全兼容 OpenAI API |

### 3.2 测试调用

使用 curl 快速测试：

```bash theme={null}
curl https://api.mixroute.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-5.5",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
```

### 3.3 代码示例

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from openai import OpenAI

    client = OpenAI(
        api_key="YOUR_API_KEY",
        base_url="https://api.mixroute.ai/v1"
    )

    response = client.chat.completions.create(
        model="gpt-5.5",
        messages=[
            {"role": "user", "content": "Hello!"}
        ]
    )

    print(response.choices[0].message.content)
    ```
  </Tab>

  <Tab title="Node.js">
    ```javascript theme={null}
    import OpenAI from 'openai';

    const openai = new OpenAI({
      apiKey: 'YOUR_API_KEY',
      baseURL: 'https://api.mixroute.ai/v1'
    });

    const response = await openai.chat.completions.create({
      model: 'gpt-5.5',
      messages: [{ role: 'user', content: 'Hello!' }]
    });

    console.log(response.choices[0].message.content);
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    OpenAiService service = new OpenAiService(
        "YOUR_API_KEY", 
        Duration.ofSeconds(60), 
        "https://api.mixroute.ai/v1"
    );

    ChatCompletionRequest request = ChatCompletionRequest.builder()
        .model("gpt-5.5")
        .messages(List.of(
            new ChatMessage(ChatMessageRole.USER, "Hello!")
        ))
        .build();

    ChatCompletionResult result = service.createChatCompletion(request);
    System.out.println(result.getChoices().get(0).getMessage().getContent());
    ```
  </Tab>
</Tabs>

<Note>
  在 **Wallet** 中查看余额，需要更多额度时再充值；使用初始试用额度无需先充值。
</Note>

## 下一步

恭喜！您已经成功完成了 MixRoute API 的接入。接下来您可以：

<CardGroup cols={2}>
  <Card title="查看 API 文档" icon="book" href="/docs/zh-hans/api-reference/endpoint/chat-openai" cta="了解更多">
    了解完整的 API 接口说明
  </Card>

  <Card title="集成到应用" icon="puzzle-piece" href="/docs/zh-hans/api-reference/openai-sdk" cta="了解更多">
    将 Mixroute Api 集成到各种工具
  </Card>
</CardGroup>

<Tip>
  保存好您的 API 密钥，并定期在控制台查看使用日志，合理优化成本。祝使用愉快\~
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.