---
id: "ai-no-gateway"
type: "rule"
severity: "info"
url: "https://localhost:3000/catalogue/rules/ai-no-gateway"
---

# Several AI vendors and no gateway

The design calls three or more AI services and has no API gateway to route, retry and meter them.

| | |
|---|---|
| Severity | info |
| Selects | every design |
| Components in scope | 2,366 |

## Why

With three or more AI vendors and no gateway, every caller holds every key, writes its own retries and fallbacks, and spend is spread across vendor dashboards. An AI gateway such as LiteLLM, Portkey or Cloudflare AI Gateway gives one place for keys, fallbacks, rate limits and cost.

## What it checks

It looks at every design, and fires when:

- all of these hold:
  - the design contains more than 2 nodes of kind ai-service
  - this does not hold:
    - the design contains a node of kind api-gateway

Message template:

```
Design '{{design.id}}' calls three or more AI services and has no API gateway to route, retry and meter them.
```

## Applies to

This rule is about the whole design, not one node.

2,366 catalogue components fall under it.

## Tripped by

Reference designs whose broken twin names this rule in its header:

- [llm-gateway](https://localhost:3000/d/zeema/llm-gateway)

## Source (`rule` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../schema/rule.schema.json
# Three or more AI vendors in one design and no gateway anywhere: every caller holds every key,
# retries and fallbacks are written per vendor, and spend is not seen in one place. Counted once
# for the design. A gateway such as litellm, portkey or cloudflare-ai-gateway closes it.
# Tripped by: designs/reference/llm-gateway/design.broken.yaml
schemaVersion: "1"
type: "rule"
id: "ai-no-gateway"
severity: "info"
select:
  design: true
when:
  all:
    - hasNode:
        kind: "ai-service"
        count:
          gt: 2
    - not:
        hasNode:
          kind: "api-gateway"
message: "Design '{{design.id}}' calls three or more AI services and has no API gateway to route, retry and meter them."
```

Human page: https://localhost:3000/catalogue/rules/ai-no-gateway
