Search
Try Notion
Basics
The following guide will walk you through all of the pieces you need to sign up and start building a conversational application on the MKCLOUD platform. If you run into any issues or need help with implementation, please reach out on the forum: https://forum.meetkai.cloud or on our discord
Step 1: Get API Key
Fill out the form on the below page: We suggest using a personal email to ensure no spam filtering. Furthermore, please check your spam folder. It may take a few minutes to arrive
Once you have received the Welcome email you will see an API key (see screenshot below) Please save this securely. This API key can be shared with other developers on your team. It may take up to 60 minutes for the API key to become active on all edge servers.
Setup
All the code samples below assume the following environment variables are exported
💡
Note the difference in endpoints between production and staging. staging.meetkai.cloud is NOT a stable environment. Please use meetkai.cloud as the endpoint for evaluation purposes.
export PRODUCTION_ENDPOINT="meetkai.cloud" export STAGING_ENDPOINT="staging.meetkai.cloud" export ENDPOINT=$PRODUCTION_ENDPOINT export API_KEY="fbc49892c5cfb488f43037a31d8ac10883768a94bfcf630a4e22b70341f2f491"
Bash
To test if it is active use the following endpoint:
Example request:
curl "https://$ENDPOINT/api/auth/alpha/whoami" --header "X-API-KEY: $API_KEY"
Bash
Example response:
{"domain":"jek.io"}
JSON
Step 2: Users
Whenever you have a new user of your service that you want to enable communication with the MKCLOUD on behalf of, you need to register them. This can correspond to the first time the application is opened or the first message sent to MKCLOUD on behalf of the uuid.
Register Example
The first time you need to send a request call the create_end_user endpoint passing in a UUID that will identify the user going forward. We suggest reusing your own internal UUID for the user.
Note that the user_uid returned is the MKCLOUD user_uid, and expected to be different. This user_uid should be unique for each user.
Example request:
curl -L -X POST "https://$ENDPOINT/api/auth/alpha/create_end_user" \ -H "X-API-KEY: $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "user_uid": "test-user-0" }'
Bash
Example Response
{ "user_id": "PaGUxrCRXfMzZq6xXnNhJGrjTS52", "id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ijc3MTBiMDE3ZmQ5YjcxMWUwMDljNmMzNmIwNzNiOGE2N2NiNjgyMTEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vbWstdmEtdXMiLCJhdWQiOiJtay12YS11cyIsImF1dGhfdGltZSI6MTYyNjY0MjI5OSwidXNlcl9pZCI6IlBhR1V4ckNSWGZNelpxNnhYbk5oSkdyalRTNTIiLCJzdWIiOiJQYUdVeHJDUlhmTXpacTZ4WG5OaEpHcmpUUzUyIiwiaWF0IjoxNjI2NjQyMjk5LCJleHAiOjE2MjY2NDU4OTksImVtYWlsIjoidGVzdC11c2VyLTBAMS51c2Vycy5qZWsuaW8iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsidGVzdC11c2VyLTBAMS51c2Vycy5qZWsuaW8iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9fQ.KgWFlOGks6yP76ZGsB3j0T0YrRwBfVvuwowkrovYavopX7gs00H2C9Isy7MrFAMVPfq2Zvcvhiu15SlOk2eG9Dykzab-72xf2MhdEP03u4DnQXVdN_A4ZLzkHlYmTDW_PMNSCfadB05pWxZHDMtm88IryUa0QcdBkDOHtl_yxGBjftbuYDLjJ-xBj1CBCJtYeM7mjBj7-qob8vnY4DtM1UOw6ItKQvvVf_sr1zxj_JgWUBWVH2MN9OMF9eoOc3nJYUt0seKeoOIytTAsjSQSCCOnMYU4PS_zmrX2349lvXEjn9MAqu3AWt1llIjuAAKQUZPyEBvT6Gb2aCEUrDE80w", "refresh_token": "AGEhc0AV61-oL2TG9Y0FX9na_xFXfMeiESseYMb48emRfmNKRa__ThE_qjLsO08z8ijCXOdpPufdo8RNXUKRmJKvTnavq17dYCxVbPy54SyfcAVOQT08BNiIPKhs9jOfnZTgPVe251hFoq03KKS57k_KWquv9xuiZXau-ShqdwXKntqgyyQUNbh1l3J-CCmkU1vGqx8KQfW4maNNpPZWUPZ7zSd3azX9wg" }
JSON
The id_token for the user will need to be passed for all requests made to MKCLOUD on behalf of that user.
User lifecycle
The id_token JWT can be refreshed using the refresh_end_user endpoint:
Example request:
curl -L -X POST "https://$ENDPOINT/api/auth/alpha/refresh_end_user" \ -H "X-API-KEY: $API_KEY" \ -H "Content-Type: application/json" \ --data-raw "{ \"refresh_token\": \"AGEhc0AV61-oL2TG9Y0FX9na_xFXfMeiESseYMb48emRfmNKRa__ThE_qjLsO08z8ijCXOdpPufdo8RNXUKRmJKvTnavq17dYCxVbPy54SyfcAVOQT08BNiIPKhs9jOfnZTgPVe251hFoq03KKS57k_KWquv9xuiZXau-ShqdwXKntqgyyQUNbh1l3J-CCmkU1vGqx8KQfW4maNNpPZWUPZ7zSd3azX9wg\" }"
Bash
Example response:
{ "refresh_token": "AGEhc0AV61-oL2TG9Y0FX9na_xFXfMeiESseYMb48emRfmNKRa__ThE_qjLsO08z8ijCXOdpPufdo8RNXUKRmJKvTnavq17dYCxVbPy54SyfcAVOQT08BNiIPKhs9jOfnZTgPVe251hFoq03KKS57k_KWquv9xuiZXau-ShqdwXKntqgyyQUNbh1l3J-CCmkU1vGqx8KQfW4maNNpPZWUPZ7zSd3azX9wg", "id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ijc3MTBiMDE3ZmQ5YjcxMWUwMDljNmMzNmIwNzNiOGE2N2NiNjgyMTEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vbWstdmEtdXMiLCJhdWQiOiJtay12YS11cyIsImF1dGhfdGltZSI6MTYyNjY0MjI5OSwidXNlcl9pZCI6IlBhR1V4ckNSWGZNelpxNnhYbk5oSkdyalRTNTIiLCJzdWIiOiJQYUdVeHJDUlhmTXpacTZ4WG5OaEpHcmpUUzUyIiwiaWF0IjoxNjI2NjQ2ODMzLCJleHAiOjE2MjY2NTA0MzMsImVtYWlsIjoidGVzdC11c2VyLTBAMS51c2Vycy5qZWsuaW8iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsidGVzdC11c2VyLTBAMS51c2Vycy5qZWsuaW8iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9fQ.bVjv3JbjHLKFF4v0WOvnojp2nBpC8eBYFCRM_22UnKYsQ_tRubxggOORKtTjBldlzQJSxShdy3GcyjJW18OfycwdTod16Lc0keRW8yGWfquKMNHBIvbvv2W-z_cFZZw09g2Lm7069s1S6AZfMOcMMNApjXZOuHYSgSc0drPSYAbAo4z8An-UWIxSlszqwU80elGxH_XWLNRSlT6DTSKAx5qHW-dcQ3yTR6BDB6ypFZcFb15tRnf4_siPbilmSobl5Hn-H3gONqKmkAOoEmCKzoHiS1OquDFDOZ3fYiEYC2GKKnA6PEHiZhTTbpvgo3ZTKTFxMB7Jd2tt8AYcJCf2Qg", "user_id": "PaGUxrCRXfMzZq6xXnNhJGrjTS52" }
Python
You can get a new id_token and, if expired, a new refresh Token for a user by calling the register endpoint using an existing UUID. This should only be done with reason, as it is a slower request.
Example request:
curl -L -X POST "https://$ENDPOINT/api/auth/alpha/create_end_user" \ -H "X-API-KEY: $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "user_uid": "test-user-0" }'
Bash
Example response:
{ "user_id": "PaGUxrCRXfMzZq6xXnNhJGrjTS52", "id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ijc3MTBiMDE3ZmQ5YjcxMWUwMDljNmMzNmIwNzNiOGE2N2NiNjgyMTEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vbWstdmEtdXMiLCJhdWQiOiJtay12YS11cyIsImF1dGhfdGltZSI6MTYyNjY0MjI5OSwidXNlcl9pZCI6IlBhR1V4ckNSWGZNelpxNnhYbk5oSkdyalRTNTIiLCJzdWIiOiJQYUdVeHJDUlhmTXpacTZ4WG5OaEpHcmpUUzUyIiwiaWF0IjoxNjI2NjQyMjk5LCJleHAiOjE2MjY2NDU4OTksImVtYWlsIjoidGVzdC11c2VyLTBAMS51c2Vycy5qZWsuaW8iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsidGVzdC11c2VyLTBAMS51c2Vycy5qZWsuaW8iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9fQ.KgWFlOGks6yP76ZGsB3j0T0YrRwBfVvuwowkrovYavopX7gs00H2C9Isy7MrFAMVPfq2Zvcvhiu15SlOk2eG9Dykzab-72xf2MhdEP03u4DnQXVdN_A4ZLzkHlYmTDW_PMNSCfadB05pWxZHDMtm88IryUa0QcdBkDOHtl_yxGBjftbuYDLjJ-xBj1CBCJtYeM7mjBj7-qob8vnY4DtM1UOw6ItKQvvVf_sr1zxj_JgWUBWVH2MN9OMF9eoOc3nJYUt0seKeoOIytTAsjSQSCCOnMYU4PS_zmrX2349lvXEjn9MAqu3AWt1llIjuAAKQUZPyEBvT6Gb2aCEUrDE80w", "refresh_token": "AGEhc0AV61-oL2TG9Y0FX9na_xFXfMeiESseYMb48emRfmNKRa__ThE_qjLsO08z8ijCXOdpPufdo8RNXUKRmJKvTnavq17dYCxVbPy54SyfcAVOQT08BNiIPKhs9jOfnZTgPVe251hFoq03KKS57k_KWquv9xuiZXau-ShqdwXKntqgyyQUNbh1l3J-CCmkU1vGqx8KQfW4maNNpPZWUPZ7zSd3azX9wg" }
Python
Step 3: Conversational API
With an id_token for a user and your API key you can start making conversational API requests.
Clearing
Before the first turn in your multi-turn dialogue you should call the /clear endpoint. This will ensure any previous conversation context is cleared. Otherwise, if there is a previous ongoing conversation that was never cleared, it will be continued from that point.
Example request:
curl -L -X POST "https://$ENDPOINT/api/oscar/alpha/clear" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6Ijc3MTBiMDE3ZmQ5YjcxMWUwMDljNmMzNmIwNzNiOGE2N2NiNjgyMTEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vbWstdmEtdXMiLCJhdWQiOiJtay12YS11cyIsImF1dGhfdGltZSI6MTYyNjY0MjI5OSwidXNlcl9pZCI6IlBhR1V4ckNSWGZNelpxNnhYbk5oSkdyalRTNTIiLCJzdWIiOiJQYUdVeHJDUlhmTXpacTZ4WG5OaEpHcmpUUzUyIiwiaWF0IjoxNjI2NjQ3NTA1LCJleHAiOjE2MjY2NTExMDUsImVtYWlsIjoidGVzdC11c2VyLTBAMS51c2Vycy5qZWsuaW8iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsidGVzdC11c2VyLTBAMS51c2Vycy5qZWsuaW8iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9fQ.fYjeHGVNLB1b0vJHmh80XNmz57pu5F6fV96yN1BQjX6gxb3EqJgW1OF4amK6d4BkvuFtKLpLW6N2uSc9xZq2Ad5rc73pn1Qp2DTHmT5AHCAPiUbLeMl8ErdNpeDfwwqUfIApjqlc0uKpYHMiAuF80kLPm4rmaZv0tyP29o62rtgWj9GfgwwqMkRBN5HCU5lxk-j2z-KWJFwsyKisy6gWXhqdigtYxIVsZ81YLcLnyHKVD-URVefkZ43fiWcfLHeDGK99ZAh816ltzcTo8sUOmJY3dpT-5lMqsUOFht_Oz8Sk0r3whf07ms3GSUIwEcoOus0H7pg-DnKIiPhwgW9XCg" \ -H "X-API-KEY: $API_KEY"
Bash
Example response:
{ "clear": "OK" }
JSON
Sending Messages
We provide 2 different APIs for sending messages to our backend on behalf of the user.
Batch API
The batch API returns an array of messages that should be sent back to the user in order.
💡
Want a full explanation of the headers, see: here
Example request:
curl -L -X POST "https://$ENDPOINT/api/oscar/alpha/message_batch" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6Ijc3MTBiMDE3ZmQ5YjcxMWUwMDljNmMzNmIwNzNiOGE2N2NiNjgyMTEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vbWstdmEtdXMiLCJhdWQiOiJtay12YS11cyIsImF1dGhfdGltZSI6MTYyNjY0Njk5NywidXNlcl9pZCI6IlBhR1V4ckNSWGZNelpxNnhYbk5oSkdyalRTNTIiLCJzdWIiOiJQYUdVeHJDUlhmTXpacTZ4WG5OaEpHcmpUUzUyIiwiaWF0IjoxNjI2NjQ2OTk3LCJleHAiOjE2MjY2NTA1OTcsImVtYWlsIjoidGVzdC11c2VyLTBAMS51c2Vycy5qZWsuaW8iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsidGVzdC11c2VyLTBAMS51c2Vycy5qZWsuaW8iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9fQ.Rk4g0EKg9rbKzycl4UUSgHOKyU4F1kHAKaVG-ShCO_ifmHGOjE1QHfFl8T_xEwhRahKMIJ4ZYrZaYSp3Uz9AuAUrrHTajwXlRYO7pndnDhz6cuEPL6F-NpIwrHLOPwmHF-Ja0EqVIawMCnlVMDaUAGeoc3G-EYnkr9fQtGqOvAJ1PJ72a1NqOCfh2MxKRxAcJYzcJWoBhhA_yUVXzsqXDPb0HJprUl0zRIiSePfxEXpwhiDjQpsi9gnxjMnn4sCsyDeyUk8I0f93mr1yUTzuCv-MImCuPgAw4xfGnQb_AJHR2CpZTxpycIMIX3kzeNLJPQdKwELQ8UYiefgUMyAjpA" \ -H "User-Region: US" \ -H "User-Language: en" \ -H "Kai-Voice: English" \ -H "User-Location: 33.987776,-118.441071" \ -H "User-Time: 2021-07-18T16:14:16+07:00" \ -H "X-API-KEY: $API_KEY" \ -H "Content-Type: application/json" \ --data-raw "{ \"transcripts\": [ { \"transcript\": \"action movies on netflix\" } ], \"source\": \"text\" }"
Bash
💡
By default the API is typo tolerant, if you do not need this and want a faster response you can add: Kai-Spellcheck: 0 as a header.
Example Response
[{"msg_type":"text_msg","tts_text":"The Mitchells vs. the Machines is an animation perfect for the family","should_speak":true,"language":null,"region":null,"locale":null},{"msg_type":"result_msg","item":{"domain":"streaming","name":"The Mitchells vs. the Machines","img_urls":["https://image.tmdb.org/t/p/w300/mI2Di7HmskQQ34kz0iau6J1vr70.jpg"],"click_url":"https://meetkai.com/streaming/movie::501929-US","hwfastapp_url":"hwfastapp://com.meetkai.hag.app.streaming/detailsPage?item_id=movie::501929-US&domain=streaming","like_url":null,"seen_url":null,"dislike_url":null,"rank":0.8,"item_id":"movie::501929-US","hashtags":[{"id":"trending","clear":"trending","score":5.0,"is_featured":false},{"id":"2010s","clear":"2010s","score":0.0,"is_featured":false},{"id":"genres","clear":"Animation","score":10.0,"is_featured":false},{"id":"genres","clear":"Adventure","score":10.0,"is_featured":false},{"id":"genres","clear":"Comedy","score":10.0,"is_featured":false},{"id":"genres","clear":"Family","score":10.0,"is_featured":false},{"id":"genres","clear":"Science Fiction","score":10.0,"is_featured":false},{"id":"genres","clear":"Action","score":10.0,"is_featured":false},{"id":"objectType","clear":"movie","score":20.0,"is_featured":false},{"id":"cast","clear":"Abbi Jacobson","score":-2.0,"is_featured":false},{"id":"cast","clear":"Danny McBride","score":-2.0,"is_featured":false},{"id":"cast","clear":"Maya Rudolph","score":-2.0,"is_featured":false},{"id":"cast","clear":"Olivia Colman","score":-2.0,"is_featured":false},{"id":"cast","clear":"Michael Rianda","score":-2.0,"is_featured":false},{"id":"cast","clear":"Eric André","score":-2.0,"is_featured":false},{"id":"cast","clear":"Fred Armisen","score":-2.0,"is_featured":false},{"id":"crew","clear":"Mark Mothersbaugh","score":-2.0,"is_featured":false},{"id":"crew","clear":"Kurt Albrecht","score":-2.0,"is_featured":false},{"id":"crew","clear":"Daniel Chuba","score":-2.0,"is_featured":false},{"id":"crew","clear":"Louis Koo","score":-2.0,"is_featured":false},{"id":"studios","clear":"Lord Miller Productions","score":2.0,"is_featured":false},{"id":"studios","clear":"Columbia Pictures","score":2.0,"is_featured":false},{"id":"studios","clear":"Sony Pictures Animation","score":2.0,"is_featured":false},{"id":"studios","clear":"One Cool Film Production","score":2.0,"is_featured":false}],"card":{"title":"The Mitchells vs. the Machines","subtitle":"#movie #Animation #Adventure #Comedy #Family","media":["https://image.tmdb.org/t/p/w300/mI2Di7HmskQQ34kz0iau6J1vr70.jpg"],"subheading":"#movie #Animation #Adventure #Comedy #Family","text":null,"buttons":[{"id":"click","name":"Go","uri":"https://meetkai.com/streaming/movie::501929-US","icon":null}]},"genres":["Animation","Adventure","Comedy","Family","Science Fiction","Action"],"runtime":114,"original_release_year":2021,"age_certification":"PG","trailers":{"youtube":[{"name":"Official Trailer","size":"HD","source":"9c52Z5sMuTQ","type":"Trailer"},{"name":"Official Trailer","size":"HD","source":"_ak5dFt8Ar0","type":"Trailer"}]},"short_description":"A quirky, dysfunctional family's road trip is upended when they find themselves in the middle of the robot apocalypse and suddenly become humanity's unlikeliest last hope.","object_type":"movie"}}]
JavaScript
Important notes
You can use the "card" object to quickly build out an interface. This is found under msg['item']['card']
Example:
{"card":{"title":"The Mitchells vs. the Machines","subtitle":"#movie #Animation #Adventure #Comedy #Family","media":["https://image.tmdb.org/t/p/w300/mI2Di7HmskQQ34kz0iau6J1vr70.jpg"],"subheading":"#movie #Animation #Adventure #Comedy #Family","text":null,"buttons":[{"id":"click","name":"Go","uri":"https://meetkai.com/streaming/movie::501929-US","icon":null}]}
JSON
The click_url should be used for the "action button", it is currently in ALPHA and the enhanced cards are going to be released by the beginning of August
The hwfastapp_url link can be used to deeplink to the MeetKai quick apps on supported platforms (stability coming end of July)
The app_url link can be used to deep link to the MeetKai VA App on supported platforms if it is installed (stability coming end of July)
limit_domains is an optional parameter (see API docs). Setting this value will reduce results to the subset of domains. Possible domain values are: streaming, restaurant, news, recipe, shopping, beer, book, fitness, gaming, meditation, podcast, and wine.
Streaming API
The streaming message API can be called exactly as the message_batch API. The difference is that the streaming API will stream back messages as JSON lines at a time. This enables rendering results back to the user faster.
Example Request
curl -L -X POST -N "https://$ENDPOINT/api/oscar/alpha/message" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6Ijc3MTBiMDE3ZmQ5YjcxMWUwMDljNmMzNmIwNzNiOGE2N2NiNjgyMTEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vbWstdmEtdXMiLCJhdWQiOiJtay12YS11cyIsImF1dGhfdGltZSI6MTYyNjY0MjI5OSwidXNlcl9pZCI6IlBhR1V4ckNSWGZNelpxNnhYbk5oSkdyalRTNTIiLCJzdWIiOiJQYUdVeHJDUlhmTXpacTZ4WG5OaEpHcmpUUzUyIiwiaWF0IjoxNjI2NjUwODY1LCJleHAiOjE2MjY2NTQ0NjUsImVtYWlsIjoidGVzdC11c2VyLTBAMS51c2Vycy5qZWsuaW8iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsidGVzdC11c2VyLTBAMS51c2Vycy5qZWsuaW8iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9fQ.T3cCI2UQGL5IZ2GXyiameRXpZXDdxzcnQg1icjLCernODP_4YRrN9dqUj5QY8j1ixAWfyHdsVED1znB5wKln4AgExsGDhEGL2p8dCs-hWEiH_M4qInA5vKr9P--corx0K0RbrFZ9PLFPmIKLp3sqGXIOxlwn5CnEi41rHFqgyh2vI5x8WjWxyeoaxsz78jKZHrBKSPMteWVHmI-1UOcuyFPsjbkMQRB9Ak7HQ4cS0OE7XyxmWj4Co1OCkFwNqKTadnIPCb5vT5HjD5lEGBxBNZ22rul0PHlh4bTPCL4Bbhr_VF9n3zuIhekMs7tPdumks4UugRgOSL0mHRDc8D5ouQ" \ -H "User-Region: US" \ -H "User-Language: en" \ -H "Kai-Voice: English" \ -H "User-Location: 33.987776,-118.441071" \ -H "User-Time: 2021-07-18T16:14:16+07:00" \ -H "X-API-KEY: $API_KEY" \ -H "Content-Type: application/json" \ --data-raw "{ \"transcripts\": [ { \"transcript\": \"action movies on netflix\" } ], \"source\": \"text\" }"
Bash
Example Response:
{"msg_type": "text_msg", "tts_text": "The Mitchells vs. the Machines is an animation perfect for the family", "should_speak": true, "language": null, "region": null, "locale": null} {"msg_type": "result_msg", "item": {"domain": "streaming", "name": "The Mitchells vs. the Machines", "img_urls": ["https://image.tmdb.org/t/p/w300/mI2Di7HmskQQ34kz0iau6J1vr70.jpg"], "click_url": "https://meetkai.com/streaming/movie::501929-US", "hwfastapp_url": "hwfastapp://com.meetkai.hag.app.streaming/detailsPage?item_id=movie::501929-US&domain=streaming", "like_url": null, "seen_url": null, "dislike_url": null, "rank": 0.8, "item_id": "movie::501929-US", "hashtags": [{"id": "trending", "clear": "trending", "score": 5.0, "is_featured": false}, {"id": "2010s", "clear": "2010s", "score": 0.0, "is_featured": false}, {"id": "genres", "clear": "Animation", "score": 10.0, "is_featured": false}, {"id": "genres", "clear": "Adventure", "score": 10.0, "is_featured": false}, {"id": "genres", "clear": "Comedy", "score": 10.0, "is_featured": false}, {"id": "genres", "clear": "Family", "score": 10.0, "is_featured": false}, {"id": "genres", "clear": "Science Fiction", "score": 10.0, "is_featured": false}, {"id": "genres", "clear": "Action", "score": 10.0, "is_featured": false}, {"id": "objectType", "clear": "movie", "score": 20.0, "is_featured": false}, {"id": "cast", "clear": "Abbi Jacobson", "score": -2.0, "is_featured": false}, {"id": "cast", "clear": "Danny McBride", "score": -2.0, "is_featured": false}, {"id": "cast", "clear": "Maya Rudolph", "score": -2.0, "is_featured": false}, {"id": "cast", "clear": "Olivia Colman", "score": -2.0, "is_featured": false}, {"id": "cast", "clear": "Michael Rianda", "score": -2.0, "is_featured": false}, {"id": "cast", "clear": "Eric Andr\u00e9", "score": -2.0, "is_featured": false}, {"id": "cast", "clear": "Fred Armisen", "score": -2.0, "is_featured": false}, {"id": "crew", "clear": "Mark Mothersbaugh", "score": -2.0, "is_featured": false}, {"id": "crew", "clear": "Kurt Albrecht", "score": -2.0, "is_featured": false}, {"id": "crew", "clear": "Daniel Chuba", "score": -2.0, "is_featured": false}, {"id": "crew", "clear": "Louis Koo", "score": -2.0, "is_featured": false}, {"id": "studios", "clear": "Lord Miller Productions", "score": 2.0, "is_featured": false}, {"id": "studios", "clear": "Columbia Pictures", "score": 2.0, "is_featured": false}, {"id": "studios", "clear": "Sony Pictures Animation", "score": 2.0, "is_featured": false}, {"id": "studios", "clear": "One Cool Film Production", "score": 2.0, "is_featured": false}], "card": {"title": "The Mitchells vs. the Machines", "subtitle": "#movie #Animation #Adventure #Comedy #Family", "media": ["https://image.tmdb.org/t/p/w300/mI2Di7HmskQQ34kz0iau6J1vr70.jpg"], "subheading": "#movie #Animation #Adventure #Comedy #Family", "text": null, "buttons": [{"id": "click", "name": "Go", "uri": "https://meetkai.com/streaming/movie::501929-US", "icon": null}]}, "genres": ["Animation", "Adventure", "Comedy", "Family", "Science Fiction", "Action"], "runtime": 114, "original_release_year": 2021, "age_certification": "PG", "trailers": {"youtube": [{"name": "Official Trailer", "size": "HD", "source": "9c52Z5sMuTQ", "type": "Trailer"}, {"name": "Official Trailer", "size": "HD", "source": "_ak5dFt8Ar0", "type": "Trailer"}]}, "short_description": "A quirky, dysfunctional family's road trip is upended when they find themselves in the middle of the robot apocalypse and suddenly become humanity's unlikeliest last hope.", "object_type": "movie"}}
JSON
Multi-Turn conversation
By sending a follow up message with the same Authorization token, you can continue the dialogue. This is done by default. If this is not intended, then you need to call the /clear endpoint.
💡
Multi-Turn can extend to different domains (multi-domain), or within the same domain (true multi-turn). You can try follow ups like "something with comedy" or "tell me the cast"
Example Request
curl -L -X POST -N "https://$ENDPOINT/api/oscar/alpha/message" \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6Ijc3MTBiMDE3ZmQ5YjcxMWUwMDljNmMzNmIwNzNiOGE2N2NiNjgyMTEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vbWstdmEtdXMiLCJhdWQiOiJtay12YS11cyIsImF1dGhfdGltZSI6MTYyNjY0MjI5OSwidXNlcl9pZCI6IlBhR1V4ckNSWGZNelpxNnhYbk5oSkdyalRTNTIiLCJzdWIiOiJQYUdVeHJDUlhmTXpacTZ4WG5OaEpHcmpUUzUyIiwiaWF0IjoxNjI2NjUwODY1LCJleHAiOjE2MjY2NTQ0NjUsImVtYWlsIjoidGVzdC11c2VyLTBAMS51c2Vycy5qZWsuaW8iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsidGVzdC11c2VyLTBAMS51c2Vycy5qZWsuaW8iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9fQ.T3cCI2UQGL5IZ2GXyiameRXpZXDdxzcnQg1icjLCernODP_4YRrN9dqUj5QY8j1ixAWfyHdsVED1znB5wKln4AgExsGDhEGL2p8dCs-hWEiH_M4qInA5vKr9P--corx0K0RbrFZ9PLFPmIKLp3sqGXIOxlwn5CnEi41rHFqgyh2vI5x8WjWxyeoaxsz78jKZHrBKSPMteWVHmI-1UOcuyFPsjbkMQRB9Ak7HQ4cS0OE7XyxmWj4Co1OCkFwNqKTadnIPCb5vT5HjD5lEGBxBNZ22rul0PHlh4bTPCL4Bbhr_VF9n3zuIhekMs7tPdumks4UugRgOSL0mHRDc8D5ouQ" \ -H "User-Region: US" \ -H "User-Language: en" \ -H "Kai-Voice: English" \ -H "User-Location: 33.987776,-118.441071" \ -H "User-Time: 2021-07-18T16:14:16+07:00" \ -H "X-API-KEY: $API_KEY" \ -H "Content-Type: application/json" \ --data-raw "{ \"transcripts\": [ { \"transcript\": \"tell me the cast\" } ], \"source\": \"text\" }"
Bash
Example Response
{"msg_type": "text_msg", "tts_text": "Abbi Jacobson, Danny McBride, Maya Rudolph and Olivia Colman star in The Mitchells vs. the Machines.", "should_speak": true, "language": null, "region": null, "locale": null}
JSON
Step 4: Bulk API
Thomas Burgess
Jul 18
how long does this token last?