Submit an embedding request
POST
https://novapai.ai/api/v1/embeddings
POST
/api/v1/embeddings
cURL
$curl -X POST https://novapai.ai/api/v1/embeddings \
>-H "Authorization: Bearer <token>" \
>-H "Content-Type: application/json" \
>-d '\{
>"input": "The quick brown fox jumps over the lazy dog",
>"model": "text-embedding-ada-002"
>\}'200 Successful
reference-embeddings-create-embeddings-01.json
{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [
0.0123, -0.0456, 0.0789, -0.0345, 0.0678, -0.0234, 0.0567, -0.089,
0.0345, -0.0123
],
"index": 0
}
],
"model": "text-embedding-ada-002",
"id": "embeddings-1234567890abcdef",
"usage": {
"prompt_tokens": 9,
"total_tokens": 9,
"cost": 0.00015
}
}Submits an embedding request to the embeddings router
Authentication
Authorization Bearer
API key as bearer token in Authorization header
Request
This endpoint expects an object.
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| input | string or list of strings or list of doubles or list of lists of doubles or list of objects | 是 | - |
| model | string | 是 | - |
| encoding_format | enum | 否 | Allowed values:float base64 |
| dimensions | integer | 否 | >=0 |
| user | string | 否 | - |
| provider | object | 否 | Provider routing preferences for the request. |
| input_type | string | 否 | - |
Response
Embedding response
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| object | enum | - | Allowed values:list |
| data | list of objects | - | - |
| model | string | - | - |
| id | string | - | - |
| usage | object | - | - |
Errors
| 状态码 | 说明 |
|---|---|
| 400 | Bad Request Error |
| 401 | Unauthorized Error |
| 402 | Payment Required Error |
| 404 | Not Found Error |
| 429 | Too Many Requests Error |
| 500 | Internal Server Error |
| 502 | Bad Gateway Error |
| 503 | Service Unavailable Error |