Check out our upcoming events and meetups! View events →
Creates an embedding vector representing the input text. This endpoint is compatible with the OpenAI Embeddings API and may be used with the OpenAI JS or Python SDK by setting the base URL to https://api.telnyx.com/v2/ai/openai.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.ai.openai.embeddings.createEmbeddings({
input: 'The quick brown fox jumps over the lazy dog',
model: 'thenlper/gte-large',
});
console.log(response.data);{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [
123
],
"index": 123
}
],
"model": "<string>",
"usage": {
"prompt_tokens": 123,
"total_tokens": 123
}
}Documentation Index
Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Input text to embed. Can be a string or array of strings.
ID of the model to use. Use the List embedding models endpoint to see available models.
"thenlper/gte-large"
The format to return the embeddings in.
float, base64 The number of dimensions the resulting output embeddings should have. Only supported in some models.
A unique identifier representing your end-user for monitoring and abuse detection.
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.ai.openai.embeddings.createEmbeddings({
input: 'The quick brown fox jumps over the lazy dog',
model: 'thenlper/gte-large',
});
console.log(response.data);{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [
123
],
"index": 123
}
],
"model": "<string>",
"usage": {
"prompt_tokens": 123,
"total_tokens": 123
}
}