Search
Try Notion
Headers
MKCLOUD Headers
The required headers passed in a request are the following:
{ "User-Language": "", "User-Region": "", "Authorization": "" "X-API-KEY": "" "Kai-Voice": "" }
Python
User-Language:
Format: ISO 639-1 language code
Example: en
Explanation: This is the language the user is speaking and typing
User-Region:
Format:ISO 3166-1 alpha-2 region code
Example: US
Explanation: This is the region from which a user’s content is locked to. This is used for example for streaming service selection and restriction, as well as news sources and many other domains
Authorization:
Format: Bearer Token Bearer ${idToken}
Example: Bearer ….
Explanation: This ties a request to our backend on behalf of that user. It is required that this be a JWT for the same UUID if you want to enable personalization or multi-turn support.
X-API-KEY
Format: String
Example: $SECRET-KEY
Explanation: API secret key that identifies the service sending these requests.
Kai-Voice
Format: String
Example: English
Explanation: This is the voice that is used for responses, i.e. the language a user wants to hear. If you are synthesizing voice on the frontend this represents the language to be used (sometimes called TTS field)
The optional headers passed in a request are the following:
{ "User-Location": "", "User-Time": "", "Kai-Spellcheck": "1" }
Python
User-Location:
Format: lat,lon
Example: 35.54,45.67
Explanation: This is required if you want to be able to perform restaurant searches. It does not need to be exact and can also come from a GeoIP. If you have an exact location we suggest rounding it. We do not store the User-Location outside of the request log.
User-Time:
Format: ISO-8601 with timezone offset
Example: 2021-07-18T16:14:16+07:00
Explanation: This is used to improve understanding, search, and personalization. It should match the device time used.
Kai-Spellcheck:
Format: int enum for spellcheck mode
Example:
0 = off
1 = on
Explanation: Defaults to on, set to 0 for a faster response if you have already done spelling correction and language modeling.