Use ChatGPT
Totalum allows you to use OpenAI's ChatGPT API without the need to register for an OpenAI account. You can use it directly through the Totalum SDK or API.
📚 Setup Required: For installation and usage of the Totalum SDK or API, see the Installation Guide.
No hace falta que te registres en openai
Functions for call OpenAI API without need to have an OpenAI account
Create a chat completion
//body the openai chat completion body, more info here: https://platform.openai.com/docs/api-reference/chat/create
const bodyExample={
// see the openai api docs for more info
messages: [
{content: 'You are a math specialist assistant', role: 'system'},
{content: 'how I can resolve a matrix', role: 'user'}
//etc...
],
model: 'gpt-4.1-mini',
max_tokens: 200,
}
const result = await totalumClient.openai.createChatCompletion(bodyExample);
const chatCompletion = result.data;
// returns the completion provided by openai api