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

# theo status / theo verify

> 检查 Theo API 连接、身份验证和系统健康状态。

两个命令覆盖的检查范围相同，但精细程度不同——`theo status` 面向人类使用者，`theo verify` 面向脚本。

## `theo status`

```bash theme={null}
theo status
```

人类可读的连接与健康检查。它会针对配置的 `baseUrl` 调用 `theo.verify()`，**同时探测另一个主机**（裸域名 vs `www`），以捕获裸域名重定向导致的 401 陷阱——这是首次使用时出现 401 的头号原因。

### 示例输出（健康状态）

```
[theo] API key: theo_sk_live_a1b...
[theo] Base URL: https://www.hitheo.ai

[theo] ✓ Status: healthy
[theo] Version: 2026-03-28
[theo] Models available: 14
[theo] Round-trip: 186ms

[theo] ✓ Authentication OK
```

### 示例输出（裸域名重定向导致的 401）

```
[theo] API key: theo_sk_live_a1b...
[theo] Base URL: https://hitheo.ai

[theo] ❌ Verification failed against https://hitheo.ai
[theo]   Reason: Theo API error 401: Invalid API key
[theo]   Hint: Authentication failed. Confirm your API key starts with `theo_sk_` …

[theo] Retrying against the canonical host https://www.hitheo.ai...
[theo] ✓ https://www.hitheo.ai responded with auth in 172ms.

[theo] ⚠  Your configured baseUrl appears to be a redirect target that drops the
[theo]    Authorization header. Update your SDK config:
[theo]      new Theo({ apiKey, baseUrl: "https://www.hitheo.ai" })
[theo]    or unset THEO_BASE_URL to use the SDK default.
```

关于此问题产生原因的完整背景说明，请参阅 [401 故障排查](/troubleshooting/401-errors)。

## `theo verify`

```bash theme={null}
theo verify
```

同一诊断的机器可读版本。它会输出 JSON，并在 `authenticated` 为 false 时以 `1` 退出，因此你可以据此在 CI 中设置门禁。

```json theme={null}
{
  "healthy": true,
  "authenticated": true,
  "baseUrl": "https://www.hitheo.ai",
  "latencyMs": 186,
  "modelCount": 14,
  "version": "2026-03-28"
}
```

### 脚本化使用

```bash theme={null}
if ! theo verify > /tmp/theo.json; then
  echo "Theo API unreachable or key invalid:"
  jq -r '.error, .hint' /tmp/theo.json
  exit 1
fi
```

同一诊断也可以通过 SDK 中的 [`theo.verify()`](/sdk-reference/client#first-run-diagnostic) 以编程方式调用。


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