
BotHub: Попробуйте ИИ прямо сейчасbot
Provedores gpt-5-chatNo Bothub você pode escolher seus próprios provedores para as solicitações. Se você não fez uma escolha, encontraremos automaticamente provedores adequados que possam lidar com o tamanho e os parâmetros de sua solicitação.
Пример кода и API для gpt-5-chatМы предлагаем полный доступ к API OpenAI через наш сервис. Все наши конечные точки полностью соответствуют конечным точкам OpenAI, их можно использовать как с плагинами, так и при разработке собственного программного обеспечения через SDK.Создать API ключ
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: '<your bothub access token>',
baseURL: 'https://bothub.chat/api/v2/openai/v1'
});
// Sync - Text generation
async function main() {
const chatCompletion = await openai.chat.completions.create({
messages: [{ role: 'user', content: 'Say this is a test' }],
model: 'gpt-5-chat',
});
}
// Async - Text generation
async function main() {
const stream = await openai.chat.completions.create({
messages: [{ role: 'user', content: 'Say this is a test' }],
model: 'gpt-5-chat',
stream: true
});
for await (const chunk of stream) {
const part: string | null = chunk.choices[0].delta?.content ?? null;
}
}
main();
Como funciona gpt-5-chat?
Os bothubs coletam informações...