Skip to main content
POST
/
openai
/
v1
/
embeddings
Create Embeddings
curl --request POST \
  --url https://api.highwayapi.ai/openai/v1/embeddings \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "input": [
    "<string>"
  ],
  "model": "<string>",
  "encoding_format": "<string>"
}
'
{
  "object": "<string>",
  "data": [
    {
      "index": 123,
      "embedding": [
        {}
      ],
      "object": "<string>"
    }
  ],
  "model": "<string>",
  "usage": {
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}
Creates an embedding vector representing the input text.

Request Headers

Content-Type
string
required
Enum value: application/json
Authorization
string
required
Bearer authentication format: Bearer {{API Key}}.

Request Body

input
string[]
required
The input text to embed, encoded as a string or an array of tokens. To embed multiple inputs in a single request, pass an array of strings or an array of token arrays. The input must not exceed the model’s maximum input tokens (text-embedding-ada-002 has 8192 tokens), must not be an empty string, and the dimensions of any array must be less than or equal to 2048.
model
string
required
The model ID to use. Enum value:
  • baai/bge-m3
encoding_format
string
The format for returning the embedding vector. Can be float or base64.

Response Information

object
string
required
Always list
data
array
required
A list of embedding vectors generated by the model.
model
string
required
The model ID used.
usage
object
required
Usage information.