Skip to main content
POST
/
embedding
curl --request POST \
  --url https://api.octen.ai/embedding \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "input": [
    "What is vector search?"
  ],
  "model": "octen-embedding-8b",
  "dimension": 4096,
  "input_type": "query"
}
'
{
  "code": 0,
  "msg": "success",
  "data": {
    "results": [
      {
        "index": 0,
        "embedding": [
          0.0123,
          -0.0456,
          0.0789
        ]
      },
      {
        "index": 1,
        "embedding": [
          -0.0011,
          0.0234,
          0.0567
        ]
      }
    ],
    "model": "octen-embedding-4B"
  },
  "meta": {
    "usage": {
      "input_tokens": 128
    },
    "warning": "Input was truncated for one or more items."
  }
}

Authorizations

x-api-key
string
header
required

API key used for request authentication. Obtain an API key before using the API.

Body

application/json
input
string[]
required

The text to be converted into embeddings. Maximum tokens per element: 32768. Maximum request body size: 2MB

Maximum array length: 1000
model
enum<string>
default:octen-embedding-4b

The embedding model used for this request. octen-embedding-0.6b (max dim: 1024) for cost/throughput priority; octen-embedding-4b (max dim: 2560) for most applications; octen-embedding-8b (max dim: 4096) for accuracy-critical tasks.

Available options:
octen-embedding-0.6b,
octen-embedding-4b,
octen-embedding-8b
dimension
integer

The dimensionality of the output embedding vectors. Defaults to the model's max dimension (0.6b: 1024, 4b: 2560, 8b: 4096). If set to a value smaller than the model default, the embedding will be truncated to the first N values. Any positive integer ≤ model default dimension is allowed.

input_type
enum<string> | null

Specifies whether the input is a query or a document for retrieval. Different values apply different internal prompts: query → "Represent the query for retrieving supporting"; document → "Represent the document for retrieval". Null means no special prompt is applied.

Available options:
query,
document
truncation
boolean
default:true

Controls how over-length inputs are handled. true: input is automatically truncated; false: request fails if input exceeds limits.

Response

Successful embedding response

code
integer

Business status code. 0 indicates success.

msg
string

A human-readable message describing the result.

data
object

The main embedding response payload.

meta
object

Additional metadata for the embedding request.