Send a chat message to Airbolt and receive a complete response (non-streaming)
Note: For the default streaming behavior, use chat() instead.
chat()
Array of messages in the conversation
Optional
Optional configuration
The complete response including content and usage information
const response = await chatSync([ { role: 'user', content: 'Hello, how are you?' }]);console.log(response.content); // "I'm doing well, thank you!"console.log(response.usage?.total_tokens); // 42 Copy
const response = await chatSync([ { role: 'user', content: 'Hello, how are you?' }]);console.log(response.content); // "I'm doing well, thank you!"console.log(response.usage?.total_tokens); // 42
// With optionsconst response = await chatSync( [{ role: 'user', content: 'Tell me a joke' }], { baseURL: 'https://api.airbolt.dev', system: 'You are a helpful assistant who tells funny jokes' }); Copy
// With optionsconst response = await chatSync( [{ role: 'user', content: 'Tell me a joke' }], { baseURL: 'https://api.airbolt.dev', system: 'You are a helpful assistant who tells funny jokes' });
Send a chat message to Airbolt and receive a complete response (non-streaming)
Note: For the default streaming behavior, use
chat()
instead.