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 |
|---|---|
model | Required. An embedding model ID from the Models & Pricing page (Embedding tab). |
input | Required. A string, an array of strings, or an array of token IDs. Empty input is rejected. |
dimensions | Optional, if the model supports it. |
encoding_format | Optional: float or base64. |
user | Optional. |
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.