You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many LLM providers now offer Anthropic-compatible APIs, but TanStack AI's @tanstack/ai-anthropic adapter currently doesn't support custom base URLs. This limits developers from using cost-effective alternatives or specialized models that follow the Anthropic API standard.
Proposed Solution
Add baseURL support to the AnthropicConfig interface, similar to how the OpenAI adapter works:
import { anthropic } from '@tanstack/ai-anthropic';
import { chat } from '@tanstack/ai';
// Current limitation - this doesn't work
const adapter = anthropic({
apiKey: process.env.GLM_API_KEY,
baseURL: 'https://open.bigmodel.cn/api/paas/v4', // ❌ Not supported
});
// Proposed solution
const adapter = anthropic({
apiKey: process.env.GLM_API_KEY,
baseURL: 'https://open.bigmodel.cn/api/paas/v4', // ✅ Should work
});
const stream = chat({
adapter,
model: 'glm-4.6',
messages: [{ role: 'user', content: 'Hello!' }],
});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Many LLM providers now offer Anthropic-compatible APIs, but TanStack AI's @tanstack/ai-anthropic adapter currently doesn't support custom base URLs. This limits developers from using cost-effective alternatives or specialized models that follow the Anthropic API standard.
Proposed Solution
Add baseURL support to the AnthropicConfig interface, similar to how the OpenAI adapter works:
Beta Was this translation helpful? Give feedback.
All reactions