Skip to main content

OpenAI Format

Convert text to vector embeddings.

Try It

POST/v1/embeddingshttps://api-platform.ope.ai

Authentication

Uses Bearer Token authentication.

  • Header: Authorization: Bearer <token>
  • Example: Authorization: Bearer sk-xxxxxx

Request body (application/json)

FieldTypeRequiredDescriptionDefault / Range
modelstringYesModel ID-
inputstring | array<string>YesText to embed-
encoding_formatstringNoOutput encodingDefault "float"; "float" | "base64"

Request examples

The domain below is an example: https://api-platform.ope.ai.

curl -X POST "https://api-platform.ope.ai/v1/embeddings" \
-H "Authorization: Bearer $OPEAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "bge-m3",
"input": "hello"
}'

Response example (200)

{
"object": "list",
"model": "bge-m3",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
-0.032024823129177094,
0.05963248014450073,
...
]
}
],
"usage": {
"prompt_tokens": 4,
"completion_tokens": 1024,
"total_tokens": 1028,
"prompt_tokens_details": {
"cached_tokens": 0,
"text_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0
}
}
}