Compare API Integrations

Su Suriya Ravichandran Updated 10 Nov 2026
5 min read ·Lesson 166 of 200

One Interface, Four Integrations

The direct API, Amazon Bedrock, Google Cloud's Vertex AI, and Microsoft Foundry all present Claude through the Messages API, and the request you write looks much the same on each. The differences sit at the edges: how the client is created, how identifiers are named, how credentials are found, which parameters are accepted, and which features have arrived. Lesson 165 chose a platform. This lesson looks closely at what the choice means for the code, so that the integration is correct on the platform chosen and portable if the choice changes.

The useful method is to compare the integrations along a fixed set of dimensions, record the answers with their sources and dates, and turn the result into a list of gaps the application must handle. The comparison is most valuable when it is written down, because the platforms' documentation changes, and an answer that was true last quarter may not be true now.


The Dimensions of Comparison

Five dimensions cover most of the differences between integrations:

DimensionWhat differsWhere to look
Client and setupThe client class, its constructor arguments, and any extra installThe SDK's client reference, and the platform's setup page
IdentifiersModel names: the direct API uses short names, cloud platforms use their own identifiersThe model table for each platform
CredentialsHow the identity is supplied (Lesson 164)The platform's authentication page
FeaturesWhich tools, betas, and options are available, and when they arrivedThe platform's feature table, read for each feature the application uses
Errors and limitsThe error classes returned, quotas, and rate-limit behaviorThe error reference, and the quota documentation for the platform

The first two dimensions cause failures that are easy to see, because the request is rejected immediately. The feature dimension causes failures that are harder to see, because a feature may be missing and the application may fall back silently. That is why features get a gap analysis of their own.


Recording Features as Data

A comparison is most useful when it is data rather than prose. A small matrix that lists the features the application needs, and the platforms that provide each one, can be checked by code, and the check can be rerun when the documentation changes. The matrix below is an example with invented entries. The values for a real project must be taken from each platform's current feature table, with the date recorded beside them.

"""integration_gaps.py: find which required features each integration lacks."""

REQUIRED = {"messages", "tools", "streaming", "citations", "batches"}

# EXAMPLE VALUES ONLY. Replace each set with the current feature table for that platform.
MATRIX = {
    "direct": {"messages", "tools", "streaming", "citations", "batches"},
    "bedrock": {"messages", "tools", "streaming", "citations"},
    "vertex": {"messages", "tools", "streaming"},
    "foundry": {"messages", "tools", "streaming", "citations", "batches"},
}


def gap_analysis(required: set[str], matrix: dict[str, set[str]]) -> dict[str, list[str]]:
    return {platform: sorted(required - features) for platform, features in matrix.items()}


if __name__ == "__main__":
    for platform, missing in gap_analysis(REQUIRED, MATRIX).items():
        print(f"{platform}: {', '.join(missing) or 'none missing'}")

Output (with the example values above):

direct: none missing
bedrock: batches
vertex: batches, citations
foundry: none missing

How It Works

  1. The required set is written down first, from the application's own needs. The comparison starts from what the application must do, not from what a platform offers.
  2. Each platform's features are recorded as a set, so set subtraction gives exactly the features that are missing, with no duplicates or ordering issues.
  3. The gap list is sorted, which makes the output stable, so a changed result shows up as a real change rather than a reordering.
  4. The example values are labeled as examples. A matrix with invented entries is only a demonstration of the mechanism, and it must never be used as a source of truth. Its numbers belong to the illustration, not to any platform.
  5. A gap is a decision point. Each missing feature must be handled: the platform is excluded for that feature, the feature is implemented another way, or the requirement is reconsidered.

Reconciling Request Shapes

Beyond features, the request itself can differ. A parameter accepted by the direct API may be rejected on one cloud, or a field may be named differently. The safest way to find these differences is to run the same request through each integration in a test environment, and compare the outcomes. The request that works on all of them is the portable core, and any request that works only on one should be isolated behind an adapter that the rest of the application does not see.

An adapter is a small layer that takes the application's request, applies the platform's identifiers and any parameter changes, and returns the request the platform expects. Keeping adapters at the edge means the application's logic stays the same across platforms, and only the adapter changes when the platform does.


Comparing Errors

Errors need the same attention, because they are how the application learns that something is wrong. The SDK maps errors into shared classes (Lesson 141), and a cloud integration may return failures that map onto different situations: an identity that lacks permission, a model that is not enabled in the account, or a quota that has been reached. The error handling in Lesson 168 covers these in detail. For the comparison, the question is whether each integration's failures map to the same handling, and where they do not, the difference must be written down and handled.


Keeping the Comparison Current

Platform documentation changes often, and features move from preview to general availability, or are removed. A comparison that is not reviewed becomes wrong without anyone noticing. A practical habit is to attach the date and the source to every entry in the matrix, and to rerun the comparison when a platform announces changes, and before each major release of the application.


Summary

The four integrations share an interface and differ at the edges: client setup, identifiers, credentials, features, and errors. Comparing them along fixed dimensions, and recording the features as data, turns the comparison into a gap analysis the code can check. Request differences are handled by adapters at the edge of the application. The matrix in this lesson is illustrative, and a real one must come from each platform's current documentation, with dates. The next lesson turns to the configuration of the clients themselves.

0 Comments

Reviewed before they appear

No comments yet.

Anthropic SDK Using Python
Anthropic SDK Intro Claude API Intro SDK Requirements Install Anthropic SDK Upgrade the SDK Create an API Key Set API Keys Use Environment Variables Import Anthropic Create a Client Send Your First Message Choose a Claude Model Set Max Tokens Read a Response Print Response Text Understand Message Blocks Use System Prompts Send User Messages Set Temperature Handle Stop Reasons Messages API Intro Create Messages Use Message Roles Send Conversation History Continue a Conversation Build a Chat Loop Reset Chat History Use Multiple Turns Inspect Message IDs Read Usage Data Write Clear Prompts Set a System Prompt Add Context to Prompts Use Prompt Templates Add Examples to Prompts Request JSON Output Use XML Tags Control Response Length Improve Prompt Quality Avoid Prompt Injection Read Text Blocks Read Content Blocks Check Stop Reasons Count Input Tokens Count Output Tokens Count Tokens Before Sending Limit Output Tokens Use Stop Sequences Read Request IDs Parse API Responses Streaming Intro Stream Text Output Use Stream Events Use Stream Helpers Get Final Messages Stream Async Responses Handle Stream Errors Build a Live Chat Stream Long Responses Close Streams Safely Build a Chatbot Keep Chat History Manage Chat Sessions Add Chat Memory Build a CLI Chatbot Build a Web Chatbot Use Flask with Claude Use FastAPI with Claude Return JSON from an API Add Chat Error Messages Async SDK Intro Create an Async Client Send Async Messages Use asyncio Run Parallel Requests Stream Async Text Handle Async Errors Set Async Timeouts Close Async Clients Choose Sync or Async Tool Use Intro Define a Tool Create Tool Schemas Send Tools to Claude Read Tool Calls Run Python Tools Return Tool Results Continue After Tool Use Control Tool Choice Handle Tool Errors Use the beta_tool Decorator Create a Tool Runner Add Tool Docstrings Validate Tool Inputs Use Multiple Tools Limit Tool Calls Log Tool Activity Build a Weather Tool Build a Search Tool Build a Calculator Tool Structured Output Intro Request JSON Data Validate JSON Output Use Pydantic Models Handle Invalid JSON Extract Fields from Text Generate Typed Data Use Image URLs Send Base64 Images Read PDFs with Claude Use Output Schemas Build Data Extraction Test Structured Responses Send Image Inputs Upload Files Use File IDs Process Text Files Summarize Documents Extract Table Data Handle File Errors Read Cache Usage Reduce Repeated Input Costs Debug Cache Misses Prompt Caching Intro Enable Prompt Caching Cache System Prompts Cache Long Context Test Cache Performance Use Cache Breakpoints Cache Best Practices Message Batches Intro Create a Message Batch Set Batch IDs Check Batch Status List Message Batches Get Batch Results Process Batch Outputs Handle Failed Batch Items Use Batches for Bulk Tasks Compare Batches and Requests Handle API Errors Handle Rate Limits Retry Failed Requests Set Request Timeouts Handle Network Errors Use Exponential Backoff Build Reliable API Calls Use Extended Thinking Log API Errors Track Request IDs Paginate API Results Set Thinking Budgets Read Thinking Blocks Use Tool Search Use Web Search Tools Use Computer Tools Use Citations Use Token Counting Read Raw Responses Set Custom Headers Use Claude on AWS Bedrock Use Claude on Vertex AI Use Claude on Microsoft Foundry Configure Cloud Credentials Choose a Cloud Provider Compare API Integrations Configure Provider Clients Handle Cloud Errors Use Cloud SDK Extras Deploy Cloud Apps Protect API Keys Use a .env File Ignore Secrets in Git Validate User Input Reduce Prompt Injection Limit Tool Permissions Avoid Unsafe Tool Calls Sanitize Tool Results Set Usage Limits Review Security Logs Test SDK Functions Mock API Responses Test Error Handling Test Streaming Code Measure Token Usage Track API Costs Configure Logging Deploy with Docker Deploy a FastAPI App Monitor Production Apps Build a Claude Chatbot Build a Text Summarizer Build a Code Explainer Build a JSON Extractor Build a PDF Assistant Build a Streaming Chat App Build a Tool-Calling Agent Build a Batch Processor Build a Research Assistant Build a Claude API Dashboard
Ask about this post
AI Ask about this post

Ask questions about Compare API Integrations and get answers drawn from it.

Signed-in readers only.