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

# 构建 AI 共赢生态

> AIhubmix 推出应用标识码 APP-Code，为开发者们提供全部模型（除 claude 系列模型外）10%优惠!

主要用于优化你的 API 调用成本，**根据你的有效域名生成一行标识码，加入 headers 立即生效。**

* **对于平台**：平台方所有 AIhubmix 调用成本得到降低，用户本身没有优惠。
* **对于开发者或普通用户**：通过你的工具发出的 AIhubmix 调用都享受优惠，即使由你的用户发起。

接入并使用之后，你会在用量的日志明细中看到请求的优惠。

<img src="https://mintcdn.com/aihubmix/axGkcFk0FkcdXl5v/public/en/app-code.png?fit=max&auto=format&n=axGkcFk0FkcdXl5v&q=85&s=87414613b29f2a1f5b5fd28b0c24223c" alt="图片" width="2345" height="975" data-path="public/en/app-code.png" />

## 1️⃣ 调用方法：

<CodeGroup>
  ```shell Curl 方式 theme={null}
  curl https://aihubmix.com/v1/responses \       
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
    -H "APP-Code:***" \
    -d '{
      "model": "gpt-5.5",
      "input": "Hello! Please say Hello back to me."
    }'
  ```

  ```py Openai sdk 方式 theme={null}
  completion = client.chat.completions.create(
    extra_headers={
      "APP-Code":"***"
    },
    model="gpt-5.5",
    messages=[
      {
        "role": "user",
        "content": "What is the meaning of life?"
      }
    ]
  )
  ```
</CodeGroup>

## 2️⃣ 注意事项

gemini 的 header 稍微特殊，这样加：

```py Python theme={null}
    client = genai.Client(
        api_key="sk-***", # 🔑 换成你在 AiHubMix 生成的密钥
        http_options={
            "base_url": "https://api.aihubmix.com/gemini",
            "headers": {
                "APP-Code": "***"
            }
        },
    )
```

## 3️⃣ 优惠使用条款

使用 APP-Code 享受优惠的同时，请严格遵循以下使用条款，AIHubMix 保留对所有条款的最终解释权。

<Note>
  **开源产品使用规范**

  如果您的产品是开源的，只需要在产品功能中体现 AIHubMix 作为 AI 模型供应商之一即可，形式不限。
</Note>

<Note>
  **闭源产品使用规范**

  如果您的产品是闭源的，需要在产品界面、用户协议或相关说明中提及模型服务来源。

  示例说明：

  * "AIHubMix 提供 AI 模型技术支持"
  * "AI 模型服务来自 AIHubMix"
  * 在应用的关于页面或帮助文档中注明相关信息
</Note>

<Note>
  **活动时效说明**

  APP-Code 优惠活动限时有效。 具体优惠政策可能根据实际情况调整，请关注官方公告获取最新信息。
</Note>

更新日期：2026年4月28日
