Help with VAPI (does not use the agent I created)
# support
g
I created a JSON in docs.vapi.ai, by filling in the necessary fields. I filled in the assistantId with the code of my assistant, already tested in the VAPI dashboard, transcriber, model and voice are also filled in. I am receiving the code 201, because the call is being made to my number, but it seems that the assistant that is being used is not the one I created, but rather, a generic OpenAI agent. The agent that I built is in VAPI itself and I gave the code for it to be used. But it seems that VAPI is ignoring this and using an empty Open.ai prompt... Can someone help and tell me where the error is? Below is the JSON... I just removed my phone number, so that you can test with your own phones... curl -X POST https://api.vapi.ai/call \ -H "Authorization: Bearer xxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "assistantId": "0659f2a1-57e8-4f4a-b452-0af09a332d9e", "assistant": { "transcriber": { "provider": "deepgram", "language": "pt-BR", "model": "nova-2" }, "model": { "provider": "openai", "model": "gpt-4" }, "voice": { "provider": "11labs", "voiceId": "CstacWqMhJQlnfLPxRG4", "model": "eleven_turbo_v2_5", "language": "pt" }, "firstMessageMode": "assistant-speaks-first" }, "phoneNumber": { "twilioAccountSid": "AC9a74d632e266d9db010edd94be340288", "twilioAuthToken": "df723d3020710e2557d5db02e7ad0ee7", "twilioPhoneNumber": "XXXXXXXXXXX" }, "customer": { "number": "XXXXXXXXXX" } }'
s
@Guilherme Kologeski Remove the transient assistant from create call payload and then the expected assistant will be used correctly. The transient has precedence over assistantID so, when you tried to make the call transient took precedence over assistantID.
g
@Shubham Bajaj I don't know/I didn't find the transient helper in json... how do I disable it? Forgive me for the English translation if it is incorrect.
s
Just remove the property
assistant
from your payload to create call and only use
assistantId
.
current
Copy code
curl -X POST https://api.vapi.ai/call \
     -H "Authorization: Bearer xxxxxxxxxxxxxxx" \
     -H "Content-Type: application/json" \
     -d '{
  "assistantId": "0659f2a1-57e8-4f4a-b452-0af09a332d9e",
  "assistant": {
    "transcriber": {
      "provider": "deepgram",
      "language": "pt-BR",
      "model": "nova-2"
    },
    "model": {
      "provider": "openai",
      "model": "gpt-4"
    },
    "voice": {
      "provider": "11labs",
      "voiceId": "CstacWqMhJQlnfLPxRG4",
      "model": "eleven_turbo_v2_5",
      "language": "pt"
    },
    "firstMessageMode": "assistant-speaks-first"
  },
  "phoneNumber": {
    "twilioAccountSid": "",
    "twilioAuthToken": "",
    "twilioPhoneNumber": "XXXXXXXXXXX"
  },
  "customer": {
    "number": "XXXXXXXXXX"
  }
}'
next
Copy code
curl -X POST https://api.vapi.ai/call \
     -H "Authorization: Bearer xxxxxxxxxxxxxxx" \
     -H "Content-Type: application/json" \
     -d '{
  "assistantId": "0659f2a1-57e8-4f4a-b452-0af09a332d9e",
  "phoneNumber": {
    "twilioAccountSid": "",
    "twilioAuthToken": "",
    "twilioPhoneNumber": "XXXXXXXXXXX"
  },
  "customer": {
    "number": "XXXXXXXXXX"
  }
}'
@Guilherme Kologeski Please regenerate your twilio credentials because you have made them public unless they are mocked/fake.