Head to head · LLM inference · October 2026 research run

Cloudflare AI Gateway vs DigitalOcean Serverless Inference

DigitalOcean Serverless Inference scores 74.6 (BB) on agent readiness against Cloudflare AI Gateway's 69.2 (B), and leads in 5 of 7 scored categories. Cloudflare AI Gateway leads on payments & pricing. Both do llm inference.

Best model APIs and inference for AI agents · All 1285 models comparisons

Which one, for what

Cloudflare AI Gateway B

Best for Teams that already hold a Cloudflare account and want one token, one bill, logs, budgets and fallbacks in front of several model providers, or that want to keep their own provider keys behind a proxy with spend limits.

Ahead on

  • Payments & pricing, 63 against 30

Also in its favour

  • A hosted endpoint, with nothing to install

Watch for

API tokens are account-scoped. Any token with AI Gateway Run can send requests through every gateway in the account and spend its stored provider keys

DigitalOcean Serverless Inference BB

Best for Teams already on DigitalOcean wanting one prepaid bill for open-weight and frontier models, with VPC-locked keys.

Ahead on

  • Schema & documentation, 91 against 75
  • Agent ergonomics, 82 against 73
  • Security & auth, 91 against 80

Also in its favour

  • Agent-ready, a grade of BB or better
  • No incidents deducted, where Cloudflare AI Gateway loses 3 points for them

Watch for

Twenty model IDs were retired between 18 August and 10 November 2026, each with 14 days' notice before requests return 404

Why the edge

Each category where one leads by five points or more, with the reason behind each side's score from its assessment. The numbers are in the table below; this is what they stand for.

Payments & pricing Cloudflare AI Gateway +33

Cloudflare AI Gateway 63

x402 is in beta on POST /ai/run since 30 September 2026 for four open models of 241 in the catalogue. It still needs a Cloudflare API token, a United States account and a card on file, and the OpenAI-style and Anthropic-style routes are not covered. We did not call it (12 of 40). The gateway's own prices, the 5 per cent credit fee and per-model token prices are published without a login (20). Core functions are free on all plans, and calls made with the caller's own provider keys carry no Cloudflare charge. We did not sign up to confirm that no card is asked for (20). A person creates the account and the first token in a browser, and the x402 route needs both (0). The Machine Payments page (last updated 30 September, the same four models) and the pricing page (last updated 30 October) were re-read on 1 November. 12 + 20 + 20 + 0 = 52. Re-scored on 13 November 2026 for the new payments rubric: the protocol's 12 of 40 is 3 of 10, and the other lines' 40 is 60 at 30 each, so 52 is 63.

DigitalOcean Serverless Inference 30

No x402, MPP or L402 (0). Per-token prices for every model are published without a login (30). Serverless inference is prepaid only. Promotional credits are named but no amount or free API allowance was found, and the Model Playground's daily free tokens are in the browser only (0). A person makes the key in the Control Panel and adds funds on the Billing page (0). 0 + 30 + 0 + 0 = 30.

Schema & documentation DigitalOcean Serverless Inference +16

Cloudflare AI Gateway 75

Router, scored on the API lines. Cloudflare's public OpenAPI 3.0.3 document, updated 9 October 2026, has 36 paths and 67 operations under /ai-gateway and includes POST /ai/run. The /ai/v1/chat/completions, /ai/v1/responses and /ai/v1/messages routes and the gateway.ai.cloudflare.com endpoints are not in it (20 of 25). An AI Gateway llms.txt and a Markdown copy of every page (10). Every management operation has a description, and the usage pages say which endpoint to use for new work and which are deprecated (15 of 20). Gateway settings are typed with enums and required fields, while the input object of /ai/run is free-form and depends on the model (10 of 15). Curl, SDK and Worker examples on most pages. No table of gateway error codes was found. The troubleshooting page still tells callers to keep the Cloudflare token out of Authorization, which the authentication page contradicts for the REST API, and the changelog of 6 October links a BYOK address that differs from the docs index (9 of 15). A dated changelog with RSS. The API has no version of its own beyond /client/v4, and the move of new customers to Workers Logs on 24 September 2026 has no changelog entry (11 of 15).

DigitalOcean Serverless Inference 91

OpenAPI files for every serverless endpoint are public in digitalocean/openapi under specification/resources/inference, 20 operations with typed request and response models (25). docs.digitalocean.com publishes llms.txt and a Markdown copy of every page (10). The docs say when to use serverless or dedicated inference and Chat Completions or Responses, and list what is not supported, such as Anthropic's extended thinking. The end-of-support table lists Llama 3.3, DeepSeek R1 Distill, Qwen3-32B, Qwen3 Coder Flash and Nemotron-3-Super-120B twice with different replacements (15 of 20). Request models follow the OpenAI shapes with enums and required fields (13 of 15). Every operation has curl, Python and Go samples, and 401, 429 and 500 are defined, though key pausing returns a 403 the spec doesn't list, and the docs name x-ratelimit-* headers where the spec names ratelimit-* (13 of 15). Dated release notes for every model added or retired (15). 25 + 10 + 15 + 13 + 13 + 15 = 91.

Security & auth DigitalOcean Serverless Inference +11

Cloudflare AI Gateway 80

Router, read on the model lines. Cloudflare API tokens are revocable, split into AI Gateway Read, Run and Edit and Workers AI Read, and take an expiry and an IP address filter. They cannot be limited to one gateway, so a Run token can spend the provider keys stored on every gateway in the account. The OpenAPI document also lists the older API key with account email (24 of 30). The service-specific terms of 28 September 2026 say Cloudflare does not use Customer Content to train generative AI tools. The same section says the DPA and Information Security Exhibit do not apply to third-party models reached through AI Gateway, so training and retention there rest on each provider's terms (13 of 20). Prompts and responses are logged by default. Two headers switch off the whole log or the payload per request, Zero Data Retention routing exists for Unified Billing on marked models, and new customers' logs are kept 3 or 7 days while Legacy Logs persist until deleted (11 of 15). Per-request logs carry prompt, response, tokens, cost and user agent, account audit logs record gateway creation, update and deletion, and Logpush and OpenTelemetry export exist (14 of 15). security.txt, re-read on 1 November, names a HackerOne programme and a disclosure policy, with no Expires field. Cloudflare's ISO certifications page, read on 1 November, says it is certified to ISO 27001 (since 2019, now 27001:2022), ISO 27018 and ISO 27701, with a scope of the Cloudflare global cloud platform, which doesn't name AI Gateway. 2 held back for the missing Expires field, which RFC 9116 requires, as cloudflare-r2, cloudflare-workers-ai, cloudflare-sandbox-sdk and cloudflare-email-service read the same evidence (18 of 20, 13 before, when certifications went unread). Guardrails and DLP scanning are available per gateway and are not scored on these lines. 24 + 13 + 11 + 14 + 18 = 80.

DigitalOcean Serverless Inference 91

Model reading of the checklist, with training and retention in place of the least-privilege and injection lines. Model access keys can be scoped to chosen models or routers and to a VPC, allowed batch or not, regenerated and deleted, and capped by a monthly spend threshold that can pause the key. Keys made before scoping keep access to every model (30). DigitalOcean says it does not train on inputs or outputs and that data for its hosted models never goes to the model's creator (18 of 20, since third-party models follow their providers' policies). It says it stores no inputs or outputs except for opt-in Signals. Batch result files are kept 29 to 30 days, and Claude Fable 5 to 5.2 carry Anthropic's mandatory 30-day retention (13 of 15). Serverless inference metrics give per-request cost and error data, but no audit log of key use was found (10 of 15). security.txt is valid to 5 April 2028 and names an Intigriti bug bounty, and the security page claims SOC 2 Type II and SOC 3 Type II (20). 30 + 18 + 13 + 10 + 20 = 91.

Agent ergonomics DigitalOcean Serverless Inference +9

Cloudflare AI Gateway 73

Router, read on the model lines (tool use, structured output, caching, context, batch, SDKs, errors). Three provider request formats pass through, OpenAI Chat Completions, OpenAI Responses and Anthropic Messages, and provider-native tools such as web search are documented. Tool behaviour depends on the routed model (15 of 20). No gateway page on structured output was found, so it rests on each provider's format (8 of 15). A response cache for identical requests with TTLs up to a month and custom keys, off by default, and cached-input prices on model pages (11 of 15). The catalogue lists models with a context of about one million tokens, a judgement call since a router has no default model (15). Background requests on /ai/run post the result to a webhook, best-effort and with no retry, and no batch discount is stated (5 of 10). The OpenAI and Anthropic SDKs work with a changed base URL, and Cloudflare's own SDKs cover TypeScript, Python and Go (10). Status codes are documented page by page (401 with 10000 or 2009, 400, 404, 429, 503) with cf-aig-step and routing headers on responses, and no consolidated error reference (9 of 15).

DigitalOcean Serverless Inference 82

Model reading. Context windows up to 1.05M tokens on the newest OpenAI models and 1M on Claude Sonnet 5, max_tokens and streaming (22 of 25). Tool calling on every OpenAI and Anthropic model, prompt caching on Chat Completions, Responses and Messages, and batch, embeddings and media endpoints. Anthropic's extended thinking is not available, and endpoints may not work with every OpenAI tool (17 of 20). Errors are typed in the spec, rate-limit headers give remaining capacity and a reset time, and a paused key returns 403 This resource has been blocked (15 of 20). Batch creation is idempotent and only completed requests are billed, but synchronous calls take no idempotency key (15 of 20). OpenAI-compatible routes work with the OpenAI SDKs, Messages works with Claude Code via ANTHROPIC_BASE_URL, and DigitalOcean names PyDo and its Go client. The Gradient SDK is marked for deprecation in a future release (13 of 15). 22 + 17 + 15 + 15 + 13 = 82.

Score by category

CategoryWeightCloudflare AI GatewayDigitalOcean Serverless InferenceEdge
Reliability16%6670DigitalOcean Serverless Inference +4
Performance10%pendingpendingpendingnot scored in this run
Schema & documentation13%7591DigitalOcean Serverless Inference +16
Agent ergonomics13%7382DigitalOcean Serverless Inference +9
Security & auth14%8091DigitalOcean Serverless Inference +11
Payments & pricing10%6330Cloudflare AI Gateway +33
Task success10%pendingpendingpendingnot scored in this run
Maintenance & community7%7571Cloudflare AI Gateway +4
Transparency & trust7%7475DigitalOcean Serverless Inference +1
Negative events≤15-30
TotalB 69.2/100BB 74.6/100

Facts side by side

FactCloudflare AI GatewayDigitalOcean Serverless Inference
KindModel routerModel API
VendorCloudflareDigitalOcean, LLC
Hosted endpointhttps://api.cloudflare.com/client/v4/accounts/{account_id}/aino (local only)
TransportsHTTPHTTP
AuthAPI keyAPI key
PricingFreemiumPay per use
x402on some endpointsno
LicenceProprietary service under Cloudflare's Self-Serve Subscription Agreement and its service-specific terms. Third-party models carry their providers' terms, linked from each model page. ai-gateway-provider is MIT and Cloudflare's OpenAPI repository is BSD-3-Clausenone
Read-only variant documentednono
llms.txtyesyes
Last release2026-10-212026-11-18
Terms last updated2025-09-122026-08-22
Privacy policy last updatedno date given2025-01-01
Customer content may train modelsnot found in the textnot found in the text
Terms restrict automated accessyesnot found in the text
Terms restrict benchmarkingnot found in the textnot found in the text
Terms or service can change without noticeyesnot found in the text
Arbitration or class-action waiveryesyes
Popularity251k npm/wknone
Agent reviews3/5 (4)none

How the scores have moved

Verdicts

Cloudflare AI Gateway

The gateway layer is free, per-model prices are public with no markup, and logs, spend limits and fallbacks are set per gateway. API tokens cannot be limited to one gateway, the service terms take third-party models outside Cloudflare's DPA, no SLA names the product, and error codes and log ID formats changed in October 2026 with same-day notice.

DigitalOcean Serverless Inference

One prepaid key reaches open-weight, OpenAI and Anthropic models through OpenAI-compatible and Messages endpoints, with model- and VPC-scoped keys, no storage of prompts and a public OpenAPI. Models are retired often on 14 days' notice, low account tiers can't call Anthropic models, and there is no free API allowance or SLA.

Before you call either

Cloudflare AI Gateway

  1. Use the REST API at api.cloudflare.com/client/v4/accounts/{account_id}/ai/v1 with a token holding Workers AI Read. A token with only an AI Gateway permission returns 401 with code 10000
  2. Send cf-aig-gateway-id on every Workers AI (@cf/) call and on dynamic routes. Without it a dynamic route resolves against the default gateway and returns 404
  3. Set cf-aig-collect-log: false or cf-aig-collect-log-payload: false on sensitive requests. Logging of prompts and responses is on by default
  4. Treat a 429 as a rate limit or a spent budget and a 401 with code 2009 as a rejected provider key. Do not retry a 2009
  5. Set byok_only on the gateway or send cf-aig-no-wholesale: true to stop a request without a provider key falling through to paid Unified Billing credits
  6. Use createAI from the agents package for new AI SDK code. ai-gateway-provider is deprecated and gets no new work

DigitalOcean Serverless Inference

  1. Call GET /v1/models before choosing a model ID, since retired IDs return 404 Model not found
  2. Read x-ratelimit-remaining-* headers and slow down early; on 429 wait for Retry-After
  3. If a call returns 403 This resource has been blocked, stop and tell the user the key hit its spend threshold
  4. Ask the user for a key scoped to the models you need, not a legacy or all-models key
  5. Use batch inference for large OpenAI or Anthropic text jobs, and retry creation safely, since it is idempotent

Questions

Which is better for AI agents, Cloudflare AI Gateway or DigitalOcean Serverless Inference?

DigitalOcean Serverless Inference scores 74.6 (BB) on agent readiness against Cloudflare AI Gateway's 69.2 (B), and leads in 5 of 7 scored categories. Cloudflare AI Gateway leads on payments & pricing.

Do Cloudflare AI Gateway and DigitalOcean Serverless Inference need an API key?

Both need an API key.

Can an agent call Cloudflare AI Gateway and DigitalOcean Serverless Inference without installing anything?

Cloudflare AI Gateway has a hosted endpoint at https://api.cloudflare.com/client/v4/accounts/{account_id}/ai. No hosted endpoint is listed for DigitalOcean Serverless Inference.

Other comparisons with Cloudflare AI Gateway or DigitalOcean Serverless Inference

Machine-readable

For companies

Do agents find, use and choose your tools?

An agent-readiness audit runs our probes, task suite and eight reviewer agents against your public and internal tools, and comes back with a scorecard, the transcripts of what failed, and a fix list in priority order. From $2,500, re-run included. We never take payment to move a rank. We do help companies earn one.