Supported SDKs
Vercel AI SDK
Use Vercel AI SDK with Keywords AI
You can use the chat completion endpoint with Vercel AI SDK under two lines of code change.
Example
Add Keywords AI parameters
Adding Keywords AI parameters to the Vercel AI SDK is different than other frameworks. Here is an example of how to do it:
1
Specify Keywords AI params in an object
You should create an object with the Keywords AI parameters you want to use. Add parameters you want to use as keys in the object.
2
Encode the object as a string
You should encode the object as a string and then you can send it as a header in your request.
3
Add the header to your request
You should send it in the X-Data-Keywordsai-Params
header.
4
Full example