alchemy-api

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Alchemy API (with API Key)

Alchemy API(使用 API Key)

Reference and integration guide for wiring Alchemy APIs into application code using a standard API key. This file alone is enough to ship a basic integration; the
references/
directory contains deeper coverage of every product surface.
使用标准 API Key 将 Alchemy API 接入应用程序代码的参考与集成指南。仅凭本文件即可交付基础集成;
references/
目录则提供了所有产品领域的深入说明。

When to use this skill

何时使用此 Skill

Use
alchemy-api
when all of the following are true:
  • The user is wiring Alchemy into application code (server, backend, dApp, worker, script) that runs outside the current agent session
  • They have, or are willing to create, an Alchemy API key (free at dashboard.alchemy.com)
This is the preferred app-integration path for normal server/backend usage.
当满足以下所有条件时,使用
alchemy-api
:
  • 用户正在将 Alchemy 接入在当前 Agent 会话之外运行的应用程序代码(服务器、后端、dApp、Worker、脚本)
  • 用户已经拥有或愿意创建 Alchemy API Key(可在 dashboard.alchemy.com 免费获取)
对于常规服务器/后端场景,这是首选的应用集成路径。

When to use a different skill

何时使用其他 Skill

SituationUse this skill instead
Live agent work in this session (queries, admin, on-machine automation) and
@alchemy/cli
is installed locally — or both CLI and MCP are available
alchemy-cli
Live agent work in this session and only MCP is wired into the client (no CLI)
alchemy-mcp
Live agent work and neither is availableinstall
alchemy-cli
and use
alchemy-cli
Application code without an API key — autonomous agent paying per-request, or user explicitly wants x402/MPP
agentic-gateway
Do not use this skill to run ad-hoc live queries from inside the agent session — that's the
alchemy-cli
/
alchemy-mcp
path. This skill is for code that ships.
情况改用此 Skill
在当前会话中执行实时 Agent 工作(查询、管理操作、本机自动化),且本地已安装
@alchemy/cli
——或 CLI 与 MCP 均可用
alchemy-cli
在当前会话中执行实时 Agent 工作,但客户端仅接入 MCP(无 CLI)
alchemy-mcp
在当前会话中执行实时 Agent 工作,但两者均不可用安装
alchemy-cli
并使用
alchemy-cli
无 API Key 的应用程序代码——自主 Agent 按请求付费,或用户明确要求使用 x402/MPP
agentic-gateway
不要使用此 Skill 在 Agent 会话内执行临时实时查询——这类任务应使用
alchemy-cli
/
alchemy-mcp
路径。此 Skill 专用于可交付的代码。

Mandatory preflight gate

强制预检门禁

Before writing application code or making any network call:
  1. Confirm the user is building application code (not asking the agent to run a live query). If the user is asking for live work, redirect to
    alchemy-cli
    (preferred) or
    alchemy-mcp
    .
  2. Check
    $ALCHEMY_API_KEY
    is set (e.g.
    echo $ALCHEMY_API_KEY
    ).
  3. If
    $ALCHEMY_API_KEY
    is unset or empty, take the first of these that applies:
    • CLI bridge (recommended if
      @alchemy/cli
      is installed locally):
      the CLI can fetch a key from the user's Alchemy account so they never have to leave the terminal. See Bridging from the CLI to an API key below.
    • Tell the user they can create a free API key at https://dashboard.alchemy.com/, or
    • Switch to the
      agentic-gateway
      skill (x402/MPP gateway, wallet-based auth, no API key needed).
You MUST NOT call any keyless or public fallback (including
.../v2/demo
) unless the user explicitly asks for that endpoint. No public RPC endpoints (publicnode, llamarpc, cloudflare-eth, etc.) as a fallback.
在编写应用程序代码或发起任何网络调用之前:
  1. 确认用户是在构建应用程序代码(而不是要求 Agent 执行实时查询)。如果用户要求执行实时任务,则转交给
    alchemy-cli
    (首选)或
    alchemy-mcp
    。
  2. 检查
    $ALCHEMY_API_KEY
    是否已设置(例如
    echo $ALCHEMY_API_KEY
    )。
  3. 如果
    $ALCHEMY_API_KEY
    未设置或为空,则采用以下方案中适用的第一个:
    • CLI 桥接(当本地已安装
      @alchemy/cli
      时推荐):
      CLI 可以从用户的 Alchemy 账户获取 Key,因此用户无需离开终端。详见下方从 CLI 桥接到 API Key。
    • 告知用户可以在 https://dashboard.alchemy.com/ 创建免费 API Key;或者
    • 切换到
      agentic-gateway
      Skill(x402/MPP 网关、基于钱包的鉴权、无需 API Key)。
除非用户明确要求使用无密钥或公共回退端点(包括
.../v2/demo
),否则不得调用任何无密钥或公共回退端点。也不得使用公共 RPC 端点(publicnode、llamarpc、cloudflare-eth 等)作为回退方案。

Bridging from the CLI to an API key

从 CLI 桥接到 API Key

If
@alchemy/cli
is installed locally (verify with
command -v alchemy
), use it to obtain a key without leaving the terminal and persist it to the project's
.env
file
so it survives across terminal sessions and is available to the app at runtime.
Security: NEVER echo, print, or otherwise surface the extracted API key value in conversation output. Refer to it only as
$ALCHEMY_API_KEY
after exporting. Treat it the same as a password.
bash
undefined
如果本地已安装
@alchemy/cli
(通过
command -v alchemy
验证),可以使用它获取 Key 而无需离开终端,并将其持久化到项目的
.env
文件
,以便跨终端会话保留,并在应用运行时可用。
安全要求: 切勿在对话输出中回显、打印或以其他方式暴露提取到的 API Key 值。导出后,仅将其引用为
$ALCHEMY_API_KEY
。应将其视为密码。
bash
undefined

1. Try to read a cached key from the CLI config (read-only, safe to run non-interactively).

1. Try to read a cached key from the CLI config (read-only, safe to run non-interactively).

KEY="$(alchemy --no-interactive --json --reveal config get api-key 2>/dev/null | jq -r .value)"
KEY="$(alchemy --no-interactive --json --reveal config get api-key 2>/dev/null | jq -r .value)"

2. If empty/null (no key cached yet), run the interactive flow.

2. If empty/null (no key cached yet), run the interactive flow.

Note: auth login opens a browser and apps select shows a picker, so do NOT pass

Note: auth login opens a browser and apps select shows a picker, so do NOT pass

--no-interactive here. If you already know the app id, pass it explicitly to skip

--no-interactive here. If you already know the app id, pass it explicitly to skip

the picker:
alchemy --no-interactive --json apps select <id>
.

the picker:
alchemy --no-interactive --json apps select <id>
.

if [ -z "$KEY" ] || [ "$KEY" = "null" ]; then alchemy auth login # opens browser; derives auth credentials alchemy --json apps select # interactive picker (omit --no-interactive so it can render) KEY="$(alchemy --no-interactive --json --reveal config get api-key | jq -r .value)" fi
if [ -z "$KEY" ] || [ "$KEY" = "null" ]; then alchemy auth login # opens browser; derives auth credentials alchemy --json apps select # interactive picker (omit --no-interactive so it can render) KEY="$(alchemy --no-interactive --json --reveal config get api-key | jq -r .value)" fi

3. Persist to the project's .env (standard practice for app code so the key

3. Persist to the project's .env (standard practice for app code so the key

survives terminal restarts and is loaded by dotenv / framework env loaders).

survives terminal restarts and is loaded by dotenv / framework env loaders).

Use .env.local instead if your framework expects that (e.g. Next.js).

Use .env.local instead if your framework expects that (e.g. Next.js).

ENV_FILE=".env" # or ".env.local" depending on the project convention touch "$ENV_FILE" if grep -q '^ALCHEMY_API_KEY=' "$ENV_FILE"; then

Replace existing line in-place (portable across BSD/GNU sed)

sed -i.bak "s|^ALCHEMY_API_KEY=.*|ALCHEMY_API_KEY=$KEY|" "$ENV_FILE" && rm "$ENV_FILE.bak" else echo "ALCHEMY_API_KEY=$KEY" >> "$ENV_FILE" fi
ENV_FILE=".env" # or .env.local depending on the project convention touch "$ENV_FILE" if grep -q '^ALCHEMY_API_KEY=' "$ENV_FILE"; then

Replace existing line in-place (portable across BSD/GNU sed)

sed -i.bak "s|^ALCHEMY_API_KEY=.*|ALCHEMY_API_KEY=$KEY|" "$ENV_FILE" && rm "$ENV_FILE.bak" else echo "ALCHEMY_API_KEY=$KEY" >> "$ENV_FILE" fi

4. Make sure the env file is git-ignored.

4. Make sure the env file is git-ignored.

grep -qxF "$ENV_FILE" .gitignore 2>/dev/null || echo "$ENV_FILE" >> .gitignore
grep -qxF "$ENV_FILE" .gitignore 2>/dev/null || echo "$ENV_FILE" >> .gitignore

5. Also export to the current shell so the agent can immediately call the API.

5. Also export to the current shell so the agent can immediately call the API.

export ALCHEMY_API_KEY="$KEY"

> **Why we persist to `.env`:** without it, the key is only set for the current shell session and disappears when the terminal tab closes. App code typically loads `.env` via `dotenv` (Node), `python-dotenv` (Python), `direnv`, or framework-native loaders (Next.js, Vite, Bun, Deno, Rails, etc.), so writing to `.env` is the canonical way to make the key durable for both `npm run dev` and the deployed app's local copy.

> **Why this whole flow works:** the CLI is a runtime executor (`alchemy-cli` skill). When the user has it installed, you can use it to provision the credential that this app-code skill needs, write it to a place the application will load, then hand off to the rest of the `alchemy-api` flow. After step 5, continue with the [Base URLs + auth](#base-urls--auth-cheat-sheet) and [Quickstart](#one-file-quickstart-copypaste) below.

> **Gotcha:** if `auth login` succeeded but `config get api-key` still returns "not found," the CLI's `setup status` may have falsely reported `complete: true` with only an `auth_token`. Re-run `alchemy --json apps select` (or pass an explicit `<id>` with `--no-interactive`) to bind a default app, then retry. See the `alchemy-cli` skill for the same gotcha documented under Preflight.
export ALCHEMY_API_KEY="$KEY"

> **为什么持久化到 `.env`:** 如果不进行持久化,Key 只会在当前 Shell 会话中设置,并在关闭终端标签页后消失。应用程序代码通常会通过 `dotenv`(Node)、`python-dotenv`(Python)、`direnv` 或框架原生加载器(Next.js、Vite、Bun、Deno、Rails 等)从 `.env` 加载配置,因此将 Key 持久化到 `.env` 是确保其在 `npm run dev` 以及已部署应用的本地副本中均可用的标准方式。

> **整个流程之所以有效的原因:** CLI 是一个运行时执行器(`alchemy-cli` Skill)。当用户已安装 CLI 时,可以使用它配置此应用程序代码 Skill 所需的凭据,将凭据写入应用程序会加载的位置,然后继续执行其余 `alchemy-api` 流程。完成第 5 步后,继续阅读[基础 URL 与鉴权速查表](#基础-url-与鉴权速查表)和[单文件快速入门](#单文件快速入门复制粘贴)。

> **常见问题:** 如果 `auth login` 成功,但 `config get api-key` 仍返回“not found”,则 CLI 的 `setup status` 可能仅因存在 `auth_token` 而错误报告 `complete: true`。重新运行 `alchemy --json apps select`(或使用 `--no-interactive` 显式传入 `<id>`)以绑定默认应用,然后重试。`alchemy-cli` Skill 的 Preflight 部分记录了相同问题。

Summary

概述

A self-contained guide for AI agents integrating Alchemy APIs using an API key. This file alone should be enough to ship a basic integration. Use the reference files for depth, edge cases, and advanced workflows.
Developers can always create a free API key at https://dashboard.alchemy.com/.
这是一份面向使用 API Key 集成 Alchemy API 的 AI Agent 的独立指南。仅凭本文件应足以交付基础集成。深度内容、边缘情况和高级工作流请参阅参考文件。
开发者始终可以在 https://dashboard.alchemy.com/ 创建免费 API Key。

Do this first

优先执行以下步骤

  1. Confirm app-integration scope (see Mandatory preflight gate).
  2. Choose the right product using the Endpoint selector below.
  3. Use the Base URLs + auth table for the correct endpoint and headers.
  4. Copy a Quickstart example and test against a testnet first.
  1. 确认应用集成范围(参见强制预检门禁)。
  2. 使用下方的端点选择器(常见任务)选择正确的产品。
  3. 使用基础 URL 与鉴权速查表获取正确的端点和请求头。
  4. 复制一份单文件快速入门示例,并首先在测试网上进行测试。

Base URLs + auth (cheat sheet)

基础 URL 与鉴权速查表

ProductBase URLAuthNotes
Ethereum RPC (HTTPS)
https://eth-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
API key in URLStandard EVM reads and writes.
Ethereum RPC (WSS)
wss://eth-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
API key in URLSubscriptions and realtime.
Base RPC (HTTPS)
https://base-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
API key in URLEVM L2.
Base RPC (WSS)
wss://base-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
API key in URLSubscriptions and realtime.
Arbitrum RPC (HTTPS)
https://arb-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
API key in URLEVM L2.
Arbitrum RPC (WSS)
wss://arb-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
API key in URLSubscriptions and realtime.
BNB RPC (HTTPS)
https://bnb-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
API key in URLEVM L1.
BNB RPC (WSS)
wss://bnb-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
API key in URLSubscriptions and realtime.
Solana RPC (HTTPS)
https://solana-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
API key in URLSolana JSON-RPC.
Solana Yellowstone gRPC
https://solana-mainnet.g.alchemy.com
X-Token: $ALCHEMY_API_KEY
gRPC streaming (Yellowstone).
Sui gRPC
sui-mainnet.g.alchemy.com:443
Authorization: Bearer $ALCHEMY_API_KEY
Sui gRPC API (objects, txs, balances, streaming).
Notify API
https://dashboard.alchemy.com/api
X-Alchemy-Token: <ALCHEMY_NOTIFY_AUTH_TOKEN>
Generate token in dashboard.
产品基础 URL鉴权备注
Ethereum RPC(HTTPS)
https://eth-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
URL 中包含 API Key标准 EVM 读写。
Ethereum RPC(WSS)
wss://eth-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
URL 中包含 API Key订阅与实时数据。
Base RPC(HTTPS)
https://base-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
URL 中包含 API KeyEVM L2。
Base RPC(WSS)
wss://base-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
URL 中包含 API Key订阅与实时数据。
Arbitrum RPC(HTTPS)
https://arb-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
URL 中包含 API KeyEVM L2。
Arbitrum RPC(WSS)
wss://arb-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
URL 中包含 API Key订阅与实时数据。
BNB RPC(HTTPS)
https://bnb-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
URL 中包含 API KeyEVM L1。
BNB RPC(WSS)
wss://bnb-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
URL 中包含 API Key订阅与实时数据。
Solana RPC(HTTPS)
https://solana-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY
URL 中包含 API KeySolana JSON-RPC。
Solana Yellowstone gRPC
https://solana-mainnet.g.alchemy.com
X-Token: $ALCHEMY_API_KEY
gRPC 流式传输(Yellowstone)。
Sui gRPC
sui-mainnet.g.alchemy.com:443
Authorization: Bearer $ALCHEMY_API_KEY
Sui gRPC API(对象、交易、余额、流式传输)。
Notify API
https://dashboard.alchemy.com/api
X-Alchemy-Token: <ALCHEMY_NOTIFY_AUTH_TOKEN>
在控制台中生成 Token。

Endpoint selector (top tasks)

端点选择器(常见任务)

You needUse thisSkill / file
EVM read/writeJSON-RPC
eth_*
references/node-json-rpc.md
Realtime events
eth_subscribe
references/node-websocket-subscriptions.md
Simulate tx
alchemy_simulateAssetChanges
references/data-simulation-api.md
Create webhook
POST /create-webhook
references/webhooks-details.md
Solana DAS
getAssetsByOwner
(DAS)
references/solana-das-api.md
Sui objects/txs
GetObject
,
GetTransaction
(gRPC)
references/sui-grpc-objects-and-ledger.md
Sui balances
GetBalance
,
ListBalances
(gRPC)
references/sui-grpc-state-and-balances.md
Sui checkpoints stream
SubscribeCheckpoints
(gRPC)
references/sui-grpc-subscriptions.md
需求使用Skill / 文件
EVM 读写JSON-RPC
eth_*
references/node-json-rpc.md
实时事件
eth_subscribe
references/node-websocket-subscriptions.md
模拟交易
alchemy_simulateAssetChanges
references/data-simulation-api.md
创建 Webhook
POST /create-webhook
references/webhooks-details.md
Solana DAS
getAssetsByOwner
(DAS)
references/solana-das-api.md
Sui 对象/交易
GetObject
、
GetTransaction
(gRPC)
references/sui-grpc-objects-and-ledger.md
Sui 余额
GetBalance
、
ListBalances
(gRPC)
references/sui-grpc-state-and-balances.md
Sui 检查点流
SubscribeCheckpoints
(gRPC)
references/sui-grpc-subscriptions.md

One-file quickstart (copy/paste)

单文件快速入门(复制粘贴)

No API key? Use the
agentic-gateway
skill instead. Replace API-key URLs with
https://x402.alchemy.com/eth-mainnet/v2
and add
Authorization: SIWE <token>
(or
SIWS <token>
for a Solana wallet). See the
agentic-gateway
skill for setup.
没有 API Key? 改用
agentic-gateway
Skill。将 API Key URL 替换为
https://x402.alchemy.com/eth-mainnet/v2
,并添加
Authorization: SIWE <token>
(Solana 钱包使用
SIWS <token>
)。有关设置,请参阅
agentic-gateway
Skill。

EVM JSON-RPC (read)

EVM JSON-RPC(读取)

bash
curl -s https://eth-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
bash
curl -s https://eth-mainnet.g.alchemy.com/v2/$ALCHEMY_API_KEY \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'

Create Notify webhook

创建 Notify Webhook

bash
curl -s -X POST "https://dashboard.alchemy.com/api/create-webhook" \
  -H "Content-Type: application/json" \
  -H "X-Alchemy-Token: $ALCHEMY_NOTIFY_AUTH_TOKEN" \
  -d '{"network":"ETH_MAINNET","webhook_type":"ADDRESS_ACTIVITY","webhook_url":"https://example.com/webhook","addresses":["0x00000000219ab540356cbb839cbe05303d7705fa"]}'
bash
curl -s -X POST "https://dashboard.alchemy.com/api/create-webhook" \
  -H "Content-Type: application/json" \
  -H "X-Alchemy-Token: $ALCHEMY_NOTIFY_AUTH_TOKEN" \
  -d '{"network":"ETH_MAINNET","webhook_type":"ADDRESS_ACTIVITY","webhook_url":"https://example.com/webhook","addresses":["0x00000000219ab540356cbb839cbe05303d7705fa"]}'

Verify webhook signature (Node)

验证 Webhook 签名(Node)

ts
import crypto from "crypto";

export function verify(rawBody: string, signature: string, secret: string) {
  const hmac = crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
  return crypto.timingSafeEqual(Buffer.from(hmac), Buffer.from(signature));
}
ts
import crypto from "crypto";

export function verify(rawBody: string, signature: string, secret: string) {
  const hmac = crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
  return crypto.timingSafeEqual(Buffer.from(hmac), Buffer.from(signature));
}

Network naming rules

网络命名规则

  • JSON-RPC and most APIs use lowercase network enums like
    eth-mainnet
    .
  • Notify API uses uppercase enums like
    ETH_MAINNET
    .
  • JSON-RPC 和大多数 API 使用小写网络枚举,例如
    eth-mainnet
    。
  • Notify API 使用大写枚举,例如
    ETH_MAINNET
    。

Common token addresses

常用代币地址

TokenChainAddress
ETHethereum
0x0000000000000000000000000000000000000000
WETHethereum
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
USDCethereum
0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eB48
USDCbase
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
代币链地址
ETHethereum
0x0000000000000000000000000000000000000000
WETHethereum
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
USDCethereum
0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eB48
USDCbase
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

Failure modes + retries

失败模式与重试

  • HTTP
    429
    means rate limit. Use exponential backoff with jitter.
  • JSON-RPC errors come in
    error
    fields even with HTTP 200.
  • Use
    pageKey
    to resume pagination after failures.
  • De-dupe websocket events on reconnect.
  • HTTP
    429
    表示触发速率限制。使用带抖动的指数退避。
  • 即使 HTTP 状态码为 200,JSON-RPC 错误也会出现在
    error
    字段中。
  • 失败后使用
    pageKey
    恢复分页。
  • 重连后对 WebSocket 事件去重。

Skill map

Skill 地图

For the complete reference index organized by product area, see
references/skill-map.md
.
Quick category overview:
  • Node: JSON-RPC, WebSocket, Debug, Trace, Enhanced APIs, Utility
  • Webhooks: Address Activity, Custom (GraphQL), NFT Activity, Payloads, Signatures
  • Solana: JSON-RPC, DAS, Yellowstone gRPC (streaming), Wallets
  • Sui gRPC: Objects, Transactions, Balances, Move Packages, Name Service, Subscriptions, Signature Verification
  • Wallets: Account Kit, Bundler, Gas Manager, Wallet APIs (formerly "Smart Wallets")
  • Rollups: L2/L3 deployment overview
  • Recipes: simulation, pending tx subscriptions, webhook flows
  • Operational: Auth, Rate Limits, Best Practices
有关按产品领域组织的完整参考索引,请参阅
references/skill-map.md
。
分类快速概览:
  • Node:JSON-RPC、WebSocket、Debug、Trace、Enhanced APIs、Utility
  • Webhooks:Address Activity、Custom (GraphQL)、NFT Activity、Payloads、Signatures
  • Solana:JSON-RPC、DAS、Yellowstone gRPC(流式传输)、Wallets
  • Sui gRPC:Objects、Transactions、Balances、Move Packages、Name Service、Subscriptions、Signature Verification
  • Wallets:Account Kit、Bundler、Gas Manager、Wallet APIs(原名为 “Smart Wallets”)
  • Rollups:L2/L3 部署概览
  • Recipes:模拟交易、待处理交易订阅、Webhook 流程
  • Operational:鉴权、速率限制、最佳实践

Handing off to other skills

转交给其他 Skill

The user wants to...Hand off to
Run a one-off live query, admin command, or on-machine automation in this session (CLI installed)
alchemy-cli
Run a one-off live query in this session (only MCP wired in)
alchemy-mcp
Build app code without an API key (autonomous agent, or explicit x402/MPP)
agentic-gateway
用户希望……转交给
在当前会话中运行一次性实时查询、管理命令或本机自动化(已安装 CLI)
alchemy-cli
在当前会话中运行一次性实时查询(仅接入 MCP)
alchemy-mcp
构建无 API Key 的应用程序代码(自主 Agent,或明确要求使用 x402/MPP)
agentic-gateway

Troubleshooting

故障排除

API key not working

API Key 不生效

  • Verify
    $ALCHEMY_API_KEY
    is set:
    echo $ALCHEMY_API_KEY
  • Confirm the key is valid at dashboard.alchemy.com
  • Check if allowlists restrict the key to specific IPs/domains (see
    references/operational-allowlists.md
    )
  • 验证
    $ALCHEMY_API_KEY
    是否已设置:
    echo $ALCHEMY_API_KEY
  • 确认 Key 在 dashboard.alchemy.com 中有效
  • 检查 allowlist 是否将 Key 限制到特定 IP/域名(参阅
    references/operational-allowlists.md
    )

HTTP 429 (rate limited)

HTTP 429(触发速率限制)

  • Use exponential backoff with jitter before retrying
  • Check your compute unit budget in the Alchemy dashboard
  • See
    references/operational-rate-limits-and-compute-units.md
    for limits per plan
  • 重试前使用带抖动的指数退避
  • 在 Alchemy 控制台中检查计算单元额度
  • 参阅
    references/operational-rate-limits-and-compute-units.md
    了解各套餐的限制

Wrong network slug

网络标识符错误

  • JSON-RPC and most APIs use lowercase:
    eth-mainnet
    ,
    base-mainnet
  • Notify API uses uppercase:
    ETH_MAINNET
    ,
    BASE_MAINNET
  • See
    references/operational-supported-networks.md
    for the full list
  • JSON-RPC 和大多数 API 使用小写格式:
    eth-mainnet
    、
    base-mainnet
  • Notify API 使用大写格式:
    ETH_MAINNET
    、
    BASE_MAINNET
  • 完整列表参见
    references/operational-supported-networks.md

JSON-RPC error with HTTP 200

HTTP 200 下的 JSON-RPC 错误

  • Alchemy returns JSON-RPC errors inside the
    error
    field even with a 200 status code
  • Always check
    response.error
    in addition to HTTP status
  • 即使状态码为 200,Alchemy 仍会在
    error
    字段中返回 JSON-RPC 错误
  • 除检查 HTTP 状态外,始终检查
    response.error

Official links

官方链接