tech/cloudflare/ai/ai-gateway

Official

Unified proxy for Claude, OpenAI, and Workers AI with caching, rate limiting, and analytics.

Author2nth-ai
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill provides a unified proxy for Claude, OpenAI, and Workers AI, solving issues related to token metering, caching, rate limiting, fallback routing, and token usage analytics without changing AI SDK code.

Core Features & Use Cases

  • Token Metering: Monitor and control token usage across all AI calls.
  • Caching: Implement semantic caching to reduce duplicate AI costs.
  • Rate Limiting: Set rate limits on AI usage per client or user.
  • Fallback Routing: Fallback to Workers AI if Claude fails.
  • Observability: Track token usage, latency, and cost across all AI calls in one dashboard.
  • Token Economy: Implement the 2nth token economy for per-client billing via gateway logs.
  • Use Case: For a financial institution, this Skill can help manage API costs by caching common queries and setting per-user limits.

Quick Start

Set up an AI Gateway in the Cloudflare dashboard and replace the Anthropic base URL in your Worker with the gateway URL.

Dependency Matrix

Required Modules

tech/cloudflare/workerstech/cloudflare/ai/workers-ai

Components

scriptsreferencesassets

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: tech/cloudflare/ai/ai-gateway
Download link: https://github.com/2nth-ai/skills/archive/main.zip#tech-cloudflare-ai-ai-gateway

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 620,000+ vetted skills library on demand.