Skip to main content

Embeddings

POST /v1/embeddings turns text into vectors using the OpenAI Embeddings format. Use the openai SDK with the same base URL as Chat Completions.

Example request

curl https://octalabs.id/v1/embeddings \  -H "Authorization: Bearer $API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "EMBEDDING_MODEL_ID",    "input": ["Jakarta is the capital of Indonesia.", "Bandung is known as the City of Flowers."]  }'

Fields

Field Notes
modelRequired. An embedding model ID from the Models & Pricing page (Embedding tab).
inputRequired. A string, an array of strings, or an array of token IDs. Empty input is rejected.
dimensionsOptional, if the model supports it.
encoding_formatOptional: float or base64.
userOptional.

Cost

Embeddings are billed per 1 million input tokens, using the token count the provider reports in usage. Before the request runs, a safe upper bound is held (the byte length of the input text, or the number of elements for an array of token IDs); afterwards only actual usage is charged and the rest returns to your available balance.

Start with any balance,
however small.

Create a free accountSign in AI API · pay as you go