diff --git a/docs/llmservice/Claude-Code/claudecode-bankofai-api-configuration-guide.md b/docs/llmservice/Claude-Code/claudecode-bankofai-api-configuration-guide.md new file mode 100644 index 0000000..b08a57e --- /dev/null +++ b/docs/llmservice/Claude-Code/claudecode-bankofai-api-configuration-guide.md @@ -0,0 +1,298 @@ +# Claude Code with BANK OF AI API + +## Table of Contents + +- [Getting Started](#getting-started) +- [Option 1: settings.json (Recommended)](#option-1-settingsjson-recommended) +- [Option 2: Environment Variables](#option-2-environment-variables) +- [Switching Models](#switching-models) +- [Available Models](#available-models) +- [FAQ](#faq) + +*** + +## Getting Started + +Complete the following two prerequisites before proceeding with configuration. + +### Step 1: Install Claude Code + +Choose the installation method for your operating system: + +**macOS / Linux / WSL:** + +```bash +curl -fsSL https://claude.ai/install.sh | bash +``` + +**Windows PowerShell:** + +```powershell +irm https://claude.ai/install.ps1 | iex +``` + +**npm (requires Node.js 18+):** + +```bash +npm install -g @anthropic-ai/claude-code +``` + +### Step 2: Obtain a BANK OF AI API Key + +1. Log in to the [BANK OF AI Chat Platform](https://chat.bankofai.io/chat) +2. Navigate to the [API Key Management Page](https://chat.bankofai.io/key) +3. Click to create a new API Key + +> **Note:** Keep your API Key secure — you will need it in the configuration steps below. + +Once both prerequisites are complete, choose either option below to configure the BANK OF AI API. + +*** + +## Option 1: settings.json (Recommended) + +This approach configures Claude Code via its own settings file, without modifying system environment variables. + +### Steps + +1. Locate the `settings.json` file in the Claude Code installation directory. If it does not exist, create a new one. +2. Add the following content: + +```json +{ + "env": { + "ANTHROPIC_AUTH_TOKEN": "Your-BANK-OF-AI-API-Key", + "ANTHROPIC_BASE_URL": "https://api.bankofai.io/", + "ANTHROPIC_MODEL": "claude-sonnet-4.6", + "API_TIMEOUT_MS": "3000000" + } +} +``` + +> **Tip:** You can replace the `ANTHROPIC_MODEL` value with any model from the [Available Models](#available-models) list. + +3. Save the file and restart your terminal. +4. Verify the configuration: + +```bash +claude --version +claude +``` + +If Claude Code starts successfully and responds using the BANK OF AI model, the configuration is complete. + +*** + +## Option 2: Environment Variables + +This approach is suitable when you need the configuration to take effect globally. + +### Set Environment Variables + +Add the following lines to the appropriate shell configuration file: + +#### Bash (Linux / macOS) + +Edit `~/.bashrc` (or `~/.bash_profile` on macOS): + +```bash +# Claude Code - BANK OF AI Provider Configuration +export ANTHROPIC_BASE_URL="https://api.bankofai.io/" +export ANTHROPIC_AUTH_TOKEN="your-api-key-here" +export ANTHROPIC_MODEL="claude-sonnet-4.6" +# End of BANK OF AI Provider Configuration +``` + +Apply the changes: + +```bash +source ~/.bashrc +``` + +#### Zsh (Linux / macOS) + +Edit `~/.zshrc`: + +```bash +# Claude Code - BANK OF AI Provider Configuration +export ANTHROPIC_BASE_URL="https://api.bankofai.io/" +export ANTHROPIC_AUTH_TOKEN="your-api-key-here" +export ANTHROPIC_MODEL="claude-sonnet-4.6" +# End of BANK OF AI Provider Configuration +``` + +Apply the changes: + +```bash +source ~/.zshrc +``` + +#### PowerShell (Windows) + +Edit your `$PROFILE` file: + +```powershell +# Claude Code - BANK OF AI Provider Configuration +$env:ANTHROPIC_BASE_URL = "https://api.bankofai.io/" +$env:ANTHROPIC_AUTH_TOKEN = "your-api-key-here" +$env:ANTHROPIC_MODEL = "claude-sonnet-4.6" +# End of BANK OF AI Provider Configuration +``` + +Apply the changes: + +```powershell +. $PROFILE +``` + +#### Configuration File Path Reference + +| OS | Shell | Configuration File | +| :-----: | :--------: | :------------------------------- | +| Linux | Bash | `~/.bashrc` | +| Linux | Zsh | `~/.zshrc` | +| macOS | Bash | `~/.bashrc` or `~/.bash_profile` | +| macOS | Zsh | `~/.zshrc` | +| Windows | PowerShell | `$PROFILE` | + +### Verify the Configuration + +```bash +claude --version +claude +``` + +If Claude Code starts successfully and responds using the BANK OF AI model, the configuration is complete. + +*** + +## Switching Models + +### Temporary Switch (Current Session Only) + +**Linux / macOS:** + +```bash +ANTHROPIC_MODEL=claude-opus-4.6 claude +``` + +**Windows PowerShell:** + +```powershell +$env:ANTHROPIC_MODEL="claude-opus-4.6"; claude +``` + +### Permanent Switch + +Update the `ANTHROPIC_MODEL` value in your `settings.json` or shell configuration file, then restart the terminal or reload the configuration. + +*** + +## Available Models + +| Model Name | Provider | +| :------------------ | :-------- | +| `claude-opus-4.6` | Anthropic | +| `claude-opus-4.5` | Anthropic | +| `claude-sonnet-4.6` | Anthropic | +| `claude-sonnet-4.5` | Anthropic | +| `claude-haiku-4.5` | Anthropic | +| `gpt-5.2` | OpenAI | +| `gpt-5-mini` | OpenAI | +| `gpt-5-nano` | OpenAI | +| `gemini-3.1-pro` | Google | +| `gemini-3-flash` | Google | +| `kimi-k2.5` | Moonshot | +| `glm-5` | Zhipu AI | +| `minimax-m2.5` | MiniMax | + +> For the full and up-to-date model list, query the Models API provided by BANK OF AI. + +*** + +## FAQ + +
+Q: I get "claude command not found" — what should I do? + +Install Claude Code first: + +- **Linux / macOS:** `curl -fsSL https://claude.ai/install.sh | bash` +- **Windows:** `irm https://claude.ai/install.ps1 | iex` + +Restart your terminal after installation. + +
+ +
+Q: The setup script fails — what should I check? + +Verify the following: + +1. Claude Code is installed (`claude --version` outputs a version number) +2. `curl` is available (Linux / macOS) +3. Your network can reach `https://api.bankofai.io/` + +If the issue persists, try [Option 2: Environment Variables](#option-2-environment-variables) for manual configuration. + +
+ +
+Q: How do I verify the configuration is working? + +Check that the environment variables are set: + +**Linux / macOS:** + +```bash +echo $ANTHROPIC_BASE_URL +echo $ANTHROPIC_MODEL +``` + +**Windows PowerShell:** + +```powershell +$env:ANTHROPIC_BASE_URL +$env:ANTHROPIC_MODEL +``` + +
+ +
+Q: How do I check which model is currently in use? + +After launching Claude Code, type: + +```text +/status +``` + +
+ +
+Q: Why do I get 403 access_denied when calling some models? + +Models with a **Premium** tag may return `403 access_denied` if your BANK OF AI account has not been recharged before. + +A valid API key alone is not sufficient for Premium models. Please recharge your account first, then try again. + +
+ +
+Q: How do I remove the BANK OF AI provider configuration? + +Edit your shell configuration file and delete everything between the following comment blocks: + +```bash +# Claude Code - BANK OF AI Provider Configuration +... +# End of BANK OF AI Provider Configuration +``` + +Then reload the configuration file (e.g., `source ~/.zshrc`). + +
+ +*** + +> **Version:** v1.0 | **Last Updated:** 2026-03-27 diff --git a/docs/llmservice/introduction.md b/docs/llmservice/introduction.md index b623332..28ec7f2 100644 --- a/docs/llmservice/introduction.md +++ b/docs/llmservice/introduction.md @@ -1,19 +1,38 @@ # Welcome to LLM Service + + ## About LLM Service + + LLM Service is a professional AI service module within the Bank of AI ecosystem, built on top-tier blockchain infrastructure. It is dedicated to providing users with an efficient, user-friendly, and creative AI interaction experience. As a core AI service infrastructure of Bank of AI, this service leverages the decentralization, security, and high efficiency of blockchain technology to introduce a brand-new AI service model. + + The service's core features include: + + * **Multi-Model AI Chat:** We integrate various industry-leading Large Language Models (LLMs), allowing users to select the most suitable model based on their specific needs. + * **Powerful Integrated AI Services:** We offer comprehensive AI-related API services, enabling users to access and integrate them rapidly and easily within the Bank of AI framework. + * **Web3 Native Experience:** Through seamless integration with mainstream Web3 wallets, we provide an end-to-end native experience, from login to payment. + + ## Why Choose LLM Service? + + Choosing our LLM Service means enjoying the unique advantages of a secure blockchain ecosystem alongside meticulously designed features. + + * **Multi-chain Ecosystem Advantages:** As part of the Bank of AI ecosystem, users can make payments using mainstream tokens on supported chains, benefiting from fast transaction confirmations and low fees. + * **Low Cost & High Efficiency:** By optimizing resources and ensuring efficient on-chain interactions, we deliver highly cost-effective AI services to users. + * **Security & Privacy Protection:** We utilize a decentralized login method. Users can complete authentication simply by signing with their Web3 wallet, ensuring greater security and privacy for all AI interactions. + diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/Claude-Code/claudecode-bankofai-api-configuration-guide.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/Claude-Code/claudecode-bankofai-api-configuration-guide.md new file mode 100644 index 0000000..a1549e5 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/Claude-Code/claudecode-bankofai-api-configuration-guide.md @@ -0,0 +1,302 @@ +# 使用 BANK OF AI API 配置 Claude Code + +## 目录 + +- [开始之前](#开始之前) +- [方案一:使用 settings.json(推荐)](#方案一使用-settingsjson推荐) +- [方案二:使用环境变量](#方案二使用环境变量) +- [切换模型](#切换模型) +- [可用模型](#可用模型) +- [常见问题](#常见问题) + +*** + +## 开始之前 + +在继续配置之前,请先完成以下两个前置步骤。 + +### 第一步:安装 Claude Code + +根据你的操作系统选择对应的安装方式: + +**macOS / Linux / WSL:** + +```bash +curl -fsSL https://claude.ai/install.sh | bash +``` + +**Windows PowerShell:** + +```powershell +irm https://claude.ai/install.ps1 | iex +``` + +**npm(需要 Node.js 18+):** + +```bash +npm install -g @anthropic-ai/claude-code +``` + +### 第二步:获取 BANK OF AI API Key + +1. 登录 [BANK OF AI Chat 平台](https://chat.bankofai.io/chat) +2. 进入 [API Key 管理页面](https://chat.bankofai.io/key) +3. 点击创建新的 API Key + +> **注意:** 请妥善保管你的 API Key。你将在下面的配置步骤中使用它。 + +完成以上两个前置步骤后,即可选择下面任意一种方式来配置 BANK OF AI API。 + +*** + +## 方案一:使用 settings.json(推荐) + +这种方式通过 Claude Code 自身的配置文件完成设置,无需修改系统环境变量。 + +### 操作步骤 + +1. 找到 Claude Code 安装目录中的 `settings.json` 文件。如果文件不存在,请手动创建一个新的。 +2. 添加以下内容: + +```json +{ + "env": { + "ANTHROPIC_AUTH_TOKEN": "你的-BANK-OF-AI-API-Key", + "ANTHROPIC_BASE_URL": "https://api.bankofai.io/", + "ANTHROPIC_MODEL": "claude-sonnet-4.6", + "API_TIMEOUT_MS": "3000000" + } +} +``` + +> **提示:** 你可以将 `ANTHROPIC_MODEL` 替换为[可用模型](#可用模型)列表中的任意模型。 + +3. 保存文件并重启终端。 +4. 执行以下命令验证配置: + +```bash +claude --version +claude +``` + +如果 Claude Code 可以正常启动,并且能够使用 BANK OF AI 模型返回结果,则说明配置完成。 + +*** + +## 方案二:使用环境变量 + +这种方式适用于需要全局生效配置的场景。 + +### 设置环境变量 + +将以下内容添加到对应 shell 的配置文件中: + +#### Bash(Linux / macOS) + +编辑 `~/.bashrc`(macOS 也可能是 `~/.bash_profile`): + +```bash +# Claude Code - BANK OF AI Provider Configuration +export ANTHROPIC_BASE_URL="https://api.bankofai.io/" +export ANTHROPIC_AUTH_TOKEN="your-api-key-here" +export ANTHROPIC_MODEL="claude-sonnet-4.6" +# End of BANK OF AI Provider Configuration +``` + +应用修改: + +```bash +source ~/.bashrc +``` + +#### Zsh(Linux / macOS) + +编辑 `~/.zshrc`: + +```bash +# Claude Code - BANK OF AI Provider Configuration +export ANTHROPIC_BASE_URL="https://api.bankofai.io/" +export ANTHROPIC_AUTH_TOKEN="your-api-key-here" +export ANTHROPIC_MODEL="claude-sonnet-4.6" +# End of BANK OF AI Provider Configuration +``` + +应用修改: + +```bash +source ~/.zshrc +``` + +#### PowerShell(Windows) + +编辑你的 `$PROFILE` 文件: + +```powershell +# Claude Code - BANK OF AI Provider Configuration +$env:ANTHROPIC_BASE_URL = "https://api.bankofai.io/" +$env:ANTHROPIC_AUTH_TOKEN = "your-api-key-here" +$env:ANTHROPIC_MODEL = "claude-sonnet-4.6" +# End of BANK OF AI Provider Configuration +``` + +应用修改: + +```powershell +. $PROFILE +``` + +#### 配置文件路径参考 + +| 操作系统 | Shell | 配置文件路径 | +| :----------: | :--------: | :-------------------------------- | +| Linux | Bash | `~/.bashrc` | +| Linux | Zsh | `~/.zshrc` | +| macOS | Bash | `~/.bashrc` 或 `~/.bash_profile` | +| macOS | Zsh | `~/.zshrc` | +| Windows | PowerShell | `$PROFILE` | + +### 验证配置 + +```bash +claude --version +claude +``` + +如果 Claude Code 可以正常启动,并且能够使用 BANK OF AI 模型返回结果,则说明配置完成。 + +*** + +## 切换模型 + +### 临时切换(仅当前会话生效) + +**Linux / macOS:** + +```bash +ANTHROPIC_MODEL=claude-opus-4.6 claude +``` + +**Windows PowerShell:** + +```powershell +$env:ANTHROPIC_MODEL="claude-opus-4.6"; claude +``` + +### 永久切换 + +修改 `settings.json` 或 shell 配置文件中的 `ANTHROPIC_MODEL` 值,然后重启终端或重新加载配置。 + +*** + +## 可用模型 + +| 模型名称 | 提供方 | +| :------------------ | :--------- | +| `claude-opus-4.6` | Anthropic | +| `claude-opus-4.5` | Anthropic | +| `claude-sonnet-4.6` | Anthropic | +| `claude-sonnet-4.5` | Anthropic | +| `claude-haiku-4.5` | Anthropic | +| `gpt-5.2` | OpenAI | +| `gpt-5-mini` | OpenAI | +| `gpt-5-nano` | OpenAI | +| `gemini-3.1-pro` | Google | +| `gemini-3-flash` | Google | +| `kimi-k2.5` | Moonshot | +| `glm-5` | Zhipu AI | +| `minimax-m2.5` | MiniMax | + +> 完整且最新的模型列表,请查询 BANK OF AI 提供的 Models API。 + +*** + +## 常见问题 + +
+Q:出现 “claude command not found” 怎么办? + +请先安装 Claude Code: + +- **Linux / macOS:** `curl -fsSL https://claude.ai/install.sh | bash` +- **Windows:** `irm https://claude.ai/install.ps1 | iex` + +安装完成后请重启终端。 + +
+ +
+Q:安装脚本执行失败,我应该检查什么? + +请确认以下几点: + +1. Claude Code 已正确安装(执行 `claude --version` 可以看到版本号) +2. 已安装 `curl`(Linux / macOS) +3. 网络可以访问 `https://api.bankofai.io/` + +如果问题仍然存在,可以尝试使用[方案二:使用环境变量](#方案二使用环境变量)进行手动配置。 + +
+ +
+Q:如何验证配置是否生效? + +可以检查环境变量是否已正确设置: + +**Linux / macOS:** + +```bash +echo $ANTHROPIC_BASE_URL +echo $ANTHROPIC_MODEL +``` + +**Windows PowerShell:** + +```powershell +$env:ANTHROPIC_BASE_URL +$env:ANTHROPIC_MODEL +``` + +
+ +
+Q:如何查看当前正在使用的模型? + +启动 Claude Code 后,输入: + +```text +/status +``` + +
+ +
+Q:为什么调用某些模型时会返回 403 access_denied? + +带有 **Premium** 标签的模型,如果你的 BANK OF AI 账户此前从未充值,可能会返回 `403 access_denied`。 + +仅有有效的 API Key 并不足以调用 Premium 模型。请先完成账户充值,然后再重试。 + +
+ +
+Q:如何移除 BANK OF AI provider 配置? + +编辑你的 shell 配置文件,删除以下注释块之间的内容: + +```bash +# Claude Code - BANK OF AI Provider Configuration +... +# End of BANK OF AI Provider Configuration +``` + +然后重新加载配置文件,例如: + +```bash +source ~/.zshrc +``` + +
+ +*** + +> **版本:** v1.0 | **最后更新:** 2026-03-27 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/introduction.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/introduction.md index 995f9af..74a1498 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/introduction.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/introduction.md @@ -1,19 +1,37 @@ # 欢迎使用 LLM Service + + ## 关于 LLM Service + + LLM Service 是 Bank of AI 生态中的专业 AI 服务模块,基于顶级区块链基础设施构建,致力于为用户提供高效、易用且富有创造力的 AI 交互体验。作为 Bank of AI 的核心 AI 基础设施,该服务结合区块链的去中心化、安全性与高效率,打造全新的 AI 服务模式。 + + 核心功能包括: + + - **多模型 AI 对话:** 集成多种行业领先的大语言模型(LLMs),用户可根据需求自由选择最合适的模型。 + - **强大的 AI 服务能力:** 提供完整的 AI API 服务,支持在 Bank of AI 框架内快速接入与集成。 + - **原生 Web3 体验:** 无缝集成主流 Web3 钱包,实现从登录到支付的一体化原生体验。 + + ## 为什么选择 LLM Service? + + 选择 LLM Service,即可同时享受区块链生态优势与高质量 AI 服务体验: + + - **多链生态优势:** 支持多链主流代币支付,具备快速确认与低手续费优势。 + - **低成本高效率:** 通过资源优化与高效链上交互,实现更具性价比的 AI 服务。 + - **安全与隐私保护:** 基于去中心化登录机制,用户仅需通过 Web3 钱包签名即可完成认证,保障交互过程的安全与隐私。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/quick-start.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/quick-start.md index 72a3d56..8658aee 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/quick-start.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/llmservice/quick-start.md @@ -1,40 +1,82 @@ # 快速开始 + + 本章节将引导你在 Bank of AI 平台上完成 LLM Service 的初始配置,快速开启 AI 使用体验。 + + ## 1. 连接钱包 + + LLM Service 采用去中心化登录方式,支持通过 Web3 钱包进行授权登录,无需用户名和密码,安全便捷。 + + ### 登录步骤: + + 1. 访问 [Bank of AI 对话平台](https://chat.bankofai.io/chat) + 2. 点击右上角 **登录** + 3. 选择你的钱包并授权连接 + 4. 在钱包中确认签名完成登录 + + 登录成功后,右上角会显示你的钱包地址。 + + > 注意:请确保浏览器或移动设备中已安装兼容的 Web3 钱包,并妥善保管助记词和私钥。 + + --- + + ## 2. 开始首次对话 + + 进入平台后即可直接使用 LLM Service 进行 AI 交互。 + + - **选择模型:** 点击当前模型名称,从列表中选择需要使用的模型(如 GPT、Claude、Gemini 等) + - **发送消息:** 在输入框输入内容,点击发送按钮或按 Enter + - **多轮对话:** 支持连续上下文对话,AI 会根据历史内容进行响应 + + --- + + ## 3. 余额与使用 + + LLM Service 采用积分(Credits)计费,通过链上支付获取。 + + - **充值入口:** 在控制台页面进入 **充值** + - **购买积分:** 使用支持的链上代币支付,在钱包中确认交易 + - **自动到账:** 区块链交易确认后,系统会自动为账户增加对应积分 + + 完成以上步骤后,你即可使用多种主流 AI 模型。 + + + diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/sidebars.js b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/sidebars.js index 57c9530..f1b4914 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/sidebars.js +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/sidebars.js @@ -233,6 +233,12 @@ const sidebars = { collapsed: true, items: ['llmservice/openclaw/integration-guide', 'llmservice/openclaw/one-click-script-tutorial'], }, + { + type: 'category', + label: 'Claude Code', + collapsed: true, + items: ['llmservice/Claude-Code/claudecode-bankofai-api-configuration-guide'], + }, { type: 'category', label: 'API', diff --git a/package.json b/package.json index da1a7c2..17f3a9c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@x402-tron/docs", - "version": "1.2.8", + "version": "1.2.9", "description": "x402-tron documentation", "license": "MIT", "scripts": { diff --git a/sidebars.js b/sidebars.js index ccb7e0f..59d14f0 100644 --- a/sidebars.js +++ b/sidebars.js @@ -230,6 +230,12 @@ const sidebars = { collapsed: true, items: ['llmservice/openclaw/integration-guide', 'llmservice/openclaw/one-click-script-tutorial'], }, + { + type: 'category', + label: 'Claude Code', + collapsed: true, + items: ['llmservice/Claude-Code/claudecode-bankofai-api-configuration-guide'], + }, { type: 'category', label: 'API',