新我们如何抓出挂错模型的卖家,并在发生时为你退款。
UberLLM
Tencent 标志

如何在OpenCode中使用Tencent: Hy4 flash?

tencent/hy4-flash

OpenCode 通过 UberLLM 的 OpenAI 兼容聊天地址访问Tencent: Hy4 flash。在~/.config/opencode/opencode.json中,添加一个名为uberllm的提供商,该提供商使用@ai-sdk/openai-compatible包并将baseURL设置为https://api.uberllm.dev/v1,在其模型下添加tencent/hy4-flash,将您的 UberLLM 密钥放入UBERLLM_API_KEY环境变量中,然后使用/models选择uberllm/tencent/hy4-flash。 limit这些数字是Tencent: Hy4 flash的上下文大小和最大回复;OpenCode 使用它们来判断何时压缩长时间会话。

json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "uberllm": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "UberLLM",
      "options": {
        "baseURL": "https://api.uberllm.dev/v1",
        "apiKey": "{env:UBERLLM_API_KEY}"
      },
      "models": {
        "tencent/hy4-flash": {
          "name": "Tencent: Hy4 flash",
          "limit": {
            "context": 1048576,
            "output": 65536
          }
        }
      }
    }
  },
  "model": "uberllm/tencent/hy4-flash"
}

OpenCode 调用:OpenAI 聊天补全 https://api.uberllm.dev/v1/chat/completions · 完整的OpenCode指南

把 ull_your_key 换成你的 UberLLM API 密钥。一个密钥可用于所有工具和所有模型。

通过 API,Tencent: Hy4 flash 在三个地址上响应,使用相同的 UberLLM 密钥和模型 ID tencent/hy4-flash:位于https://api.uberllm.dev/v1/chat/completions的 OpenAI 聊天补全、位于https://api.uberllm.dev/v1/responses的 OpenAI Responses API 以及位于https://api.uberllm.dev/v1/messages的 Anthropic Messages API。

Tencent: Hy4 flash API 多少钱?

在 2026年11月19日,腾讯:Hy4 flash 通过 UberLLM 提供,每百万 input tokens 价格为 $0.0245,每百万 output tokens 价格为 $0.0984,比其标价 $0.035 和 $0.1405 低 30%。市场上共有 30 家供应商可以提供此服务。它支持高达 1,048,576 个 context tokens。每项请求及其费用都会在 Activity log 中列出。UberLLM 不会在此价格基础上加收任何费用,并且失败的请求不计费。

价格更新于 UTC 08:00。

在其他工具中使用 Tencent: Hy4 flash

OpenCode 中的其他模型