유형: 프레임워크 또는 플랫폼기본 경로: OpenAI 호환 기본값지원 신뢰도: 권장 통합 패턴
TokenLab의 경우, Vercel AI SDK에서 가장 안정적인 기본값은 **OpenAI 호환 제공자(OpenAI-compatible provider)**입니다.만약 Responses-native 동작이 특별히 필요한 경우, OpenAI 제공자로 전환하고 동일한 TokenLab 기본 URL을 유지할 수 있습니다.이 페이지는 권장 통합 패턴으로 간주해야 하며, Vercel AI SDK의 모든 헬퍼가 TokenLab에서 지원된다는 보장은 아닙니다.
import { generateText } from 'ai';import { tokenlab } from '@tokenlabai/ai-sdk-provider';const { text } = await generateText({ model: tokenlab.chatModel('gpt-5.4'), prompt: 'Explain TokenLab in one sentence.',});console.log(text);
import { generateText } from 'ai';import { tokenlab } from './tokenlab';const { text } = await generateText({ model: tokenlab.chatModel('gpt-5.4'), prompt: 'Explain TokenLab in one sentence.',});console.log(text);
import { streamText } from 'ai';import { tokenlab } from './tokenlab';const result = await streamText({ model: tokenlab.chatModel('gpt-5.4'), prompt: 'Write a short poem about coding.',});for await (const textPart of result.textStream) { process.stdout.write(textPart);}
import { generateText } from 'ai';import { tokenlabResponses } from './tokenlab-responses';const { text } = await generateText({ model: tokenlabResponses('gpt-5.4'), prompt: 'Explain TokenLab in one sentence.',});
프록시 스타일 통합을 위한 안전한 기본값으로 @ai-sdk/openai-compatible을 사용하십시오. /v1/responses를 기반으로 구축된 제공자 경로가 명시적으로 필요한 경우에만 @ai-sdk/openai로 전환하십시오.