On this page本文目录
TL;DR: choose by platform gravity, then prove it with your trafficTL;DR:先按平台重心筛选,再用真实流量证明
Choose Cloudflare AI Gateway when edge policy, exact-match caching, per-request log controls, explicit rate or budget branches, and versioned dynamic routes are central to the design. Choose Vercel AI Gateway when the team values AI SDK integration, a unified creator/model catalog, automatic provider selection, Vercel OIDC, and app-platform observability. If neither advantage is material, keep an OpenAI-compatible adapter and decide with a seven-day shadow test—not a feature-count contest.
选择 Cloudflare AI Gateway:当边缘策略、精确匹配缓存、逐请求日志控制、显式限额分支和版本化动态路由是核心需求。选择 Vercel AI Gateway:当团队更重视 AI SDK、统一 creator/model 目录、自动 Provider 选择、Vercel OIDC 和应用平台可观测性。如果两边优势都不明显,就保留 OpenAI-compatible 适配层,用 7 天影子流量测试决定,而不是只比功能数量。
Traffic shaping, cache controls, request-level log behavior, and visual or JSON dynamic routes.
流量整形、缓存控制、逐请求日志行为,以及可视化或 JSON 动态路由。
AI SDK, unified model access, automatic provider selection, OIDC, budgets, and app-adjacent observability.
AI SDK、统一模型访问、自动 Provider 选择、OIDC、预算和贴近应用的可观测性。
One warm request says little about p95 latency, throttling, provider fallback, or regional behavior.
一次热请求无法说明 p95 延迟、限流、Provider 回退或区域差异。
Keep gateway URLs, credentials, model aliases, routing policy, and log parsing outside business logic.
把 Gateway URL、凭证、模型别名、路由策略和日志解析放在业务逻辑之外。
What this comparison must help you decide这篇对比真正要帮你决定什么
People searching “Cloudflare vs Vercel AI Gateway” usually already understand the category. They need to know which gateway fits their stack, whether current APIs are compatible, how routing and caching actually behave, what gets logged, how costs are composed, and whether migration is reversible. Marketing summaries do not answer those questions; an executable decision contract does.
搜索“Cloudflare vs Vercel AI Gateway”的用户通常已经知道 AI Gateway 是什么。他们真正关心:哪个更适合现有技术栈、当前 API 是否兼容、路由与缓存如何工作、哪些内容会进入日志、成本如何组成,以及迁移是否可回滚。营销式摘要回答不了这些问题,可执行的决策契约可以。
Who this guide is for and prerequisites适用人群与前置条件
This guide is for teams moving from direct provider calls, standardizing several model vendors, or choosing a gateway for an AI application already deployed on Cloudflare or Vercel.
本指南适合从模型厂商直连迁移、统一多个模型供应商,或为已部署在 Cloudflare / Vercel 上的 AI 应用选择 Gateway 的团队。
- One representative model and one fallback model with access confirmed on both candidates.确定一个代表性模型和一个回退模型,并确认两边都可访问。
- A fixed prompt set containing short, long, streaming, tool-call, structured-output, and safety-sensitive cases.固定 Prompt 集,包含短文本、长文本、Streaming、Tool Call、Structured Output 和敏感场景。
- Server-side secrets, a request ID, tenant identity, timeout budget, and a redaction policy.服务端 Secret、Request ID、租户身份、超时预算和脱敏策略。
- Success thresholds for p95 latency, error rate, fallback rate, output validity, and cost per accepted response.预先定义 p95 延迟、错误率、回退率、输出有效率和每个有效响应成本阈值。
Decision matrix: when each gateway is the stronger default决策矩阵:什么情况下哪一方更适合作为默认选择
| Your dominant requirement主导需求 | Stronger starting point更合适的起点 | Why原因 | Prove before launch上线前证明 |
|---|---|---|---|
| Edge-first traffic policy边缘优先流量策略 | Cloudflare | Dynamic routes expose conditions, percentage splits, rate limits, budget limits, retries, and fallbacks as versioned flows.Dynamic Route 把条件、百分比分流、限流、预算、重试和回退表达为版本化 Flow。 | Rule evaluation, route rollback, region-level p95规则执行、路由回滚、分区域 p95 |
| Next.js / AI SDK workflowNext.js / AI SDK 工作流 | Vercel | The gateway is designed around AI SDK plus OpenAI, Responses, and Anthropic-compatible access.Gateway 围绕 AI SDK 以及 OpenAI、Responses、Anthropic-compatible 接入设计。 | Local, preview, and production auth; streaming parity本地、Preview、Production 认证及 Streaming 一致性 |
| Exact-match prompt caching精确匹配 Prompt 缓存 | Cloudflare | Documented cache keys and per-request cache overrides make behavior explicit.官方说明 Cache Key 与逐请求 Override,行为更显式。 | Key completeness, stale-answer risk, measured hit rateKey 完整性、陈旧答案风险、实测命中率 |
| Unified catalog and provider selection统一目录与 Provider 选择 | Vercel | Creator/model IDs, a model endpoint, and automatic provider selection reduce application-side vendor wiring.creator/model ID、模型目录端点和自动 Provider 选择减少应用侧接线。 | Model availability, provider allowlist, fallback trace模型可用性、Provider Allowlist、回退轨迹 |
| Per-request prompt log suppression逐请求禁止记录 Prompt | Cloudflare | Documented headers can disable the full log or retain metadata without payload bodies.官方 Header 可关闭整条日志,或只保留元数据、不保存请求/响应正文。 | Inspect the resulting record; test retention and access检查实际日志记录,并测试保留期与访问权限 |
| Avoid platform lock-in降低平台锁定 | Neutral adapter | Both expose OpenAI-compatible paths, but policies, model names, auth, and telemetry still differ.两边都有 OpenAI-compatible 路径,但策略、模型名、认证和遥测仍不同。 | Dual-run test and one-command rollback双跑测试与一键回滚 |
Architecture: keep gateway policy out of business logic架构:不要把 Gateway 策略写进业务逻辑
Normalize messages, tools, structured-output schema, streaming, timeout, tenant, and request ID.
统一 Messages、Tools、Structured Output Schema、Streaming、Timeout、Tenant 和 Request ID。
Application code asks for fast, balanced, or reasoning; deployment configuration resolves the current gateway model ID.
应用只请求 fast、balanced 或 reasoning,由部署配置解析为当前 Gateway 的模型 ID。
Translate credentials, provider order, cache eligibility, log controls, retry budget, and gateway metadata.
转换凭证、Provider 顺序、缓存资格、日志控制、重试预算和 Gateway Metadata。
Return output plus gateway, provider, model, request ID, timing, token usage, cache status, fallback path, and policy version.
返回输出,并保留 Gateway、Provider、Model、Request ID、耗时、Token、Cache Status、Fallback Path 和 Policy Version。
Only count schema-valid, policy-compliant responses; raw HTTP success is not a successful business result.
只统计 Schema 有效且满足策略的响应;HTTP 成功不等于业务成功。
Cloudflare vs Vercel AI Gateway: current capability comparisonCloudflare 与 Vercel AI Gateway 当前能力对比
| Area维度 | Cloudflare AI Gateway | Vercel AI Gateway | Decision implication决策含义 |
|---|---|---|---|
| Primary API主要 API | Cloudflare REST API and OpenAI-compatible chat/responses; provider-specific paths also existCloudflare REST API 与 OpenAI-compatible Chat/Responses;也有 Provider-specific Path | Unified endpoint for AI SDK, OpenAI Chat/Responses, Anthropic Messages, and other clients统一端点支持 AI SDK、OpenAI Chat/Responses、Anthropic Messages 等客户端 | Both can sit behind an adapter; do not assume identical extensions.两者都可置于适配层后,但扩展字段并不完全相同。 |
| Routing路由 | Versioned Dynamic Routes with condition, percentage, rate, budget, model, retry, and fallback nodes版本化 Dynamic Route,包含条件、百分比、限流、预算、模型、重试和回退节点 | Automatic provider selection plus request-level order/only policies, timeouts, and model fallback自动 Provider 选择,并支持逐请求 order/only、Timeout 与 Model Fallback | Cloudflare exposes a flow; Vercel emphasizes model/provider policy inside the app workflow.Cloudflare 更像显式 Flow;Vercel 更强调应用工作流中的 Model/Provider Policy。 |
| Caching缓存 | Exact-match text and image cache with documented key inputs and request overrides文本与图片精确匹配缓存,官方说明 Key 构成和 Request Override | Gateway/provider caching controls are available through provider options可通过 Provider Options 控制 Gateway/Provider Caching | Compare semantic safety and measured hit rate, not the checkbox.比较语义安全与实测命中率,而不是功能勾选。 |
| Authentication认证 | Cloudflare API token for REST; provider credentials, stored keys, or Unified Billing depend on pathREST 使用 Cloudflare API Token;不同路径可使用 Provider Credential、Stored Key 或 Unified Billing | AI Gateway API key everywhere; Vercel OIDC can be automatic on Vercel; team BYOK supported通用 AI Gateway API Key;Vercel 上可自动使用 OIDC;支持 Team BYOK | Test local, CI, preview, and production separately.分别测试本地、CI、Preview 与 Production。 |
| Observability可观测性 | Analytics and detailed logs with configurable payload collection; retention and export depend on planAnalytics 与详细日志,可控制 Payload 收集;保留期与导出取决于套餐 | Gateway usage, events, budgets, and Vercel observability integrationsGateway Usage、Event、Budget 与 Vercel 可观测性集成 | Build your own normalized event envelope for cross-gateway comparison.建立自己的标准事件 Envelope,才能跨 Gateway 比较。 |
| Billing posture计费方式 | Core gateway features documented as free; Unified Billing adds a credit fee; provider inference is passed through核心 Gateway 功能官方标为免费;Unified Billing 收取 Credit Fee;Provider Inference 透传 | Credit-based gateway billing and BYOK paths; current pricing should be verified at purchase timeCredit-based Gateway Billing 与 BYOK 路径;采购时需核对最新价格 | Model cost is only one part of total cost.模型费用只是总成本的一部分。 |
Cloudflare marks its old Universal Endpoint as deprecated. New implementations should use the OpenAI-compatible REST endpoint and Dynamic Routing. Existing Universal Endpoint integrations can continue to run, but do not copy that older array-based fallback format into a new architecture.
Cloudflare 已把旧 Universal Endpoint 标记为弃用。新实现应使用 OpenAI-compatible REST Endpoint 与 Dynamic Routing。旧集成仍可继续运行,但不要再把旧的 Array-based Fallback 格式复制进新架构。
Step-by-step implementation with the same client contract使用同一客户端契约的分步实现
Start with the OpenAI client because both gateways document compatible chat completion paths. Discover and pin a model available in your account; model catalogs change, so the example intentionally uses an environment variable rather than a hard-coded “latest” model.
从 OpenAI Client 开始,因为两边都提供 Compatible Chat Completion Path。先发现并固定你账户可用的模型;模型目录会变化,因此示例使用环境变量,而不是硬编码“最新模型”。
import OpenAI from "openai";
type Gateway = "cloudflare" | "vercel";
const profiles = {
cloudflare: {
apiKey: process.env.CLOUDFLARE_API_TOKEN!,
baseURL:
"https://api.cloudflare.com/client/v4/accounts/" +
process.env.CLOUDFLARE_ACCOUNT_ID + "/ai/v1",
model: process.env.CLOUDFLARE_MODEL_ID!,
},
vercel: {
apiKey: process.env.AI_GATEWAY_API_KEY!,
baseURL: "https://ai-gateway.vercel.sh/v1",
model: process.env.VERCEL_MODEL_ID!,
},
} satisfies Record<Gateway, {
apiKey: string; baseURL: string; model: string;
}>;
export async function runGateway(gateway: Gateway, prompt: string) {
const profile = profiles[gateway];
const client = new OpenAI({
apiKey: profile.apiKey,
baseURL: profile.baseURL,
timeout: 30_000,
maxRetries: 0, // own retries once; avoid retry multiplication
});
const started = performance.now();
const response = await client.chat.completions.create({
model: profile.model,
messages: [{ role: "user", content: prompt }],
temperature: 0,
});
return {
gateway,
model: response.model,
text: response.choices[0]?.message?.content ?? "",
usage: response.usage,
durationMs: Math.round(performance.now() - started),
};
}For Cloudflare’s REST API, the account token authenticates the call and third-party models use author/model naming. Provider-specific Cloudflare endpoints use different credential/header patterns, so choose one path and document it. For Vercel, query the model catalog before pinning an ID.
Cloudflare REST API 使用账户 Token 认证,第三方模型采用 author/model 命名。Cloudflare 的 Provider-specific Endpoint 使用不同凭证/Header 方式,因此应固定一种路径并记录。Vercel 则应先查询模型目录,再固定 ID。
curl "https://ai-gateway.vercel.sh/v1/models" \
-H "Authorization: Bearer $AI_GATEWAY_API_KEY" \
-H "Content-Type: application/json"
# Store the reviewed creator/model ID in VERCEL_MODEL_ID.
# Re-run discovery during planned model upgrades, not per request.Routing and fallback: make failure semantics explicit路由与回退:明确失败语义
| Policy question策略问题 | Required answer必须明确的答案 | Test测试 |
|---|---|---|
| What triggers fallback?什么触发回退? | Timeout, provider 5xx, 429, empty stream, invalid schema, or policy rejection are not equivalent.Timeout、Provider 5xx、429、空 Stream、Schema 无效、Policy Reject 并不等价。 | Inject each failure separately.分别注入每种失败。 |
| Who owns retries?谁负责重试? | Client, gateway, provider SDK, and job worker must not all retry independently.Client、Gateway、Provider SDK 和 Job Worker 不能各自独立重试。 | Count upstream attempts per user request.统计每个用户请求的上游尝试次数。 |
| Is fallback output compatible?回退输出兼容吗? | Tool calls, JSON schema, safety behavior, context windows, and finish reasons can differ.Tool Call、JSON Schema、安全行为、Context Window 和 Finish Reason 可能不同。 | Validate output after every route branch.每个路由分支之后都验证输出。 |
| Can you reconstruct the path?能否还原路径? | Record requested alias, resolved model, provider, attempts, policy version, and terminal reason.记录请求 Alias、Resolved Model、Provider、Attempt、Policy Version 和最终原因。 | Trace a known forced fallback end to end.端到端追踪一次强制回退。 |
Set one end-to-end deadline and one maximum upstream-attempt budget. A 30-second request with three layers each retrying twice can create six or more billable attempts and still miss the user deadline.
设置一个端到端 Deadline 和一个最大上游尝试预算。一个 30 秒请求,如果三层都各重试两次,可能产生 6 次以上计费调用,最终仍错过用户 Deadline。
Caching: optimize only requests that are semantically reusable缓存:只优化语义上可复用的请求
Cloudflare documents an exact-match cache key that includes provider, endpoint, model, provider authorization header, and full request body. That makes repeated deterministic calls a natural candidate, but identity, tool state, retrieval freshness, and authorization can make two text-identical prompts semantically different.
Cloudflare 官方说明精确匹配 Cache Key 包含 Provider、Endpoint、Model、Provider Authorization Header 和完整请求体。这适合重复的确定性调用,但 Identity、Tool State、Retrieval Freshness 和 Authorization 可能让两个文本相同的 Prompt 在语义上不同。
- Cache classification, extraction, and static transformations when inputs are complete and deterministic.输入完整且确定时,可缓存分类、抽取和静态转换。
- Do not cache user-private conversations, permission-dependent answers, live balances, or tool results without an explicit identity and freshness key.用户私密对话、权限相关答案、实时余额或 Tool Result,若没有明确身份与新鲜度 Key,不应缓存。
- Measure accepted-answer cache hit rate, not raw cache hit rate.衡量“有效答案缓存命中率”,而不是原始 Cache Hit Rate。
- Define bypass and purge procedures before enabling cache in production.生产启用缓存前,先定义 Bypass 与 Purge 流程。
Logging, privacy, and observability controls日志、隐私与可观测性控制
Cloudflare logging is enabled by default and can include prompts and model responses. Its current docs specify cf-aig-collect-log: false to skip the log and cf-aig-collect-log-payload: false to keep metadata without request and response bodies. Treat these as implementation controls, not a complete privacy program.
Cloudflare Logging 默认开启,并可能包含 Prompt 与模型响应。当前官方文档说明:cf-aig-collect-log: false 可跳过整条日志,cf-aig-collect-log-payload: false 可保留元数据但不保存请求/响应正文。它们只是实现控制,并不等于完整隐私治理。
Mark public, internal, confidential, regulated, and prohibited payloads before choosing log behavior.
选择日志行为前,先标记公开、内部、机密、受监管和禁止 Payload。
Remove tokens, credentials, session cookies, unnecessary PII, and retrieved secrets before the gateway.
进入 Gateway 前移除 Token、Credential、Session Cookie、不必要 PII 和检索到的 Secret。
Use your own request ID and event schema so dashboards survive a gateway switch.
使用自己的 Request ID 与 Event Schema,让 Dashboard 能跨 Gateway 保留。
Send a canary marker, inspect logs and exports, then prove deletion, retention, and role access.
发送 Canary Marker,检查日志与导出,再证明删除、保留期和角色访问。
A same-workload validation plan同负载验证方案
Run both gateways against the same accepted-answer contract. Use at least three regions, cold and warm periods, streaming and non-streaming requests, concurrency ramps, and forced provider failures. Keep the model and provider fixed for baseline latency; test routing policy separately.
让两个 Gateway 执行同一个“有效答案契约”。至少覆盖三个区域、冷/热时段、Streaming/Non-streaming、并发爬坡和强制 Provider 故障。基准延迟测试固定 Model 与 Provider,路由策略另测。
| Metric指标 | How to measure测量方式 | Why it matters为什么重要 |
|---|---|---|
| TTFT p50 / p95 / p99 | Time from request start to first streamed content token从请求开始到首个内容 Token | Perceived responsiveness用户感知响应速度 |
| Accepted success rate有效成功率 | Schema-valid and policy-compliant results divided by user requestsSchema 有效且满足策略的结果 / 用户请求数 | Excludes empty or malformed 200 responses排除空响应或格式错误的 200 |
| Fallback recovery回退恢复率 | Accepted fallback results divided by injected primary failures有效回退结果 / 注入的主路径失败数 | Tests real resilience, not configured resilience验证真实韧性,而不是配置存在 |
| Cost per accepted response每个有效响应成本 | All model, retry, gateway, logging, and egress costs divided by accepted results模型、重试、Gateway、日志与出口成本总和 / 有效结果 | Captures retry and quality waste包含重试和质量浪费 |
| Trace completeness追踪完整率 | Requests with gateway, provider, model, attempt, tokens, timing, and terminal reason拥有 Gateway、Provider、Model、Attempt、Token、Timing 和最终原因的请求占比 | Determines incident diagnosability决定事故可诊断性 |
type Run = {
ok: boolean;
schemaValid: boolean;
policyAllowed: boolean;
durationMs: number;
attempts: number;
costUsd?: number;
};
export function summarize(runs: Run[]) {
const accepted = runs.filter(
(r) => r.ok && r.schemaValid && r.policyAllowed
);
return {
requests: runs.length,
acceptedRate: accepted.length / runs.length,
retryAmplification:
runs.reduce((n, r) => n + r.attempts, 0) / runs.length,
costPerAccepted:
runs.reduce((n, r) => n + (r.costUsd ?? 0), 0) /
Math.max(accepted.length, 1),
};
}Cost model: compare total accepted-output cost成本模型:比较每个有效输出的总成本
Gateway pricing changes, so verify the current plan pages before purchase. The durable comparison is an equation: provider inference + gateway or credit fees + retries and fallbacks + log storage/export + application compute + engineering operations, divided by accepted business results.
Gateway 定价会变化,采购前必须核对当前套餐页。更稳定的比较方式是:Provider Inference + Gateway/Credit Fee + Retry/Fallback + 日志存储与导出 + 应用计算 + 工程运维,再除以有效业务结果。
Cloudflare currently documents core analytics, caching, and rate limiting as available without a gateway charge, with plan-based log limits; Unified Billing applies a credit fee while provider inference is passed through without markup. Confirm the current table and your Workers plan.
Cloudflare 当前官方说明核心 Analytics、Caching 和 Rate Limiting 不收 Gateway 费用,日志限额取决于 Workers 套餐;Unified Billing 收取 Credit Fee,Provider Inference 不加价透传。仍应核对最新表格与 Workers 套餐。
Common failure modes and fixes常见失败模式与修复
| Symptom现象 | Likely cause可能原因 | Fix修复 |
|---|---|---|
| Cloudflare returns 401Cloudflare 返回 401 | Account token and provider credential placed in the wrong header, or endpoint styles mixed账户 Token 与 Provider Credential 放错 Header,或混用了 Endpoint Style | Use the documented auth pattern for the chosen REST or provider-specific path严格按所选 REST 或 Provider-specific Path 的官方认证方式配置 |
| Fallback multiplies cost回退导致成本倍增 | Client retries plus gateway retries plus worker retriesClient、Gateway 与 Worker 重试叠加 | Centralize retry ownership and cap upstream attempts集中重试所有权,并限制上游尝试次数 |
| Cached answer leaks context缓存答案泄露上下文 | Tenant, permissions, retrieval version, or tool state omitted from eligibility缓存资格未考虑 Tenant、权限、检索版本或 Tool State | Disable cache by default; allow only classified deterministic workloads默认禁用缓存,只对白名单确定性工作负载开启 |
| 200 response breaks the appHTTP 200 仍让应用报错 | Fallback model returned incompatible JSON or tool-call shape回退模型返回不兼容 JSON 或 Tool-call Shape | Validate every output branch and count invalid output as failure验证每个输出分支,把无效输出计为失败 |
| Benchmark winner reverses in productionBenchmark 赢家上线后反转 | Warm single-region tests ignored concurrency, throttling, and provider selection单区域热请求忽略了并发、限流和 Provider 选择 | Run regional p95/p99 tests and a controlled traffic ramp执行分区域 p95/p99 测试并受控放量 |
Migration and rollback plan迁移与回滚方案
List SDKs, endpoints, models, tools, streaming, credentials, retries, timeouts, and log destinations.
列出 SDK、Endpoint、Model、Tool、Streaming、Credential、Retry、Timeout 和日志目的地。
Move base URL, auth, model aliases, and gateway extensions into configuration.
把 Base URL、Auth、Model Alias 和 Gateway Extension 移入配置。
Use redacted production-shaped prompts and compare output validity, not exact wording.
使用脱敏后的生产形态 Prompt,比较输出有效性,而不是逐字一致。
Mirror eligible requests, then ramp 1% → 5% → 25% → 50% → 100% only when thresholds hold.
镜像符合条件的请求,只有阈值持续满足时才按 1% → 5% → 25% → 50% → 100% 放量。
A single config flag should restore the previous profile without code deployment or data migration.
一个配置开关即可恢复旧 Profile,无需重新部署代码或迁移数据。
- Rollback if accepted success rate drops, p95 exceeds budget, retry amplification rises, or trace completeness falls.若有效成功率下降、p95 超预算、重试放大或 Trace 完整率下降,立即回滚。
- Keep old credentials and dashboards active through the observation window.在观察期内保留旧 Credential 与 Dashboard。
- Freeze routing policy during benchmark runs; otherwise you are comparing changing systems.Benchmark 期间冻结路由策略,否则比较的是不断变化的系统。
Where QVeris fits: capability layer, not model gateway replacementQVeris 的位置:能力层,而不是替代模型 Gateway
Cloudflare or Vercel can govern traffic between your application and model providers. QVeris complements that layer when an agent also needs external APIs and tools. The pattern is Discover → Inspect → Call: find a capability, inspect schema and permissions, then invoke it with bounded inputs. Keep model-routing evidence from the gateway and tool-source evidence from QVeris as separate provenance chains.
Cloudflare 或 Vercel 负责应用与模型 Provider 之间的流量治理;当 Agent 还需要外部 API 与工具时,QVeris 补充能力发现层。模式是 Discover → Inspect → Call:发现能力、检查 Schema 与权限,再用受控输入调用。Gateway 的模型路由证据与 QVeris 的工具来源证据应作为两条独立 Provenance Chain 保存。
Search for the required external capability by task, freshness, geography, and trust boundary.
按任务、新鲜度、地区和信任边界搜索外部能力。
Review inputs, outputs, permissions, limits, provider identity, and failure semantics.
检查输入、输出、权限、限制、Provider 身份和失败语义。
Invoke the narrowest tool, preserve evidence, validate output, and send only necessary context to the model gateway.
调用最小范围工具,保存证据,验证输出,只把必要上下文发送到模型 Gateway。
Cloudflare vs Vercel AI Gateway FAQCloudflare 与 Vercel AI Gateway 常见问题
Which is better, Cloudflare AI Gateway or Vercel AI Gateway?Cloudflare 与 Vercel AI Gateway 哪个更好?
Neither is universally better. Cloudflare is a strong fit for edge policy, explicit cache and logging controls, and versioned visual routing. Vercel is a strong fit for AI SDK workflows, a unified model catalog, automatic provider selection, and Vercel-native operations.
没有通用赢家。Cloudflare 更适合边缘策略、显式缓存/日志控制和版本化可视路由;Vercel 更适合 AI SDK、统一模型目录、自动 Provider 选择和 Vercel 原生运维。
Is Cloudflare Universal Endpoint still recommended?Cloudflare Universal Endpoint 还推荐使用吗?
No for new integrations. Cloudflare marks it deprecated and recommends its OpenAI-compatible endpoint plus Dynamic Routing for fallbacks, retries, and conditional routing.
新集成不推荐。Cloudflare 已标记其为弃用,并推荐使用 OpenAI-compatible Endpoint 加 Dynamic Routing 实现回退、重试和条件路由。
Can both gateways use an OpenAI-compatible client?两者都能使用 OpenAI-compatible Client 吗?
Yes. Both document compatible chat completion endpoints. Use environment-specific base URLs and keep model aliases in configuration.
可以。两边都提供兼容 Chat Completion Endpoint。使用环境专属 Base URL,并把 Model Alias 保存在配置中。
How should I compare latency fairly?如何公平比较延迟?
Run the same model, prompt, region, streaming mode, timeout, and concurrency. Measure TTFT, total duration, error rate, fallback rate, and p95 or p99 rather than one warm request.
固定 Model、Prompt、Region、Streaming Mode、Timeout 和并发,测量 TTFT、总耗时、错误率、回退率以及 p95/p99,而不是一次热请求。
Does gateway caching always reduce cost?Gateway 缓存一定能降低成本吗?
No. Exact-match cache helps deterministic repeats, but can return stale or contextually wrong answers if identity, permissions, freshness, or tool state are omitted.
不一定。精确匹配缓存适合确定性重复请求,但若忽略身份、权限、新鲜度或 Tool State,可能返回陈旧或上下文错误的答案。
How do the gateways handle sensitive prompts?如何处理敏感 Prompt?
Treat logging as an explicit governance decision. Cloudflare documents per-request controls to disable full logging or payload collection. On either platform, classify data, redact secrets, restrict access, set retention, and verify the actual log record.
把日志视为明确的数据治理决策。Cloudflare 提供逐请求关闭整条日志或 Payload 收集的控制。无论哪一平台,都应数据分级、Secret 脱敏、限制访问、设置保留期并检查实际日志。
Can I migrate without changing application code?迁移时可以完全不改应用代码吗?
An adapter can limit changes, but model naming, authentication headers, provider policies, cache semantics, and observability fields still need translation and tests.
适配层可以减少改动,但 Model Naming、Auth Header、Provider Policy、Cache Semantics 和 Observability Field 仍需转换与测试。
Where does QVeris fit?QVeris 位于哪里?
QVeris complements either gateway by helping agents discover, inspect, and call external capabilities. The gateway governs model traffic; QVeris governs the broader tool and API capability layer.
QVeris 为任一 Gateway 补充外部能力的发现、检查与调用。Gateway 管理模型流量,QVeris 管理更广泛的工具与 API 能力层。
Official sources官方资料
Gateway APIs, model catalogs, pricing, and plan limits change. These primary sources were checked for this July 2026 revision; verify them again before production rollout.
Gateway API、模型目录、价格和套餐限制会变化。以下第一方资料已在 2026 年 7 月修订时核对;生产上线前请再次确认。
Choose with evidence, and keep the exit reversible用证据选型,并让退出保持可逆
Shortlist by platform gravity, prove the decision with accepted-output metrics, and keep gateway-specific configuration behind one adapter. Then add QVeris when agents need governed discovery and invocation of external tools beyond model traffic.
先按平台重心缩小范围,再用有效输出指标证明选择,并把 Gateway-specific 配置放在一个适配层后。当 Agent 还需要治理模型流量之外的外部工具发现与调用时,再接入 QVeris。
Explore QVeris capabilities探索 QVeris 能力