Create embeddings
Generate vector embeddings from input text.
POST
/
embeddings
curl --request POST \
--url https://api.neosantara.xyz/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "nusa-embeddings-0001",
"input": "example sentence"
}
'{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [
0.123,
0.456,
0.789
],
"index": 0
}
],
"model": "nusa-embeddings-0001",
"usage": {
"prompt_tokens": 3,
"total_tokens": 3
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "invalid_parameter",
"param": "<string>",
"details": {}
},
"info_metadata": {
"creator": "noesantara.xyz",
"status": true,
"timestamp": "2023-11-07T05:31:56Z",
"request_id": "<string>",
"processing_time": 123,
"tier": "<string>",
"user_total_usage": {
"used": 123,
"limit": 123,
"remaining": 123,
"reset_at": "2023-11-07T05:31:56Z"
}
}
}{
"error": {
"message": "<string>",
"type": "auth_error",
"code": "invalid_api_key",
"details": {}
},
"info_metadata": {
"creator": "noesantara.xyz",
"status": true,
"timestamp": "2023-11-07T05:31:56Z",
"request_id": "<string>",
"processing_time": 123,
"tier": "<string>",
"user_total_usage": {
"used": 123,
"limit": 123,
"remaining": 123,
"reset_at": "2023-11-07T05:31:56Z"
}
}
}{
"error": {
"message": "<string>",
"type": "rate_limit_exceeded",
"code": "rpm_exceeded",
"details": {
"limit": 123,
"remaining": 123,
"reset": "2023-11-07T05:31:56Z",
"retry_after": 123
}
},
"info_metadata": {
"creator": "noesantara.xyz",
"status": true,
"timestamp": "2023-11-07T05:31:56Z",
"request_id": "<string>",
"processing_time": 123,
"tier": "<string>",
"user_total_usage": {
"used": 123,
"limit": 123,
"remaining": 123,
"reset_at": "2023-11-07T05:31:56Z"
}
}
}{
"error": {
"message": "<string>",
"type": "server_error",
"code": "internal_error",
"details": {}
},
"info_metadata": {
"creator": "noesantara.xyz",
"status": true,
"timestamp": "2023-11-07T05:31:56Z",
"request_id": "<string>",
"processing_time": 123,
"tier": "<string>",
"user_total_usage": {
"used": 123,
"limit": 123,
"remaining": 123,
"reset_at": "2023-11-07T05:31:56Z"
}
}
}Authorizations
Your NeosantaraAI API Key.
Body
application/json
⌘I
curl --request POST \
--url https://api.neosantara.xyz/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "nusa-embeddings-0001",
"input": "example sentence"
}
'{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [
0.123,
0.456,
0.789
],
"index": 0
}
],
"model": "nusa-embeddings-0001",
"usage": {
"prompt_tokens": 3,
"total_tokens": 3
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "invalid_parameter",
"param": "<string>",
"details": {}
},
"info_metadata": {
"creator": "noesantara.xyz",
"status": true,
"timestamp": "2023-11-07T05:31:56Z",
"request_id": "<string>",
"processing_time": 123,
"tier": "<string>",
"user_total_usage": {
"used": 123,
"limit": 123,
"remaining": 123,
"reset_at": "2023-11-07T05:31:56Z"
}
}
}{
"error": {
"message": "<string>",
"type": "auth_error",
"code": "invalid_api_key",
"details": {}
},
"info_metadata": {
"creator": "noesantara.xyz",
"status": true,
"timestamp": "2023-11-07T05:31:56Z",
"request_id": "<string>",
"processing_time": 123,
"tier": "<string>",
"user_total_usage": {
"used": 123,
"limit": 123,
"remaining": 123,
"reset_at": "2023-11-07T05:31:56Z"
}
}
}{
"error": {
"message": "<string>",
"type": "rate_limit_exceeded",
"code": "rpm_exceeded",
"details": {
"limit": 123,
"remaining": 123,
"reset": "2023-11-07T05:31:56Z",
"retry_after": 123
}
},
"info_metadata": {
"creator": "noesantara.xyz",
"status": true,
"timestamp": "2023-11-07T05:31:56Z",
"request_id": "<string>",
"processing_time": 123,
"tier": "<string>",
"user_total_usage": {
"used": 123,
"limit": 123,
"remaining": 123,
"reset_at": "2023-11-07T05:31:56Z"
}
}
}{
"error": {
"message": "<string>",
"type": "server_error",
"code": "internal_error",
"details": {}
},
"info_metadata": {
"creator": "noesantara.xyz",
"status": true,
"timestamp": "2023-11-07T05:31:56Z",
"request_id": "<string>",
"processing_time": 123,
"tier": "<string>",
"user_total_usage": {
"used": 123,
"limit": 123,
"remaining": 123,
"reset_at": "2023-11-07T05:31:56Z"
}
}
}