POST
/
v4
/
models
/
{model_deployment_id}
/
embeddings
import SGPClient from 'sgp';

const client = new SGPClient({
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const embeddingResponse = await client.models.embeddings.create('model_deployment_id', {
    texts: ['string'],
  });

  console.log(embeddingResponse.embeddings);
}

main();
{
  "embeddings": [
    [
      "<any>"
    ]
  ],
  "tokens_used": 0
}

Path Parameters

model_deployment_id
string
required

Body

application/json
texts
string[]
required
model_request_parameters
object

Response

200
application/json
Successful Response
embeddings
array
required
tokens_used
integer
default:
0