---
title: "Official API vs Cloud-Hosted vs AI API Gateway: How to Choose"
description: "Official API, cloud-hosted or gateway? Compare payment, uptime, model coverage, data policy, latency and compliance, with a gateway checklist and commands."
url: https://cdnping.org/en/blog/official-api-vs-cloud-vs-gateway
language: en
published: 2026-10-18
category: "Developer tools"
tags: ["AI API","API gateway","cloud-hosted models","integration options","uptime"]
source: cdnping.org
license: Free to quote and summarize with a link to the url above.
---
# Official API vs Cloud-Hosted vs AI API Gateway: How to Choose

There are three common ways to access an AI API: call the model vendor's official API directly, use a model service hosted by a cloud provider, or go through an aggregation gateway. A rough rule of thumb: teams that need contracts, invoices and data-region constraints should look at cloud-hosted models; teams that use only one or two models and can pay in a way the vendor supports should use the official API; individual developers and small teams who want to switch between many models and pay monthly in RMB can consider an aggregation gateway.

At the end there is a gateway checklist and three commands you can run to verify things against your own network and your own bill.

## What do the three options mean?

Official API: you register an account with the model vendor, attach a payment method, get an API key, and send requests to the vendor's own domain, for example `api.openai.com` or `api.anthropic.com`. You get the newest models and the most complete documentation, and when something breaks you are dealing with the vendor itself.

Cloud-hosted: a large cloud platform deploys third-party models on its own infrastructure, and you call them through the platform's account system and billing. The same model can have several hosts. In the public OpenRouter data that the cdnping [model watch](/en/models) reads, one Anthropic model is listed under several providers at once: Anthropic itself, Amazon Bedrock, Google Vertex (global, us, europe and other regions), Azure and more (data as of 2026-10-17). Which data center your request actually runs in depends on which entry point you choose.

Aggregation gateway: one unified endpoint and one key, with multiple model providers behind it. A client usually only needs two settings changed, the base URL and the API key. The gateway handles routing, billing and failover. This category varies a lot: some are model-catalog platforms, some are subscription services, and some are relay sites of unknown origin.

## How do the six dimensions compare?

| Dimension | Official API | Cloud-hosted | Aggregation gateway |
|---|---|---|---|
| Payment | Usually needs an international credit card the vendor supports; pay-as-you-go | Billed through the cloud account; contracts and invoices follow the cloud platform's process | Depends on the service; some accept RMB and monthly subscriptions |
| Who is responsible for uptime | The model vendor | The cloud provider (it hosts the model) | The gateway operator plus the upstream provider, two layers |
| Model coverage | Only that vendor's models | Models the platform has listed; listing may lag the vendor | Many vendors' models, switched with one key |
| Data policy | Vendor terms | Cloud provider terms; deployment region can usually be chosen | One more party in the middle, so read its terms separately |
| Latency | One hop to the vendor's endpoint | One hop to the cloud region's endpoint | One extra hop through the gateway, depending on where it is deployed |
| Compliance | Limited by the vendor's supported regions | Limited by the cloud platform's regions and contract | Limited by both the gateway and the upstream; some gateways are not official authorized channels |

### What does "two layers" of uptime mean?

With the official API, failures come from one place, and the vendor's status page is enough. cdnping syncs vendor status pages every 15 minutes. Over the month from 2026-09-17 to 2026-10-17, the OpenAI status page recorded 4 major and 19 minor incidents, the Claude status page recorded 6 major and 1 minor incident, and Moonshot recorded 8 critical incidents. To understand how incident severity levels work, see [How to read the OpenAI and Claude status pages](/en/blog/how-to-read-ai-status-pages).

With an aggregation gateway, a failure can come from the upstream vendor or from the gateway itself. A good gateway fails over to another provider when the upstream is down; a poor one stacks the two layers of failures on top of each other. So when choosing a gateway, check whether it publishes uptime computed from real requests, and what counts as a failure.

### Does the same model behave differently on a different host?

Yes. Uptime, latency and quantization precision can all differ. OpenRouter's public data shows clear differences in 1-day uptime for the same model across inference providers, and some are labeled fp8 or fp4 quantization. For the actual numbers and how to read them, see [How much can uptime differ across OpenRouter providers for the same model](/en/blog/same-model-different-providers-uptime) and [Inference providers and fp8/fp4 model quantization](/en/blog/llm-quantization-fp8-fp4-providers). This applies to both cloud-hosted models and gateways: you need to know who your request finally lands on.

### Which hop adds the latency?

Latency has three parts: connection setup (DNS, TCP, TLS), the gateway round trip, and time to first token. The first two depend most on how you connect. In cdnping's edge probes on October 17, 2026 (Cloudflare Denver node, 08:40-10:05 UTC, 242 probes in total), the median round trip to overseas official API endpoints was mostly under 100 ms, while Chinese platform endpoints came in between 350 and 630 ms. This is data from a US edge node to each endpoint. It does not represent what you would experience from inside China, and the window is short, so it only shows that the endpoint's location sets the baseline latency. To measure on your own network, open the [cdnping online speed test](/en); it shows "first connection" and "round trip" separately. For how to break latency down, see [Breaking down AI API latency](/en/blog/api-latency-connect-rtt-ttft); for background on networks in China, see [Latency when reaching AI APIs from China](/en/learn/ai-api-latency-china).

## How do you decide which one to use?

Answer the questions below in order. The first "yes" is usually your answer:

1. Does your company need to sign a contract, get a VAT invoice, or pin a data storage region? Yes: cloud-hosted, or an enterprise contract from the vendor if one is offered.
2. Do you use only one vendor's models, and can you pay by a method that vendor supports in a compliant way? Yes: the official API, which has the shortest path and the clearest responsibility.
3. Do you need to switch between several models often, for example one for coding and another for batch Chinese-language tasks? Yes: consider an aggregation gateway and screen candidates with the checklist in the next section. For how to divide work across models, see [How to route across multiple models](/en/blog/multi-model-routing-save-cost).
4. None of the above, you just want to try things out? Start with a small pay-as-you-go trial, and decide once your usage is stable.

Whichever you choose, follow the model vendor's terms of service and the laws where you are. Some models and services have regional restrictions; use them as the terms allow and do not try to get around them.

## Six checks before choosing an aggregation gateway

| Check | What to look at | How to verify |
|---|---|---|
| Identity | Whether it says if it is an officially authorized channel | Read the official site and terms |
| Uptime | Whether it is public, whether it is computed from real requests or from probes, and what counts as a failure | Call its public endpoint and calculate it yourself |
| Billing | How its metering unit converts to tokens, and whether billing is monthly or pay-as-you-go | Try a small amount and compare against the usage detail |
| Data | Whether request bodies are stored on disk, used for training or resold | Read the privacy terms in full |
| Model sourcing | Which models are labeled with regional restrictions | Check the model page, not your impression |
| API compatibility | Whether it supports both OpenAI and Anthropic formats | Run it once with the tools you actually use |

For a fuller 8-point checklist, see [How to choose an AI API relay](/en/blog/api-relay-how-to-evaluate); for a risk self-check, see [Is a Claude API relay reliable?](/en/blog/is-claude-api-relay-safe).

### Example: AGI Plan

First, the relationship: AGI Plan is a commercial partner of cdnping. We use it as the example because its uptime data can be pulled publicly, and the same method can be used to check other gateways.

- Identity: the site states plainly that it is not an officially authorized channel.
- Payment: monthly subscription settled in RMB, with no overseas credit card needed; pay-as-you-go is also available (1 RMB = 500 CU, minimum top-up RMB 20). Plans are at [agiplan.dev/pricing](https://agiplan.dev/pricing).
- API: compatible with both OpenAI and Anthropic formats, so tools such as Claude Code, Codex and OpenCode only need one base URL changed.
- Data: request bodies are not stored on disk by default, and content is not used for training or resold.
- Models: some models are labeled "overseas only"; [agiplan.dev/models](https://agiplan.dev/models) is the source of truth.
- Uptime: it publishes hourly success and failure counts per capability group, and only 5xx responses count as platform failures.

Last-30-day data as of 2026-10-17 (source: AGI Plan's public endpoint, mirrored on cdnping at [/en/status/agiplan](/en/status/agiplan)):

| Capability group | 30-day uptime | 30-day requests |
|---|---|---|
| Domestic (China) model group | 98.0% | 9,436 |
| Balanced group | 95.0% | 3,625 |
| Frontier model group | 94.4% | 33,729 |
| Fast group | 81.7% | 44,729 |

The fast group is clearly lower. We list these numbers because being able to see the raw counts is itself one of the checks: if a gateway gives only a vague percentage, with no definition and no raw counts, there is nothing to verify.

## Three commands you can run directly

### 1. Pull the gateway's public uptime data and calculate it yourself

```bash
curl -s "https://agiplan.dev/api/status/requests?month=2026-10&format=json" -o req.json
# Without format=json it returns CSV by default
```

Once you have the hourly success and failure counts, calculate "successes / (successes + platform failures)" yourself and see whether it matches what the page shows. If another gateway offers a similar endpoint, check it the same way.

### 2. Measure connection time to each endpoint in stages

```bash
for host in api.openai.com api.anthropic.com agiplan.dev; do
  curl -s -o /dev/null -w "$host dns=%{time_namelookup} tcp=%{time_connect} tls=%{time_appconnect} total=%{time_total}\n" "https://$host/"
done
```

Run it several times and take the median. If `tls` is much larger than `tcp`, the handshake is slow, which may point to a routing or proxy problem. For network-layer troubleshooting, see [Troubleshooting Claude Code connection timeouts and errors](/en/blog/claude-code-connection-troubleshooting).

### 3. Compare the same request before and after changing the base URL

In your client, change only the base URL and the key, keep all other parameters the same, run the same prompt several times, and record time to first token and total time. For how to configure Claude Code, Codex and OpenCode, see [Configuring a custom API and base URL](/en/blog/configure-custom-api-endpoint-claude-code-codex).

## What should you keep watching after you choose?

After going live, keep an eye on three things:

- Upstream status: for the official API, use [API status](/en/status); with a gateway, watch both the gateway's own status and the upstream vendors' status.
- Model and provider changes: model removals, price changes and quantization changes are recorded automatically by the [model watch](/en/models); for changes to pricing pages and changelogs, you can subscribe to [official site updates](/en/changes). For tracking methods, see [How to find out right away when an LLM API price changes](/en/blog/track-llm-price-and-model-changes).
- Your own bill: once a month, compare the usage detail against your actual calls, and if they differ a lot, first check whether the client is retrying.

If you suspect the problem is a service outage rather than your own network, open [Is it down?](/en/down) first to compare official status with user reports. The steps are in [Is ChatGPT down? Three steps to tell](/en/blog/is-chatgpt-down-or-my-network).
