> For the complete documentation index, see [llms.txt](https://docs.xxooapi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xxooapi.com/ru-men-shi-yong-shou-ce.md).

# 入门使用手册

Claude Code / Codex 日常操作 —— 切模型、整理对话、看 Token 明细

{% hint style="info" %}
**终端里的 `claude` 和 `codex` 才是真正干活的入口；**&#x78;xooAPI **负责把请求稳定地送到模型那里。**

第一次用，不要追求全懂。先跑起来，用顺手了自然就会了。
{% endhint %}

## 启动前的 3 个确认

每次打开终端前：

1. 代理软件是不是关掉了（或者你确认它不影响终端）
2. 环境变量是不是生效（新开终端最保险）
3. [数据看板](https://xxooapi.com/console) 余额够不够用

## 先用哪个：Claude 还是 Codex

| 场景                   | 推荐                        |
| -------------------- | ------------------------- |
| 想聊天、梳理思路、问"我现在该怎么做"  | **Claude Code**           |
| 想让它直接读代码、写代码、改文件、跑测试 | **Claude Code**（工程任务强）    |
| 想让它执行脚本、排查报错、快速回答    | **Codex**                 |
| 不确定                  | 优先 **Claude Code**，日常编码更稳 |

## 启动 Claude Code

```bash
cd ~/你的项目目录
claude
```

首次进入会有引导，一路回车用默认即可。进入后可以先问：

```
你现在用的是什么模型？
```

```
我是新手，想完成 [你的目标]。你希望我先提供哪些信息？
```

## 启动 Codex

```bash
codex
```

同样有引导，默认即可。可以试：

```
帮我看看当前文件夹里有什么
```

## 最常用的几个操作

{% stepper %}
{% step %}

### 切换模型

进入 `claude` 或 `codex` 后输入：

```
/model
```

上下方向键选择，回车确认。不确定选哪个？直接问：

```
这几个模型分别适合什么场景？我现在要做 [任务]，用哪个合适？
```

xxooAPI **推荐组合**：

* **日常编码主力** → Claude Sonnet 4.6（性价比最高）
* **复杂架构 / 需要深度推理** → Claude Opus 4.6
* **大量简单查询 / 代码补全** → Claude Haiku 4.5
* **兼容 OpenAI 生态** → GPT-5.4
  {% endstep %}

{% step %}

### 对话乱了怎么办

对话跑偏、模型开始胡言乱语时，按顺序尝试：

1. `/compact` —— 压缩当前对话（保留核心上下文，适合"有点乱但想接着聊"）
2. `/clear` —— 清空当前对话（适合"话题跑偏，重新开始"）
3. 直接开新终端窗口（彻底重置）
   {% endstep %}

{% step %}

### 想让 AI 看某个文件 / 图片

**不用打完整路径**。在文件管理器找到文件，复制，回到终端对话框粘贴即可，Claude Code 和 Codex 都支持。
{% endstep %}

{% step %}

### 看起来卡死了

运行大任务时界面可能假死。先别关：

* `Ctrl + O` 可切换查看后台输出
* 等 10 秒观察是否仍在刷新
* 确实不动了才按 `Ctrl + C` 中断
  {% endstep %}

{% step %}

### 误操作了

* 先试 `Esc` 取消当前输入
* 不行再 `Ctrl + C` 中断
* 实在不行关窗口重开
  {% endstep %}
  {% endstepper %}

## 怎么提问效果最好

新手最容易犯的错是 **问得太笼统**。推荐万能句式：

```
我想完成 [你的目标]。你希望我提供哪些信息，能帮我更好地一步步带我完成？
```

让 AI 反问你要上下文，比你自己琢磨"该说什么"高效得多。

再补一句更简单的：

```
我是新手，请一步一步带我做，不要一次说太多。
```

## 看懂 Token 明细

打开 [使用记录](https://xxooapi.com/console/log)，会看到一堆 Token 数字。含义：

| 术语             | 含义                         | 比喻（打车）    |
| -------------- | -------------------------- | --------- |
| **输入 Token**   | 你发给 AI 的内容                 | 上车前说了多少要求 |
| **输出 Token**   | AI 回给你的内容                  | 司机给的反馈和路线 |
| **缓存命中 Token** | 系统复用了之前算过的上下文，比普通输入便宜 10 倍 | 这段路之前走过   |
| **总 Token**    | 本次请求总消耗                    | 整趟里程      |

**计费规律**：

* 你发得越长，输入 Token 越高
* AI 回得越长，输出 Token 越高
* 缓存命中越多，越省钱
* 多轮长对话会累积输入（每轮都要带上之前的内容）

**省钱小技巧**：

* 不需要上下文时用 `/clear` 清一下，避免反复带旧内容
* 用 `/compact` 压缩比新开对话更省钱（保留精华）
* 简单问题用 Haiku，复杂才用 Opus

## 出现一大片红字时

**不要慌，不要立刻关窗口**。按优先级处理：

1. 截图或复制完整报错
2. 丢给还能用的 AI（Codex / Claude 网页版 / 豆包）
3. 仍搞不定 → [故障排查](/gu-zhang-pai-cha.md) → `support@xxooapi.com`

## 新手只需记住这 8 条

1. `claude` 启动 Claude Code，`codex` 启动 Codex
2. 第一次启动一路回车用默认
3. 日常编码优先 Claude Sonnet 4.6
4. 切换模型用 `/model`
5. 对话乱了先 `/compact`，再 `/clear`
6. 误操作先 `Esc`，再 `Ctrl + C`
7. 卡住了先 `Ctrl + O` 看后台输出
8. 看不懂的报错 → 截图丢给 AI

***

**想了解计费、退款、稳定性细节？** → [FAQ](/chang-jian-wen-ti.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xxooapi.com/ru-men-shi-yong-shou-ce.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
