POST
/
v1
/
code
/
embed
curl --request POST \
  --url https://embeddings.endpoint.relace.run/v1/code/embed \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "relace-embed-v1",
  "input": [
    "input 1",
    "input 2"
  ]
}'
{
  "results": [
    [
      {
        "index": 0,
        "embedding": [
          0.123,
          0.456,
          0.789
        ]
      },
      {
        "index": 1,
        "embedding": [
          0.234,
          0.567,
          0.89
        ]
      }
    ]
  ],
  "usage": {
    "total_tokens": 8
  }
}

Authorizations

Authorization
string
header
required

API key Authorization header using the Bearer scheme. Rate limiting applies for certain API keys.

Body

application/json

Codebase context for embedding

The body is of type object.

Response

200
application/json

Codebase embedded successfully

The response is of type object.