OpenAI Embeddings
Text embeddings API converts text into high-dimensional vector representations for semantic search, text classification, and clustering.
Endpoint
| Method | Endpoint |
|---|---|
| POST | https://neolink.com/api/v1/embeddings |
Authentication
| Method | Description |
|---|---|
| Bearer Token | Include Authorization: Bearer <API_key> in the request header for account verification. |
Request Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
Content-Type | string | Yes | Media type of the request body, set to application/json |
Authorization | string | Yes | Bearer API_key for account verification |
Request Body
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | - | Model ID to use |
input | string or array | Yes | - | Input text to convert to vectors. Can be a single string or an array of strings (batch processing) |
encoding_format | string | No | float | Encoding format for returned vectors. Options: float or base64 |
dimensions | int | No | - | Number of dimensions for returned vectors. Only supported by some models |
user | string | No | - | Unique identifier for the end-user, used for monitoring and abuse detection |
Request Example
bash
curl --location --request POST 'https://neolink.com/api/v1/embeddings' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API Key>' \
--data-raw '{
"model": "<Model ID>",
"input": "What is artificial intelligence"
}'python
import requests
url = "https://neolink.com/api/v1/embeddings"
headers = {
"Authorization": "Bearer <API Key>"
}
files = {
"model": (None, "<Model ID>"),
"input": (None, "What is artificial intelligence"),
}
response = requests.post(url, headers=headers, files=files)
print(response.status_code)
print(response.text)Supported Models:
- text-embedding-3-large
- text-embedding-3-small
- text-embedding-ada-002
- text-embedding-v4
