sdk-compatibility-matrix · EN · 2026-10-21

Which SDKs and Frameworks Work Through One Aggregator Key: A Compatibility Matrix

This article maps mainstream SDKs and frameworks—OpenAI SDK, Anthropic SDK, LangChain, LlamaIndex, and Vercel AI SDK—to their compatibility with an OpenAI-compatible aggregator proxy. It explains which clients work directly through the proxy and which require shims or configuration changes, and provides practical guidance for integrating each.

Understanding the OpenAI-compatible proxy

An aggregator that exposes an OpenAI-compatible proxy accepts requests in the same format as the OpenAI Chat Completions API. This means any client that speaks this protocol can send requests to the proxy's base URL and receive responses. The proxy then routes the request to the appropriate backend model—whether that's Claude, GPT, DeepSeek, Qwen, GLM, or Kimi—and returns the response in OpenAI format.

The key benefit: you can use one API key and one endpoint to access multiple models, often without changing your code if you're already using an OpenAI-compatible client.

OpenAI SDK: native compatibility

The official OpenAI SDKs (Python, Node.js, etc.) are designed for the OpenAI API but allow overriding the base URL. By setting the base_url (or baseURL in JavaScript) to the aggregator's endpoint and using your aggregator API key, the SDK will work seamlessly.

  • Python: client = OpenAI(baseurl="https://api.aggregator.com/v1", apikey="your-key")
  • Node.js: const client = new OpenAI({ baseURL: 'https://api.aggregator.com/v1', apiKey: 'your-key' })

All standard methods like chat.completions.create work as expected. The aggregator handles model routing based on the model parameter you provide.

Caveat: Some OpenAI-specific features (e.g., function calling, JSON mode) may have varying support depending on the backend model. Check the aggregator's documentation for feature parity.

Anthropic SDK: requires a shim or adapter

The Anthropic SDK uses a different request format (Messages API) and authentication header. It does not natively speak the OpenAI protocol. To use Claude models through the aggregator, you have two options:

  1. Use the OpenAI SDK with a Claude model identifier: Since the aggregator translates OpenAI-format requests to Claude's native format, you can call Claude models using the OpenAI SDK. Just set the model parameter to the Claude model name (e.g., claude-3-opus). This is the simplest approach.
  1. Use an adapter library: If you need Anthropic-specific features (like certain beta headers), you might use a library like openai-anthropic-adapter or write a thin shim that translates Anthropic SDK calls to OpenAI format. However, this is rarely necessary for basic chat completions.

Important: You cannot point the Anthropic SDK directly at the aggregator's OpenAI-compatible endpoint without a translation layer, because the request schema and authentication differ.

LangChain: compatible via OpenAI integration

LangChain provides a dedicated OpenAI wrapper (e.g., langchain_openai.ChatOpenAI in Python). Since it uses the OpenAI SDK under the hood, you can configure it with the aggregator's base URL and API key.

  • Python: ChatOpenAI(openaiapibase="https://api.aggregator.com/v1", openaiapikey="your-key", model="gpt-4")
  • JavaScript: Similar configuration with basePath and apiKey.

LangChain's chains and agents that rely on the OpenAI integration will work. For models from other providers (e.g., Claude), you can still use the ChatOpenAI class with the appropriate model name, as the aggregator handles the translation. LangChain also has native integrations for Anthropic, but those would require direct access to Anthropic's API and would bypass the aggregator.

Note: If you use LangChain's Anthropic wrapper, it won't work through the aggregator without a shim. Stick to the OpenAI wrapper for aggregator access.

LlamaIndex: compatible via OpenAI-like interface

LlamaIndex offers an OpenAILike class (in llama_index.llms) that allows connecting to any OpenAI-compatible endpoint. Configure it with the aggregator's base URL and API key.

  • Python: OpenAILike(apibase="https://api.aggregator.com/v1", apikey="your-key", model="gpt-4", ischatmodel=True)

Alternatively, you can use the standard OpenAI class with a custom api_base. Both approaches work because LlamaIndex delegates to the OpenAI SDK format.

LlamaIndex's native Anthropic integration would not work through the aggregator without adaptation; use the OpenAI-like interface instead.

Vercel AI SDK: compatible with OpenAI provider

The Vercel AI SDK (for JavaScript/TypeScript) provides an OpenAI provider that can be pointed to a custom base URL. Use the createOpenAI function from @ai-sdk/openai and set the baseURL option.

import { createOpenAI } from '@ai-sdk/openai';
const aggregator = createOpenAI({
  baseURL: 'https://api.aggregator.com/v1',
  apiKey: 'your-key',
});
const model = aggregator('gpt-4');

Then use the generateText or streamText functions with this model. The Vercel AI SDK also has providers for Anthropic and other services, but those would not route through the aggregator's OpenAI-compatible endpoint. For aggregator access, use the OpenAI provider with a custom base URL.

Note: Some Vercel AI SDK features like tool calling may have varying support depending on the backend model. Test accordingly.

Other clients and considerations

Many other tools and libraries that support a custom OpenAI base URL will work similarly. These include:

  • OpenAI-compatible clients in other languages (Go, Java, etc.) that allow base URL override.
  • Chat UIs like LibreChat or Chatbox that support OpenAI-compatible endpoints.
  • Observability tools that intercept OpenAI calls (e.g., Helicone, LangSmith) may need configuration to point to the aggregator.

Key points:

  • Always use the aggregator's API key, not the provider's key.
  • The model parameter should be set to the desired model name as recognized by the aggregator.
  • Streaming is supported in most cases; check the aggregator's documentation for any limitations.
  • Error handling: The aggregator may return errors in OpenAI format, so standard error handling applies.

Summary matrix

| SDK/Framework | Works directly? | How to configure |
|---------------|-----------------|------------------|
| OpenAI SDK | Yes | Set base_url to aggregator endpoint |
| Anthropic SDK | No (needs shim) | Use OpenAI SDK with Claude model name, or build adapter |
| LangChain | Yes (via OpenAI wrapper) | Use ChatOpenAI with custom openaiapibase |
| LlamaIndex | Yes (via OpenAILike) | Use OpenAILike with api_base |
| Vercel AI SDK | Yes (via OpenAI provider) | Use createOpenAI with custom baseURL |

By leveraging the OpenAI-compatible proxy, you can integrate a wide range of clients with minimal changes, gaining access to multiple models through a single API key and billing relationship.