POST
/
api
/
embeddings

You could use Keywords AI’s unified LLM API to call Embeddings model to turn text into numbers, unlocking use cases like search.

Keywords AI now supports text-embedding-3-large, text-embedding-3-small, and text-embedding-ada-002 models from OpenAI.

ModelDescriptionOutput Dimension
text-embedding-3-largeMost capable embedding model for both english and non-english tasks3,072
text-embedding-3-smallIncreased performance over 2nd generation ada embedding model1,536
text-embedding-ada-002Most capable 2nd generation embedding model, replacing 16 first generation models1,536

Integration steps:

1

Get your OpenAI API key

Go to OpenAI API plaform to get your OpenAI API key.

2

Add your credentials on Keywords AI credentials page

You should add your OpenAI’s API key on Keywords AI credentials page.

3

Call your Embeddings model

OpenAI parameters

model
string
required

ID of the model to use. Supported models are text-embedding-3-large, text-embedding-3-small, and text-embedding-ada-002.

input
string or array
required

nput text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for text-embedding-ada-002), cannot be an empty string, and any array must be 2048 dimensions or less.

encoding_format
string

The format to return the embeddings in. Can be either float or base64.

dimensions
integer

The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.

Keywords AI parameters

See how to make a standard Keywords AI API call in the Quick Start guide.

Generation parameters

customer_credentials
object

You can pass in your customer’s credentials for supported providers and use their credits when our proxy is calling models from those providers.
See details here

disable_log
boolean

When set to true, only the request and performance metrics will be recorded, input and output messages will be omitted from the log.

Observability parameters

metadata
dict

You can add any key-value pair to this metadata field for your reference. Check the details of metadata here.

Contact team@keywordsai.co if you need extra parameter support for your use case.

customer_identifier
string

Use this as a tag to identify the user associated with the API call. See the details of customer identifier here.

customer_email
string

This is the email address of the user associated with the API call. You can add your corresponding user’s email address to the request.

You could also edit customer’s emails on the platform. Check the details of user editing here.

thread_identifier
string

See logs as a conversation log thread. Pass all logs with the same thread_identifier to see them in the same thread.

request_breakdown
boolean
default: false

Adding this returns the summarization of the response in the response body. If streaming is on, the metrics will be streamed as the last chunk.