test-model.mjs 307 B

123456789101112
  1. import { createAnthropic } from '@ai-sdk/anthropic';
  2. const client = createAnthropic({
  3. apiKey: process.env.ZCODE_API_KEY,
  4. baseURL: 'https://open.bigmodel.cn/api/anthropic',
  5. });
  6. const result = await client('glm-4.7').generateText({
  7. prompt: 'say hello in 3 words',
  8. });
  9. console.log('Result:', result);