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

# 快速开始

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

## 第一步：账户准备

### 1.1 注册账号

访问 [UToken官网](https://utoken.yoostudio.ai) 注册账号：

* 使用邮箱注册（推荐高校、企业邮箱注册）
* 验证邮箱地址
* 登录控制台

### 1.2 账户充值

在控制台进行充值：

1. 点击"充值"菜单
2. 选择充值金额（最低 5 美金起，充值越多加赠越多）
3. 完成支付（支持支付宝、微信）

## 第二步：创建 API 密钥

### 2.1 生成密钥

1. 在后台导航点击"令牌"栏目，[https://utoken.yoostudio.ai/token](https://utoken.yoostudio.ai/token)
2. 可以复制【默认令牌】直接使用（右侧有个 复制 图标）
3. 或者新创建令牌：点击右上侧"新增"按钮，为密钥命名（如：test-key），点击确认创建，即拥有新的令牌。

## 第三步：开始调用

### 3.1 获取接入信息

* **API 地址（所谓的 Base\_Url）**：`https://utoken.yoostudio.ai`
* **API 密钥**：您刚创建的密钥
* **请求格式**：完全兼容 OpenAI API，兼容 OpenAI 格式调用。

### 3.2 测试调用

使用 curl 快速测试：

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

### 3.3 代码示例

> [tab] Python
>
> ```python theme={null} theme={null}
> from openai import OpenAI
>
> client = OpenAI(
>     api_key="YOUR_API_KEY",
>     base_url="https://utoken.yoostudio.ai/v1"
> )
>
> response = client.chat.completions.create(
>     model="gpt-4.1-mini",
>     messages=[
>         {"role": "user", "content": "Hello!"}
>     ]
> )
>
> print(response.choices[0].message.content)
> ```

> [tab] Node.js
>
> ```javascript theme={null} theme={null}
> import OpenAI from 'openai';
>
> const openai = new OpenAI({
>   apiKey: 'YOUR_API_KEY',
>   baseURL: 'https://utoken.yoostudio.ai/v1'
> });
>
> const response = await openai.chat.completions.create({
>   model: 'gpt-4.1-mini',
>   messages: [{ role: 'user', content: 'Hello!' }]
> });
>
> console.log(response.choices[0].message.content);
> ```

> [tab] Java
>
> ```java theme={null} theme={null}
> // 使用官方 OpenAI Java 库
> OpenAiService service = new OpenAiService(
>     "YOUR_API_KEY", 
>     Duration.ofSeconds(60), 
>     "https://utoken.yoostudio.ai/v1"
> );
>
> ChatCompletionRequest request = ChatCompletionRequest.builder()
>     .model("gpt-4.1-mini")
>     .messages(List.of(
>         new ChatMessage(ChatMessageRole.USER, "Hello!")
>     ))
>     .build();
>
> ChatCompletionResult result = service.createChatCompletion(request);
> System.out.println(result.getChoices().get(0).getMessage().getContent());
> ```

## 下一步

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

> [card] [查看 API 文档](https://utoken-docs.yoostudio.ai/docs/zh/api-reference/audio.md)
>
> 了解完整的 API 接口说明

> [card] [探索模型列表](https://utoken.yoostudio.ai/models)
>
> 查看所有支持的 AI 模型

> [card] [集成到应用](https://utoken-docs.yoostudio.ai/docs/zh/scenarios/cherry-studio.md)
>
> 将 UToken 集成到各种工具

> [card] [查看使用统计](https://utoken.yoostudio.ai/console/dashboard)
>
> 在控制台监控使用情况

## 常见问题

### 如何切换模型？

只需修改请求中的 `model` 参数：

```json theme={null} theme={null}
{
  "model": "gpt-4.1",           // 使用 GPT-4.1
  "model": "claude-sonnet-4-20250514",   // 使用 Claude 4 Sonnet
  "model": "gemini-2.5-pro"       // 使用 Gemini 2.5 Pro
}
```

### 支持哪些编程语言？

UToken 兼容 OpenAI API 标准，支持所有 OpenAI SDK 支持的语言：

* Python
* JavaScript/TypeScript
* Java
* C#/.NET
* Go
* Ruby
* PHP
* 更多...

### 如何查看余额？

登录 [控制台](https://utoken.yoostudio.ai/console/dashboard) 即可查看：

* 账户余额
* 使用记录
* 消费统计

### 遇到问题怎么办？

1. 查看 [API 文档](https://utoken-docs.yoostudio.ai/docs/zh/api-reference/audio.md)
2. 检查 [常见错误](https://utoken-docs.yoostudio.ai/docs/zh/faq/model-selection.md)
3. 联系客服：[support@utoken.yoostudio.ai](mailto:support@utoken.yoostudio.ai)

> [!NOTE]
>
> 提示：保存好您的 API 密钥，并定期在控制台查看使用日志，每笔请求都有消息历史，合理优化成本。
> 祝使用愉快\~


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