POST
/
embeddings
curl --location --request POST 'https://api.commonbase.com/embeddings' \
--header 'Authorization: API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "projectId": "PROJECT_ID",
  "input": "During the business meeting today, we discussed...",
  "providerConfig": {
    "provider": "cb-openai-eu",
    "params": {
      "type": "embeddings",
      "model": "<model_name>"
    }
  }
}'
{
  "completed": true,
  "invocationId": "<invocation_id>",
  "projectId": "<project_id>",
  "type": "text",
  "model": "<model_name>",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        -0.00894375,
        -0.009087898,
        0.028069615,
        "... 1533 more items"
      ]
    }
  ]
}

Body

projectId
string
required

The Commonbase project ID.

input
string
required

The text used to generate an embedding.

userId
string

An optional custom string used to identify users in the invocation logs.

providerConfig
ProviderConfig

The embeddings provider configuration. Only OpenAI embeddings are supported.

Success Response

completed
boolean

Indicates whether the embedding is finished.

invocationId
string

The ID of the invocation.

projectId
string

The ID of the project.

type
'embeddings'

The type of the response. Always 'embeddings' for this endpoint.

model
string

The name of the model used for the embedding.

data
object[]

The result of the embedding request. See response.data in the OpenAI Docs

Error Response

error
string

An error message explaining why the response failed.

invocationId
string

The ID of the invocation.