常见问题
按错误码或看到的现象找到对应的处理办法。每个 API 错误都带 request_id,联系我们时请附上。API 返回的错误消息只有英文。
登录与访问
| 看到的情况 | 原因 | 怎么办 |
|---|---|---|
| 「工作区已暂停」 | 我们暂停了你的工作区。 | 联系我们。 |
| 「登录已过期或不是在这个浏览器发起的,请重新登录。」 | 登录用时太长,或者是在别的浏览器发起的。 | 在同一个浏览器里重新登录。 |
| 控制台要求刷新页面 | 你在另一个标签页换了账号登录。 | 刷新页面。 |
Key:401 和 403
code 和消息 | 怎么办 |
|---|---|
invalid_key,"Send an API key: Authorization: Bearer pwc_live_…" | 带上这个请求头。检查存 key 的环境变量有没有设置。 |
invalid_key,"This API key is not valid" | key 写错了或者被截断了。重新复制,或者新建一个。 |
invalid_key,"This API key was revoked" | 新建一个 key。 |
forbidden,"This API key may not be used here" | key 缺少这个接口需要的用途(「模型 API」「沙盒」或「云主机」)。新建一个带这个用途的 key。 |
forbidden,"This organization is not active" | 你的工作区被暂停了。见登录与访问。 |
钱
code | 原因 | 怎么办 |
|---|---|---|
insufficient_funds | 工作区和 Yi Labs 钱包都付不起这次预扣,或者 Yi Labs 账号有欠款。消息里会写是哪种。 | 在 https://account.theyilabs.com/billing 充值或选一个付费套餐,有欠款的话也在那里付清。免费额度不算。调用和资源结束时预扣会释放。模型调用把 max_tokens 调小,沙盒把 timeout_s 调短,预扣都会变小。 |
key_limit_reached | key 本周期的花费上限用完了,或者剩下的不够这次预扣。 | 周期是「每月」的话等下个月,或者换一个 key。 |
insufficient_funds,"Renew the lease before starting the VM" | 云主机的租期已经结束。 | 先续费,再启动。 |
503 upstream_unavailable,消息提到 Yi Labs 账号 | Yi Cloud 暂时连不上你的 Yi Labs 账号,没法从钱包里取钱。 | 稍后再试。 |
模型
| 看到的情况 | 怎么办 |
|---|---|
404 not_found,"No such enabled model" | 用 GET /v1/catalog 里的 id。 |
400,"This endpoint does not match the model kind" | 对话模型用 chat completions、responses 或 messages,向量模型用 /v1/embeddings,图片模型用 /v1/images/generations。 |
400,"This model does not support Responses" | 改用 chat completions,或者换一个 responses_api: true 的模型。 |
400,"Only client-executed function tools are supported" | 只传 type: "function" 的工具。 |
400,"Provider-stored content references are not supported" | 直接传内容本身,不要用 file_id 或 item_reference。 |
400,"Unsupported Messages input; use text, images and custom tools" | 从 Messages 请求里去掉服务端工具和文档块。 |
400 content_filter | 模型拒绝了这段内容,请修改输入。 |
400 upstream_invalid_request | 模型拒绝了某个参数或输入,比如输入超出了它能接受的长度。检查请求。 |
429 rate_limited | 按 Retry-After 里的秒数等一下,或者换一个每分钟请求数更高的 key。 |
502、503 upstream_capacity、504 | 没有部署能回答,稍后再试。 |
503 upstream_unavailable,"Model API is paused" | 稍后再试。 |
流以 event: error 和 incomplete_stream 结束 | 流开始后断了,不会重放。需要完整回答的话,重新发请求。 |
| 某个请求标着「估算」 | 模型没有报告用量,所以费用是估算的,不会超过预扣。 |
创建沙盒和云主机
| 看到的情况 | 怎么办 |
|---|---|
关于 Idempotency-Key 的 400 invalid_request | 带上 Idempotency-Key 请求头,8 到 120 个字母、数字或 .、_、:、-。见 API 参考。 |
409 conflict,"Idempotency-Key was used with different parameters" | 新请求用新 key。只有重试同一个请求时才复用 key。 |
400,"This compute class is unavailable" | 用 GET /v1/compute/classes 里的规格 id。 |
503,"No pool is available for this architecture" | 用 GET /v1/compute/classes 里列出的架构,或者不填 pool。 |
503,"Compute is paused" | 稍后再试。 |
沙盒
| 看到的情况 | 怎么办 |
|---|---|
409 conflict,"Sandbox is not ready" | 等 state 变成 ready。如果已经是 deleted,看它的 error_code。 |
409 conflict,"Sandbox has four commands in progress" | 等其中一条结束。 |
400,"Output exceeds 1 MiB; use stream=true" | 用 stream: true 执行,或者把输出写进文件再下载。 |
400,"Use a byte range of at most 64 KiB" | 每个 Range 最多 65,536 字节。 |
404,"File is unavailable" | 检查路径。相对路径从 /workspace 算起。 |
400,"Sandboxes have no inbound access" | 去掉 ssh_public_keys 和 allowed_cidrs。需要 SSH 的话用云主机。 |
在 /workspace、/home/pwc、/tmp 之外写文件失败 | 文件系统的其余部分只读,也没有 sudo。 |
| 连 80、443 以外的端口失败 | 出站只允许 HTTP 和 HTTPS。见配额与网络。 |
云主机
| 看到的情况 | 怎么办 |
|---|---|
400,"VMs require SSH public keys and allowed client CIDRs" | ssh_public_keys 里至少一个公钥,allowed_cidrs 里至少一个地址段。 |
关于 CIDR 的 400 | IPv4 地址段至少 /8,IPv6 至少 /32,可以更窄。 |
| SSH 超时 | 确认你的地址在 allowed_cidrs 里,云主机处于 running。用 GET /v1/vms/{id}/serial 看它是怎么启动的。 |
| SSH 拒绝了密钥 | 用 pwc 登录,私钥要和 ssh_public_keys 里的某个公钥配对。 |
409 conflict,"Wait for the current operation" 或 "An operation is already in progress" | 等当前操作完成。 |
409 conflict,"Wait until the VM is running" | 云主机运行过一次之后才能续费。 |
403 forbidden,"Resource is isolated pending review" | 我们把它隔离了,只能 stop 和 delete。请联系我们。 |
配额:409 quota_exceeded
| 消息 | 怎么办 |
|---|---|
| "Compute quota reached" | 删掉不需要的沙盒或云主机。停机的云主机也算在内。 |
| "Requested lifetime exceeds the organization quota" | 把 timeout_s 调短,或者少租几个小时。 |
| "Renewal exceeds the maximum lease" | 少续几个小时。 |
各档位的配额见配额与网络。
资源为什么结束了
Yi Cloud 停止或删除沙盒、云主机时,资源上的 error_code 会写明原因。
error_code | 发生了什么 |
|---|---|
boot_timeout | 10 分钟内没有变成可用。不收费。 |
capacity | 这个规格暂时没有机器。不收费。稍后再试,或者换一个规格。 |
timeout | 沙盒到了 timeout_s。 |
idle_timeout | 沙盒连续 idle_timeout_s 秒没有命令、文件操作或 keepalive。 |
agent_lost | 沙盒超过 2 分钟没有报告。 |
lease_expired | 云主机租期结束,已停止。想保留的话,24 小时内续费并启动。 |
retention_expired | 云主机停机满 24 小时,已删除。 |
insufficient_funds、key_limit_reached | 付不起云主机的停机保留费用,已删除。 |
action_uncertain | 重启或重装被打断。云主机已停止并隔离。删掉它,或者联系我们。 |
provider_lost、provider_failed | 机器在我们这边丢失或出错了。新建一个。 |
org_inactive | 工作区被暂停了。 |
compute_paused | 我们暂停了算力服务。 |