How to call the model "Assistant" of ChatGPT

Hello there! Does anyone know how I can call the model Assistant tweaking this code below?

The code works well for model Davince-003 but not for model Assistant.


  <div id="chatOutput"></div>
  <form id="chatForm" autocomplete="new-password">
    <input type="text" id="messageInput">
    <button type="submit">Enviar</button>
    function displayMessage(text, index) {
      if (index < text.length) {
        document.getElementById("chatOutput").innerHTML += text[index];
        setTimeout(function() {
          displayMessage(text, index + 1);
        }, 50);

document.getElementById("chatForm").addEventListener("submit", function(event) {

  // Obter a mensagem do usuário
  const message = document.getElementById("messageInput").value;

  // Adicionar a mensagem do usuário à página
  const questionDiv = document.createElement("div");
  questionDiv.innerHTML = `<strong>Pergunta:</strong> ${message}`;

  // Enviar a mensagem para o GPT
  fetch("", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Authorization: "Bearer THE API KEY"
    body: JSON.stringify({
      model: "assistant",
      prompt: message,
      max_tokens: 256
    .then(response => response.json())
    .then(data => {