> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/zh/ji-cheng/jiang-curl-he-http-lian-jie-dao-unsloth.md).

# 将 Curl 和 HTTP 连接到 Unsloth

指南：使用 curl（或任何 HTTP 客户端）访问 Unsloth 的 API，附带每个端点和功能都可直接复制粘贴的示例。

Unsloth 在 Unsloth 启动所用端口的同一基础 URL 上暴露三种与 OpenAI/Anthropic 兼容的线协议格式。它们都使用一个 `Authorization: Bearer sk-unsloth-…` header，并根据你是否设置 `stream`.

本页按端点分组这些示例（`/v1/chat/completions`, `/v1/messages`, `/v1/responses`, `/v1/models`, `/v1/embeddings`, `/v1/systemone`），并以一个关于 Unsloth 内置 **服务器端工具**的共享部分结束，这些工具可用于所有聊天端点。

{% hint style="info" %}
如果你不确定该使用哪个 URL / 密钥 / 模型名称，请先阅读 API 概览。它会引导你完成启动 Unsloth、加载模型以及创建一个 `sk-unsloth-…` 密钥。
{% endhint %}

### 🔑 身份验证

每个请求都需要一个 `Authorization` header：

```
Authorization: Bearer sk-unsloth-xxxxxxxxxxxx
```

为了避免密钥出现在你的 shell 历史中，请先导出一次密钥，并引用环境变量：

```bash
export UNSLOTH_STUDIO_AUTH_TOKEN=sk-unsloth-xxxxxxxxxxxx
```

下面的示例为了清晰起见，将密钥内联为 `sk-unsloth-xxxxxxxxxxxx` 。实际使用时，请替换为 `$UNSLOTH_STUDIO_AUTH_TOKEN`.

### 📋 列出已加载的模型

```bash
curl http://localhost:8888/v1/models \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx"
```

响应：

```json
{
  "object": "list",
  "data": [
    {"id": "unsloth/gemma-3-27b-it-GGUF", "object": "model", "owned_by": "local"}
  ]
}
```

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FgVC1VPkCkUQBVg0HScEc%2FScreenshot%202026-04-22%20at%203.06.57%E2%80%AFAM.png?alt=media&amp;token=6f77cc78-bd0e-4141-b555-b232df1036dc" alt=""><figcaption></figcaption></figure>

当请求需要一个 `id` 字段时，请使用该字段， `"model"` 值（或当像 opencode 这样的客户端请求一个 **模型 ID**).

### 💬 聊天补全（`/v1/chat/completions`)

OpenAI 聊天补全方言。兼容面最广。可用于 OpenAI SDK、opencode、Cursor、Continue、Cline、Open WebUI、SillyTavern，以及大多数兼容 OpenAI 的工具。

#### 基础请求

```bash
curl http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "default",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
```

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fvy9TyeJZljKrMJAath0L%2FScreenshot%202026-04-22%20at%203.40.35%E2%80%AFAM.png?alt=media&amp;token=98f8d622-83c0-4f55-aa37-d3571f0a38cd" alt=""><figcaption></figcaption></figure>

#### 流式输出

添加 `"stream": true` 后，响应会切换为服务器发送事件（`text/event-stream`）。告诉 `curl` 使用 `--no-buffer` (`-N`):

```bash
curl -N http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-local",
    "messages": [{"role": "user", "content": "Write a haiku about locally-run LLMs."}],
    "stream": true
  }'
```

响应的每一行看起来像 `data: {"choices":[{"delta":{"content":"..."}}]}`，并以 `data: [DONE]`.

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FsazSu4RpyiEa6HeamYbj%2FScreenshot%202026-04-22%20at%203.42.05%E2%80%AFAM.png?alt=media&amp;token=f62cf129-74cd-4e8e-986a-1755eeb0e048" alt=""><figcaption></figcaption></figure>

#### 图像（视觉）

将图像附加为用户消息中的一个 `image_url` 内容部分。URL 可以是 HTTPS 或 base64 `data:` URI：

```bash
# 将本地图像文件嵌入为 base64（为简洁起见已截断）
IMG=$(base64 -w 0 test.jpg)

cat > /tmp/request.json <<EOF
{
  "model":"default",
  "messages":[{"role":"user","content":[
    {"type":"text","text":"描述这张图片。"},
    {"type":"image_url","image_url":{"url":"data:image/jpeg;base64,$IMG"}}
  ]}],
  "max_tokens":200,
  "stream":false
}
EOF

curl http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d @/tmp/request.json
```

{% hint style="info" %}
已加载的模型必须是多模态的。如果你加载的是纯文本模型，请求在结构上会成功，但模型不会处理图像。
{% endhint %}

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F9yO7ersnyaIj3X8UkD5q%2FScreenshot%202026-04-22%20at%203.59.30%E2%80%AFAM.png?alt=media&amp;token=9e0af9e5-d565-4acd-8b4a-020c02d74cd8" alt=""><figcaption></figcaption></figure>

#### 函数调用（OpenAI 工具）

传入 OpenAI 风格的 `tools` 以及（可选） `tool_choice`。你的客户端执行每个工具调用，并在下一轮返回结果。

```bash
curl http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model":"default",
    "messages":[{"role":"user","content":"What is the weather in Paris?"}],
    "tools":[{
      "type":"function",
      "function":{
        "name":"get_weather",
        "description":"获取某个城市的当前天气。",
        "parameters":{
          "type":"object",
          "properties":{"city":{"type":"string"}},
          "required":["city"]
        }
      }
    }],
    "tool_choice":"required"
  }' | jq '.choices[0].message, .usage'
```

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F39CDJk0Z1WhG5JyaJIfV%2Ftests_codex_pr_2.png?alt=media&amp;token=c3f01286-7dc9-47dd-b7f9-9ee8c2d3cb2f" alt=""><figcaption></figcaption></figure>

### 📨 Anthropic 消息（`/v1/messages`)

Unsloth 的 Anthropic 兼容方言，被 Claude Code、Anthropic SDK、OpenClaw 以及任何支持 Messages API 的客户端使用。

#### 基础请求

```bash
curl http://localhost:8888/v1/messages \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "default",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}]
  }'
```

{% hint style="warning" %}
`max_tokens` 在 `/v1/messages` 中是必需的（在 `/v1/chat/completions`).
{% endhint %}

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FOz7xeC4dRnDjO5GDAsmC%2FScreenshot%202026-04-22%20at%204.01.52%E2%80%AFAM.png?alt=media&amp;token=b7025ce1-e3a8-46ad-91fa-e87b96a22d6b" alt=""><figcaption></figcaption></figure>

#### 流式输出

```bash
curl -N http://localhost:8888/v1/messages \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-local",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Explain LoRA in two sentences."}],
    "stream": true
  }'
```

事件遵循 Anthropic 的 SSE 结构： `message_start`, `content_block_start`, `content_block_delta`, `content_block_stop`, `message_delta`, `message_stop`，以及 Unsloth 自定义的 `tool_result` 服务器端工具输出事件。

#### 图像（视觉）

Anthropic 风格的图像内容使用一个 `source` 带 base64 数据的块：

```bash
IMG=$(base64 -w 0 test.jpg)

cat > /tmp/request.json <<EOF
{
  "messages":[{"role":"user","content":[
    {"type":"text","text":"描述这张图片。"},
    {"type":"image","source":{"type":"base64","media_type":"image/jpeg","data":"$IMG"}}
  ]}],
  "max_tokens":200,
  "stream":true
}
EOF

curl -s http://localhost/v1/messages \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d @/tmp/request.json
```

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FMkzYMtkw9dt0V7cbqduU%2FScreenshot%202026-04-22%20at%204.03.28%E2%80%AFAM.png?alt=media&amp;token=de854c5a-b399-4736-83bb-23ffe26981e2" alt=""><figcaption></figcaption></figure>

#### 工具调用（Anthropic 工具）

```bash
curl http://localhost:8888/v1/messages \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-local",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Whats the weather in Tokyo?"}],
    "tools": [
      {
        "name": "get_weather",
        "description": "获取某个城市的当前天气",
        "input_schema": {
          "type": "object",
          "properties": {
            "city": {"type": "string"}
          },
          "required": ["city"]
        }
      }
    ],
    "tool_choice": {"type": "auto"}
  }'
```

`tool_choice` 这些值与 OpenAI 方言的对应关系如下：Anthropic `auto` → OpenAI `auto`，Anthropic `any` → OpenAI `required`，Anthropic `{type: "tool", name: "x"}` → OpenAI `{type: "function", function: {name: "x"}}`，Anthropic `none` → OpenAI `none`.

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fqb37JN1ffgBFBKyd1uWD%2FScreenshot%202026-04-22%20at%204.07.43%E2%80%AFAM.png?alt=media&amp;token=1fb7ec5d-8326-4e9f-b752-2d5d7e830a39" alt=""><figcaption></figcaption></figure>

### 🧬 Responses（`/v1/responses`)

Unsloth 也支持较新的 **OpenAI Responses API**, 这是 Codex 和其他近期 OpenAI 客户端已迁移到的协议。

```bash
curl http://localhost:8888/v1/responses \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-local",
    "input": "写一句问候语。"
  }'
```

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FhmyMSCTgdD1NYiLUdYNZ%2Fopenai_responses.png?alt=media&amp;token=dd56bd52-71db-46f3-8f6c-1499df8e443c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FZ3MEH4vV2RjxhLe0DsWJ%2Fresponses_function_calling.png?alt=media&amp;token=a8637d5a-51d2-47f5-9658-add9cdb757e3" alt=""><figcaption></figcaption></figure>

要进行流式输出，请添加 `"stream": true` 并使用 `curl -N`。Responses 流使用命名事件，例如 `response.output_text.delta`，而不是 Chat Completions 分块。

在 `input` 中发送完整的对话历史。Unsloth 不支持 `previous_response_id` 或 `conversation` 来由服务器管理历史记录。

#### 嵌入（`/v1/embeddings`)

使用已加载的 embedding GGUF 或 Unsloth 配置的嵌入模型，从文本生成嵌入向量。

使用 `"model": "default"`时，Unsloth 会优先使用常驻的 embedding GGUF（如果可用），否则使用其配置的嵌入模型。

```bash
curl http://localhost:8888/v1/embeddings \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "default",
    "input": [
      "Unsloth runs local models.",
      "为每段文本生成一个向量。"
    ],
    "encoding_format": "float"
  }'
```

响应包含一个 `data` 数组，其中每个输入都有一个 `embedding` 向量和一个 `index` 。为了便于移植，请使用文本输入；对 token 数组输入的支持取决于嵌入后端。

#### 决策 API（`/v1/systemone`)

启用 **决策 API** 在 **设置 → API** 中先选择一个决策模型。若已禁用决策 API，该端点会返回 `404` 。

请求包含 `state` 以及命名的 `questions`。支持的问题类型如下：

* `noul`：是否/否决定。
* `choice`：在 \`criteria\` 中提供的命名选项之间做出决定。 `criteria`.
* `score`：基于 \`criteria\` 中提供的有序标准等级进行评分的决定。 `criteria`.

使用 `"model": "default"` 来选择已配置的决策模型。

```bash
curl http://localhost:8888/v1/systemone \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "default",
    "state": "客户表示他们的订单到货时已损坏，并要求退款。",
    "questions": {
      "refund_requested": {
        "type": "noul",
        "instructions": "客户是否要求退款？"
      }
    }
  }'
```

要发现决策模型：

```bash
curl "http://localhost:8888/v1/models?output_modalities=decisions" \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx"
```

将 `8888` 替换为你的 Unsloth 端口，并将示例 API 密钥替换为你自己的。

### 🧰 Unsloth 服务器端工具（简写）

除了客户端函数调用之外，Unsloth 还可以在服务器端执行 **Python**, **bash**，以及 **网络搜索** ，并将结果作为自定义 `tool_result` 事件流式返回。这就是为什么 Unsloth 开箱即用就像一个“真正”的智能体，而无需通过你的客户端来回传递工具调用。

通过将这些额外字段传给 **任一** `/v1/chat/completions` 或 `/v1/messages`:

| 字段                | 类型              | 说明                                            |
| ----------------- | --------------- | --------------------------------------------- |
| `enable_thinking` | `boolean`       | `false` 以禁用思考。 `true` 默认情况下                   |
| `enable_tools`    | `boolean`       | `true` 以启用服务器端工具执行。                           |
| `enabled_tools`   | `array<string>` | 模型可以调用哪些工具。支持 `python`, `bash`, `web_search`. |
| `session_id`      | `string`        | 可选。跨调用持久化工具状态（例如 Python 内核）。                  |

#### 思考模式

思考模式默认启用。&#x20;

```bash
curl http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "default",
    "messages": [{"role": "user", "content": "用一句话总结量子隧穿"}],
    "stream": false
  }'
```

模型会先思考再给出答案。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F4XHr9KJhzpFEibCGEuHF%2FScreenshot%202026-04-22%20at%2012.22.46%E2%80%AFPM.png?alt=media&amp;token=15fa68ae-0ca5-464f-af16-25cfabc84c33" alt=""><figcaption></figcaption></figure>

要禁用思考，请在请求中传入 `enable_thinking: false` 。模型会直接给出答案，而不会先思考。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FKQR2nh8sb5G1zUc7YSs9%2FScreenshot%202026-04-22%20at%2012.25.47%E2%80%AFPM.png?alt=media&amp;token=4646a17e-2217-4f00-9e39-5362f989126f" alt=""><figcaption></figcaption></figure>

#### Python 执行

```bash
curl http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-local",
    "messages": [{"role": "user", "content": "What is 123 * 456? Use code to compute it."}],
    "stream": false,
    "enable_tools": true,
    "enabled_tools": ["python"],
    "session_id": "my-session"
  }'
```

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FVGbYtwBfSoqgZov5ivMA%2FScreenshot%202026-04-22%20at%204.16.13%E2%80%AFAM.png?alt=media&amp;token=28b83469-24fb-412d-9489-a0c6b92dd8b5" alt=""><figcaption></figcaption></figure>

#### 网络搜索 + Python（流式）

```bash
curl http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer sk-unsloth-xxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-local",
    "messages": [{"role": "user", "content": "Search for Python 3.13 features"}],
    "stream": true,
    "enable_tools": true,
    "enabled_tools": ["web_search", "python"],
    "session_id": "my-session"
  }'
```

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FzSFyzwXtJ0Hgvqq7gZcV%2FScreenshot%202026-04-22%20at%204.25.13%E2%80%AFAM.png?alt=media&amp;token=a8fc5908-cb11-4ec9-85c6-77a6b5c2e205" alt=""><figcaption></figcaption></figure>

#### 在 `/v1/messages`

同样的简写也可用于 Anthropic Messages 端点：

```bash
curl http://localhost:8888/v1/messages \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-local",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Search for Python 3.13 features"}],
    "stream": true,
    "enable_tools": true,
    "enabled_tools": ["web_search", "python"],
    "session_id": "my-session"
  }'
```

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FPpJxE60f2J59T5o85tQ1%2FScreenshot%202026-04-22%20at%204.28.43%E2%80%AFAM.png?alt=media&amp;token=870d74cb-dd8e-42c1-adeb-287807b22e16" alt=""><figcaption></figcaption></figure>

Unsloth 会额外流式输出自己的 `tool_result` SSE 事件，除了标准的 Anthropic / OpenAI 事件类型之外，模型会在下一轮看到每个工具的输出。

### ❔ 故障排查

**`401 未授权`** **-** 缺少 `Authorization` header，或者密钥错误。请检查： `Authorization: Bearer sk-unsloth-…`.

**`curl` 流式请求卡住 -** 添加 `-N` （与 `--no-buffer`相同）。如果没有它， `curl` 会缓冲 SSE 流，你会一直看不到内容，直到结束。

**不同操作系统的 base64 编码不同** **-** Linux 的 `base64` 默认会换行，而 macOS / BSD 不会。请在 `base64 -w 0` （Linux 上）、 `base64` （macOS 上）使用，或将输出通过 `tr -d '\n'`.

**Shell 中的 JSON 转义** **-** Heredoc（`-d @file.json`）在请求体变复杂后比内联字符串更清晰。示例： `curl ... -d @body.json`.

**`max_tokens` 在 `/v1/messages`** **-** 报错 `Anthropic 方言要求它。添加` （或你想要的任何限制）。

对于端点级问题（模型未加载、连接断开、端口错误），请参见 API 概览页。

### 可选：调整服务器默认值

你可以在启动服务器时通过以下方式自定义默认行为： `unsloth run`.

```bash
# 使用自定义默认值启动服务器
unsloth run \
  --model unsloth/Qwen3-1.7B-GGUF \
  --reasoning 关闭 \
  --temp 0.6 \
  -p 8888
```

使用 `--reasoning 关闭` 用于关闭思考，或者 `--reasoning 开启` 用于为支持推理的模型开启它。

```bash
# 在本地网络上公开 API
unsloth run \
  --model unsloth/Qwen3-1.7B-GGUF \
  -H 0.0.0.0 \
  -p 8888
```

这会在 `0.0.0.0:8888`上启动服务器，允许本地网络上的其他设备连接。

#### 按请求覆盖设置

你也可以直接在每个 API 请求中覆盖生成设置。

```bash
curl http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer $UNSLOTH_STUDIO_AUTH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "default",
    "messages": [
      {
        "role": "user",
        "content": "写一首关于本地 AI 的短诗。"
      }
    ],
    "temperature": 0.8,
    "top_p": 0.9,
    "max_tokens": 512
  }'
```

请求级别的值，例如 `temperature`, `top_p`, `max_tokens`，以及 `stream` 会覆盖该请求的服务器默认值。


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://unsloth.ai/docs/zh/ji-cheng/jiang-curl-he-http-lian-jie-dao-unsloth.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
