Single logo
  • Courses
  • Blog
  • About
Join on SkoolJoin on Skool

In this topic

Claude
  • Claude.ai Interface Tour: Every Control You Need on One Screen
  • The AI Fluency Model: Delegation, Description, Discernment and Diligence
  • Working With Claude: Pick the Surface, Match the Model, Keep the Context Clear
  • Claude's Four Entry Points: Choose Chat, Projects, Artifacts or Research Before You Type
  • What Claude Can Do: Extended Thinking, Web Search, Artifacts and File Analysis
  • Getting More From a Claude Chat: Steer the Conversation Instead of Starting Over
  • Claude Research Mode End to End: From One Prompt to a Cited Briefing
  • Claude's Capability Layer: When to Use Skills, Code Execution or Memory
  • Code Execution and File Creation in Claude: Calculated Numbers and a Real Excel File
  • Adding and Using Skills in Claude: Let Claude Pick the Skill, Then Teach It Your Format
  • Claude Memory, Curation and Incognito: Keep What Helps, Remove What Has Gone Stale
  • Claude Styles, Preferences and Project Instructions: Three Dials, Three Scopes
  • Claude Projects: Knowledge, Instructions and a Real Workspace You Set Up Once
  • Keeping a Claude Project Current and Connected: Refresh, Prune and Grant the Least
  • Claude Scheduled Tasks: Let Claude Work on a Schedule and Email You the Result
  • Claude Code and Claude for Chrome: What They Are and Who They Are For
  • Anatomy of a Good Prompt: Role, Context, Task, Format and Examples
  • Shaping Claude's Output: Format, Tone and Length in a Few Words
  • Iterating and Refining a Prompt: Read, Diagnose, Adjust, Repeat
  • Five Prompting Patterns for Work: Summarise, Extract, Rewrite, Classify and Draft
  • Why Evaluating AI Output Matters Most: Trust, Then Verify
  • Spotting AI Hallucinations and Fabrications: Four Tells and Where Risk Spikes
  • Fact-Checking Claude's Answers: Four Techniques and a Line-by-Line Claim Log
  • Judging AI Output Quality: Four Questions That Score Any Answer
  • Adapting AI Output for Your Audience: One Answer, Three Readers
  • When a Human Must Review AI Output Before It Ships
  • A Personal Validation Checklist for AI Output: Six Lines, Any Draft
  • Fitting Claude Into Real Work: Where It Helps and Where It Never Should
  • Breaking Big Tasks Into Steps With Claude: Small Asks, Checked Hand-offs
  • Designing a Repeatable Claude Workflow: A Reusable Weekly Report Template
  • Measuring If Claude Is Actually Working: One Number, Before and After
  • Communicating AI Value and Limitations to Stakeholders: The Honest Pitch
  • Data Privacy With Claude: What Never Goes in a Prompt, and How to Redact a Document Before You Paste It
  • Responsible AI Use and Transparency: Helpful, Honest, Harmless, and One Honest Line
  • Troubleshooting a Weak Claude Answer: Name the Cause, Fix One Thing, Then Make It Cheaper
  • CLAUDE.md, settings.json and Plugins: Which Claude Code File Advises, Which Enforces, Which Packages
  • Authoring a Claude Skill: SKILL.md, Frontmatter, Progressive Disclosure and the Description That Triggers It
  • One Change, Four Environments: Where a Claude Config Edit Lands in Dev, Staging, Prod and CI
  • Claude in the SDLC: Prompts in Git, a Change Gate by Path, a Claude Review That Advises and a Person Who Merges
  • Hooks That Block Destructive Actions: a PreToolUse Gate That Allows, Asks or Denies
  • Choosing a Claude Code Extension: Skill, Hook, Rules File, Subagent, Slash Command or Plugin
  • Rolling Out Claude Code to a Team: Settings Precedence, dontAsk in CI, a Hook for Every-Time Rules and a Plugin for Five Repos
  • A Claude Code Review Bot in CI: Headless -p, JSON Findings, Team Rules in Git and a Person on the Merge
  • Lab: Three Planted Bugs in a Claude Code CI Repo, a Permission Mode, a Plugin Path and an MCP Token Variable
  • Configuring MCP Servers in Claude Code: A Command or a URL, Three Scopes, and Three Moves When One Breaks
  • Claude Code's Built-in Tools: Read, Write, Edit, Bash, Grep and Glob, and When Each One Is the Right Pick
  • The CLAUDE.md Hierarchy: User, Project and Directory Files, How They Stack, and the Team Rule Stuck on One Laptop
  • Split a 600-Line CLAUDE.md: @import Lines, .claude/rules Files and Which One to Pick
  • Path-Specific Rules in Claude Code: paths Globs, When a Rule Loads and the Glob That Matches Nothing
  • Claude Code Slash Commands and Skills: Project vs User Scope, $ARGUMENTS, context: fork and allowed-tools
  • Iterative Refinement with Claude Code: Input/Output Examples, Tests First and the Interview Pattern
  • Claude Code Sessions: Resume by Name, Fork From a Baseline, or Start Fresh With a Summary Card
  • CI Reviews That Don't Repeat Themselves: Prior Findings, Existing Tests and Test Standards in CLAUDE.md
  • Fleet Telemetry for Parallel Coding Agents: Find the Stampede, the Hotspot and the Runaway That Per-Agent Alerts Miss
  • AI Code Review That Earns the Right to Block: Shadow Mode, Calibration Against Human Review, Then a Gate
  • Org-Wide Claude Code: Managed Settings With the Locks On, an MCP Allowlist by Address, and One Pinned LLM Gateway
  • Sharing Skills, Prompts and MCP Servers Across Teams: One Quality Gate Before the Shared Catalog
  • Claude Code Plugins and Marketplaces for an Org: Package a Skill, a Hook and an MCP Server, Check Them, Then Lock the Sources
  • Where Claude Joins a Developer Workflow: Interactive, GitHub Action or claude -p, Then Measure the Outcome
  • An Ops Runbook for Claude Failures: Case Cards, Request IDs, Owners and a Read-Only Investigation
  • The Claude Messages API: Your First Call, Field by Field
  • Claude Tool Use: How tool_use and tool_result Work in the Messages API
  • Claude Client SDKs Wrap One REST API: Raw HTTP, Python, TypeScript and Async Calls Compared
  • Anthropic SDK Timeouts, Retries and Error Classes: Configure the Client Once, Then Give 429, 529, 400 and Timeouts Their Own Move
  • Claude Streaming Events: The Event Order, message_stop, Tool Arguments, Stop Reasons and a WebSocket Relay
  • Images, PDFs and Thinking Blocks in the Claude Messages API: Typed Blocks In, Typed Blocks Out
  • Getting Data Into Claude: PDF Documents, the Files API, Search Results and Citations
  • Opus, Sonnet or Haiku: Pick the Claude Model per Job, and Test the Request When a New Release Arrives
  • Adaptive Thinking and Effort in Claude: Two Dials, Set per Workload, and the Thinking Block You Must Pass Back
  • Claude Cost Tracking From usage: Count Before, Cap During, Read After, Then Find the Line That Drives the Bill
  • Claude Cache Breakpoints: Where to Put cache_control, How to Move It With the Chat, and Why the Reads Stay at Zero
  • Claude Message Batches or Real Time: Choose by Who Is Waiting, Match by custom_id, Resend Only the Failures
  • Calling Claude Through Amazon Bedrock, Google Cloud and Microsoft Foundry: Same Call, Different Door
  • The Life Cycle of a Claude App: Six Phases, a Model That Retires, and a Release Gate for Every Change
  • Pinning Claude Model IDs and Upgrading Safely: One Change at a Time, a Golden-Set Replay and a Staged Rollout
  • Content Boundaries and Schema Design for Claude: Fence the Input in a Tag, Let the Output Say I Don't Know
  • The Agentic Loop and stop_reason: Keep Turning on tool_use, Stop on end_turn, Cap the Turns
  • The Claude Agent SDK: query(), ClaudeAgentOptions and @tool, in Python and TypeScript
  • Fix the Agent: Four Broken Claude Agent SDK Configs, From the Symptom to the One Wrong Line
  • Claude Managed Agents: Cloud Sandbox, Self-Hosted Sandbox or Self-Hosted Service
  • Agent SDK Hooks for Deterministic Actions: PreToolUse, PostToolUse, and Four Hooks That Fail Silently
  • Memory and Context-Window Patterns for Claude Agents: Context Editing, Compaction and the Memory Tool
  • Reading an Agent Trace: Five Signatures, Five Missing Patterns, and How Long a Fact Must Live
  • Tool Descriptions for Claude: How Claude Picks a Tool, and How to Stop It Picking the Wrong One
  • Tool Input Schemas and Error Responses for Claude: Required Fields, Enums, is_error and a Retry Flag
  • Tool Response Shaping and a Lean Tool Set: Give Claude a Sticky Note, Not the Filing Cabinet
  • Fix the Tool Schema: Read the Trace, Fix the Card, Re-Run (Four Real Schema Bugs)
  • Client Tools, Server Tools and Approval Gates: Who Runs the Tool, and Who Says Yes First
  • Built-in Tool, Custom Tool, Skill or MCP Server? Pick the Lightest One That Fits
  • System Prompt or User Turn: Where Each Instruction Goes, and Output Limits Your Code Enforces
  • Refine the Prompt One Line at a Time, Then Clean and Fence the Customer's Text
  • Prompt Revision Driven by Evals: Name the Cause, Change One Thing, Rerun the Whole Suite
  • Long-Running Sessions: Compact, Prune, Isolate or Start Fresh, Decided by Naming the Failure
  • Context Isolation Through Subagents: Read the Logs Elsewhere, Keep One Line
  • Defensive Parsing of Claude Replies: Check the Stop Reason, Read the Block or the Text, Then Validate the Values
  • Full Context or Retrieval: Choose by Corpus Size, Cost and Freshness
  • Skepticism Toward Confident Output: Check the Quote, the Record and the Sum Before You Send
  • Debugging a Claude App: Three Error Types, the Recovery Each One Earns, and the First Failing Row
  • Six Ways a 200 Can Still Be Wrong: Hallucination, Refusal, Under-Acting, Context Loss, Format Drift and Inconsistency
  • Fix the Cause, Not the Symptom: Four Recovery Drills for an LLM App, Each Checked on a New Input
  • Integration Layer or Model Output? Three Taps and Three Questions to Find Where a Wrong Answer Lives
  • Which Test Layer Owns the Failure? Unit, Functional, Integration and End-to-End Tests for a Claude App
  • Designing an Overnight Document Pipeline on Claude: Batch Lane, Live Lane, a Cached Prefix and a custom_id Reconcile
  • Proving a Model Upgrade Is Ready: A Frozen Golden Set, a Calibrated Judge, the Right Layer and a Release Gate
  • From Requirement to Design for a Claude App: Eight Requirements, Five Elements and a Trace With No Gaps
  • Build a Claude Refund App: the Messages API, Two Tools, an MCP Server and a Hook in One Loop
  • Ship a Claude App: an Eval Gate, Two Guardrail Layers, a Cost Check From usage and a Pinned Model
  • Lab: a 30-Case Golden Set, a Calibrated Judge and a Per-Slice CI Gate on a Claude Refund App
  • Lab: Cut a Claude App's Bill by 62 Percent With Usage Data, Layered Cache Breakpoints and a Batch Job
  • Lab: Three Planted Bugs in a Claude App, a Vague Prompt, a Mistyped Tool Schema and a Broken Stream Handler
  • Lab: Three Planted Bugs in a Claude Code CI Repo, a Permission Mode, a Plugin Path and an MCP Token Variable
  • Lab: Harden a Claude App, an Uncalibrated Judge, a Retry Loop That Retries Everything and a Hook Matcher With a Gap
  • Lab: Turn a Claude App Into a Reusable Template, One Pinned Model Id, No Key in Code and Evals Built From Data
  • Building an MCP Server: Tools, Resources and Prompts in Python and TypeScript
  • MCP Transports: stdio or Streamable HTTP, and Who Starts the Server
  • Deploying and Authenticating an MCP Server: Environment Keys for stdio, Bearer Tokens and Scopes for HTTP
  • Validation-Retry Loops for Claude Extraction: Send Back the Exact Errors, and Stop When a Retry Cannot Help
  • Multi-Pass and Multi-Instance Code Review with Claude: A Fresh Reviewer, Per-File Passes and an Integration Pass
  • When a Claude Support Agent Should Escalate: Three Clear Triggers, Not Mood or a Confidence Score
  • Error Propagation Across Subagents: Retry Locally, Then Report the Failure, the Attempts and What You Found
  • Human Review and Confidence Calibration: Check Accuracy by Type and Field Before You Stop Looking
  • Provenance in Multi-Source Research: Keep Every Claim With Its Source and Date, and Show Conflicts Instead of Settling Them
  • Lab: An Extraction Pipeline With a Nullable Schema, Validation-Retry, a 100-Request Batch and Human Review
  • Lab: A Research Pipeline With Parallel Subagents, a Timeout That Keeps Its Partial Results, and a Report With Its Trail
  • Coordinator and Subagents: Decompose, Delegate, Check Coverage, and Call Only the Spokes You Need
  • Passing Context to Subagents: Nothing Is Inherited, So Put Findings, Goal and Criteria in the Prompt
  • Parallel Subagents: Several Task Calls in One Response, Every Result Back in One User Turn
  • Task Decomposition: a Fixed Prompt Chain With an Integration Pass, or a Dynamic Plan That Adapts
  • Prompt Guidance vs Programmatic Gates: Block the Refund Until the Customer Is Verified, Then Hand Off a Card That Stands Alone
  • Scoped Tools per Agent and tool_choice: Three to Five Tools per Role, a Shared One, and auto, any or a Forced Tool
  • Durable Agent Runs: Save a Checkpoint After Every Tool Turn, Resume After a Kill, and Key the Email So It Goes Out Once
  • Resume on the Model the Run Started With: a Run Record That Pins the Model Id, the Prompt Version and the Notes
  • Durable Agent State by Name: an Agent SDK Session Id, a /memories Path or a Managed Agents Memory Store
  • Cache-Safe Instruction Changes and Large Tool Catalogs: Append the New Rule at the End, Defer 57 of 60 Tools With Tool Search
  • One Gateway, One Platform Table: Route a Model Alias to the Claude API, Bedrock or Google Cloud and Check Parity Before the Call
  • OpenTelemetry Tracing for a Claude Agent Loop: A Span for Every Request and Tool Call, and the Switch for Each Surface
  • Debugging Late, Far and Rare Failures in a Claude Agent: Replay the Turns, Follow the Fact, Split the Runs
  • Scheduled and Event-Driven Claude Agents: Managed Agents Deployments, Budgets, Outcomes and Webhooks
  • Latency Engineering for a Claude Agent Loop: Time to First Token vs Total, Streaming, Parallel Tools, the Cache and Effort
  • Claude Prompt Caching Strategy: Pick the TTL by the Quiet Gap, Read Cache Diagnostics, and Warm Before You Fan Out
  • Capstone: One Prompt Change Through the Whole Operating Loop, From CI Gate to Postmortem
  • Reading a Business Requirement Like an Architect: Function, Quality, Constraints and Assumptions
  • From One Claude Call to a System: Input, Processing, Output and the Feedback Loop
  • The Delegation Map: Decide What Claude Owns, What People Keep and What They Share
  • When a Packaged Skill Beats a New Agent (and a Prompt Library)
  • Five Reference Architectures for Claude Systems: Read the Cue, Name the Shape
  • Business Value Pillars for an LLM System: Turn "Cheaper and Faster" Into Targets, Then Pick the Lane
  • Which Requirement Binds? Picking the Claude Surface and Agent Runtime Under Constraints
  • The Claude Model Ladder: Pick the Cheapest Model That Passes, Then Price the Month
  • Zero-Shot, Few-Shot or Reasoning: Pick the Cheapest Prompting Technique the Failure Asks For
  • Choosing the Claude Build Stack: Client SDK, Agent SDK, Claude Code Headless or Managed Agents
  • Authentication and Authorization for Claude Agents: Find the Gaps Hop by Hop
  • Connecting Claude to a Legacy System You Can't Change: The Adapter Pattern
  • MCP, an API/CLI Call or Agent-to-Agent: Choosing How Claude Connects to a Capability
  • Progressive Discovery or Monolithic Context: Load It All, Fetch by Index, or Both
  • Speed Has a Price and the Rate Limit Is the Ceiling: Choosing Model, Effort and Fast Mode per Path
  • Reliability Controls for Claude Apps: Backoff, Idempotency Keys, Fallback Routing and Circuit Breakers
  • Six Metrics, Not One Score: Accuracy, Groundedness, Latency, Cost, Safety and Security for an LLM Agent
  • Diagnosing a Bad Answer: Prompt Failure, Hallucination or Model Mismatch?
  • Human-in-the-Loop Routing: Send Each Agent Action to Auto, Review or Block by Confidence, Reversibility and Cost
  • Working an Architecture Scenario End to End: Mark Hard and Soft Constraints, Cut, Rank, Decide
  • A Regulated Dispute Desk on Claude: Pin the Geography, Gate by Risk, Log Before Release, Fail Closed
  • Global Support Automation Scenario: Cut the Options, Route Each Ticket by Risk, Gate Every Change by Language
  • Architecture Artifact Review Drills: Find What a Diagram, Config, Trace, Eval Table, ADR or Settings File Leaves Out
  • The Architecture Decision Record for a Claude System: Context, Options, Decision, Consequences and the Evidence You Will Need
  1. Blog
  2. /
  3. Claude
  4. /
  5. Building with the Claude API

One Gateway, One Platform Table: Route a Model Alias to the Claude API, Bedrock or Google Cloud and Check Parity Before the Call

Three tenants on three platforms, and a model id copied from the Claude API to Bedrock fails. A gateway turns the alias support-main into the right platform and id, keeps all 6 keys, counts a quota per tenant, refuses a Files API request on Bedrock and a 31 MB request over a 30 MB limit before any call, and logs every request.

Chaand Sheikh

·27 November 2026Building with the Claude API

What you will learn

  • Route a tenant's model alias to a platform and the model id that platform expects
  • Keep every platform key in the gateway and give tenants only a gateway token
  • Refuse a request before any call when the platform lacks a needed feature or the request is over its size limit
  • Run a parity report over every route before a tenant is moved

Before you start

  • Calling Claude through Bedrock, Google Cloud and Foundry
  • Multi-tenant quotas for one shared LLM

The support agent answers tickets all day, and now three customers run it on three different platforms: Acme on the Claude API, Bluebank on Amazon Bedrock, Northwind on Claude Models on Google Cloud and Microsoft Foundry. Each team keeps its own copy of the model id, its own key and its own limit.

Then one team copies the Claude API model id to Bedrock. Bedrock expects its own id, and the call fails. Three copies of the id, three copies of the key, three limits to remember, and nobody sees the problem until a customer does. This article puts one gateway in front of all of them, with one table that says what each platform needs.

A company travel desk

  • Routing. Staff ask for a trip, not an airline. That's an alias (support-main), not a platform id. The desk picks the airline.
  • Keys. The desk holds the company card; nobody keeps one in a drawer. The platform keys live in the gateway.
  • The ledger. The desk records who booked what, and every team has a budget. That's a quota and a log line per tenant.

The calling side of each platform (client class, sign-in, model id format, features not supported) is covered in calling Claude through Bedrock, Google Cloud and Foundry. Here we stop each team from learning all of that, and put it behind one door.

platforms.py: the one table

The project runs on a stand-in (the Anthropic SDK on an httpx mock transport, one stand-in per platform with its own key and the model ids it accepts), so no API key is needed and the replies are test replies. The real platforms sign in differently (API key, AWS credentials, Google Cloud credentials, Entra ID); the stand-in uses one SDK shape for all of them.

"""The one table: what each platform calls the model, how big a request may be, and what it does not support."""
PREFIX = {"bedrock": "anthropic."}                 # every other platform uses the Claude API id as it is
ALIASES = {"support-main": "claude-sonnet-5-5", "support-fast": "claude-haiku-5-5"}
PLATFORMS = {
    "claude_api":     {"label": "Claude API",         "max_mb": 128, "missing": set()},
    "bedrock":        {"label": "Amazon Bedrock",     "max_mb": 20,
                       "missing": {"files_api", "message_batches", "mcp_connector", "web_search", "server_side_fallback"}},
    "aws_platform":   {"label": "Claude Platform on AWS", "max_mb": 32, "missing": set()},
    "google_managed": {"label": "Claude Models on Google Cloud (Google managed)", "max_mb": 30,
                       "missing": {"files_api", "message_batches", "mcp_connector", "server_side_fallback"}},
    "google_anthropic": {"label": "Claude Models on Google Cloud (Anthropic managed)", "max_mb": 32, "missing": set()},
    # Foundry row: deployments hosted on Anthropic. Azure-hosted ones lack more (see its page).
    "foundry":        {"label": "Microsoft Foundry",  "max_mb": 32, "missing": {"message_batches", "server_side_fallback"}},
}


def model_id(platform, alias):
    return PREFIX.get(platform, "") + ALIASES[alias]

Per the README, the ids, the request limits and the unsupported features come from the Claude docs (Models overview; the API overview's "Claude API versus cloud platforms"; each platform's "Features not supported"), and the missing sets list only features SupportDesk uses. Feature availability varies by platform, so check each platform's page before you rely on a row.

What must stay equalClaude APIBedrockGoogle Cloud (Google managed)Foundry
Model id for support-mainclaude-sonnet-5-5anthropic.claude-sonnet-5-5claude-sonnet-5-5claude-sonnet-5-5
Largest request128 MB20 MB30 MB32 MB
Features SupportDesk uses that are missingnone542

The gateway reads all of this from the table, never from someone's memory.

gateway.py: route, quota, parity, call, log

TENANTS = {"gw-acme": ("acme", 2), "gw-bluebank": ("bluebank", 5), "gw-northwind": ("northwind", 5)}   # name, quota
ROUTES = {"acme": {"support-main": "claude_api", "support-fast": "claude_api"},
          "bluebank": {"support-main": "bedrock", "support-fast": "bedrock"},
          "northwind": {"support-main": "google_managed", "support-fast": "foundry"}}
VAULT = {p: f"key-{p}" for p in PLATFORMS}                                    # the only place keys live


def handle(token, alias, needs=(), size_mb=0.1):
    """Every request ends in one log line, whether it is served or refused."""
    entry = {"tenant": "-", "alias": alias, "platform": "-", "model": "-"}

    def done(status, why=""):
        LOG.append({**entry, "status": status})
        return {**entry, "status": status, "why": why}

    if token not in TENANTS:
        return done(401, "unknown gateway token")
    entry["tenant"], quota = TENANTS[token]
    USED[entry["tenant"]] = USED.get(entry["tenant"], 0) + 1
    if USED[entry["tenant"]] > quota:
        return done(429, f"tenant quota {quota} used")
    platform = entry["platform"] = ROUTES[entry["tenant"]][alias]
    spec = PLATFORMS[platform]
    gap = sorted(set(needs) & spec["missing"])
    if gap:
        return done(422, f"{platform} has no {gap[0]}")
    if size_mb > spec["max_mb"]:
        return done(413, f"over the {spec['max_mb']} MB limit")
    entry["model"] = model_id(platform, alias)
    CLIENTS[platform].messages.create(model=entry["model"], max_tokens=64, messages=[{"role": "user", "content": "T-101"}])
    return done(200)

That's an excerpt (the imports, CLIENTS, USED and LOG set-up are left out). The order matters:

  1. The gateway token says which tenant this is. Tenants never hold a platform key.
  2. The quota is counted per tenant.
  3. The route: the tenant and the alias pick the platform.
  4. The parity check: a needed feature the platform lacks, or a request over its size limit, is refused before any call.
  5. The call, with the platform's own model id and the key from the vault.
  6. One log line on every path, served or refused.

The tenants, routes, quotas, alias names and the 422 status are the lecture's own choices for the demo.

Same alias, any platform acme support-main bluebank support-main northwind support-fast gateway token, quota route + platform table gap: 422, too big: 413 key from the vault one log line Claude API claude-sonnet-5-5 Bedrock anthropic.claude-sonnet-5-5 Foundry claude-haiku-5-5
Tenants send an alias and a token. Everything platform-specific stays behind the door.

One decision per request

direct calls, one id copied by hand
claude_api     claude-sonnet-5-5 -> 200
bedrock        claude-sonnet-5-5 -> 404 id not recognised
through the gateway
acme      support-main claude_api     claude-sonnet-5-5             -> 200
bluebank  support-main bedrock        anthropic.claude-sonnet-5-5   -> 200
northwind support-fast foundry        claude-haiku-5-5              -> 200
bluebank  support-main bedrock        bedrock has no files_api      -> 422
northwind support-main google_managed over the 30 MB limit          -> 413
acme      support-fast claude_api     claude-haiku-5-5              -> 200
acme      support-main -              tenant quota 2 used           -> 429
guest     support-main -              unknown gateway token         -> 401
parity report
acme      support-main claude_api     ok
acme      support-fast claude_api     ok
bluebank  support-main bedrock        gap: files_api
bluebank  support-fast bedrock        gap: message_batches
northwind support-main google_managed gap: files_api
northwind support-fast foundry        gap: message_batches
log: 8 lines, one per request, each with tenant, alias, platform, model, status
keys: 6 in the gateway, 0 in tenant config
  • Direct calls. The Claude API accepts the copied id; Bedrock doesn't recognise it. That 404 is the stand-in's behaviour (it serves only the ids its platform expects); the real platform's error text may differ.
  • Through the gateway, one alias reaches three platforms with three different model ids, and nobody typed a platform id.
  • A request that needs the Files API on Bedrock gets a 422, our own code, and nothing is sent.
  • A 31 MB request to the Google-managed route is over its 30 MB limit: 413, again before any call. (The size is passed in as a number; the stand-in doesn't send real megabytes.)
  • Acme's third request hits its quota of 2: 429. An unknown token: 401.
  • The parity report lists the same gaps for every route, before any tenant is moved.
  • Eight log lines, one per request. Six keys, all in the gateway; zero in tenant config.

The same front-door idea for MCP tool servers (a gateway that checks its own token, routes versions and mints a new upstream token) is in a remote MCP server in production. What this lecture adds is the platform side: an alias that becomes a different id per platform, and a parity table checked before the call instead of discovered after it. When the route itself fails over to another model, see fallback model chains; the same parity table is what tells you whether the backup can even take the request.

Common mistakes

  • Copying the Claude API model id everywhere. Bedrock expects its own prefix, as the 404 showed.
  • Giving each team its own platform keys. Six keys spread across tenant configs instead of one vault.
  • Assuming every platform has every feature. Bedrock lacks five of the features SupportDesk uses, the Google-managed route four, Foundry two.
  • Finding a gap from the platform's error. Check the table and refuse before the call; then the log says exactly why.
  • Moving a tenant without a parity report. Run it over every route first.

Quick recap

JobWhere it livesIn the run
Route by tenant and aliasROUTES + model_id()One alias, three ids
Hold the keysVAULT6 in the gateway, 0 in tenant config
Count a quota per tenantTENANTSacme: 429 after 2
Check parity before the callPLATFORMS table422 files_api, 413 over 30 MB
Log every requestdone()8 lines

Keep going in Claude · 135 of 165

Previous
Cache-Safe Instruction Changes and Large Tool Catalogs: Append the New Rule at the End, Defer 57 of 60 Tools With Tool Search
Next post
OpenTelemetry Tracing for a Claude Agent Loop: A Span for Every Request and Tool Call, and the Switch for Each Surface
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

Claude Certified Developer - Professional (CCDV-P) Exam Prep

Claude agents in production: reliability, observability, evals, cost, guardrails and fleets.View on Udemy ↗: Claude Certified Developer - Professional (CCDV-P) Exam Prep (paid course, opens in a new tab)

Related posts

The Claude Messages API: Your First Call, Field by Field

One request in, one Message out. The four fields of a Messages API call (model, max_tokens, system, messages), how to read content blocks, stop_reason and usage, and why every turn resends the history.

Claude Tool Use: How tool_use and tool_result Work in the Messages API

Follow one order question through Claude's tool round trip: define a tool, read the tool_use block, run your own function and send a matching tool_result back, including parallel calls and is_error.

Claude Client SDKs Wrap One REST API: Raw HTTP, Python, TypeScript and Async Calls Compared

Every Claude client SDK wraps the same REST request: a POST to /v1/messages with a JSON body. See it built by hand, through the Python and TypeScript SDKs, as typed errors, and as async calls that wait together.

Anthropic SDK Timeouts, Retries and Error Classes: Configure the Client Once, Then Give 429, 529, 400 and Timeouts Their Own Move

Configure the Anthropic SDK client (timeout, max_retries, with_options, async, pagination), see which errors it retries by itself, then repair a retry wrapper so a 429, a 529, a 400 and a timeout each get the move the docs support.

On this page

  • A company travel desk
  • platforms.py: the one table
  • gateway.py: route, quota, parity, call, log
  • One decision per request
  • Common mistakes
  • Quick recap
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

Claude Certified Developer - Professional (CCDV-P) Exam Prep

Claude agents in production: reliability, observability, evals, cost, guardrails and fleets.View on Udemy ↗: Claude Certified Developer - Professional (CCDV-P) Exam Prep (paid course, opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact us
Legal
Terms of UsePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.