# Embeddings

**Embeddings** are numerical vectors that represent text’s meaning, enabling machines to compare and analyze language. They power tasks like **search**, **classification**, and **recommendations** by capturing semantic relationships in a compact form.

To get a full list of embedding models visit [cortecs.ai](https://cortecs.ai/serverlessModels) and filter by the **Embedding** tag.

{% tabs %}
{% tab title="Python" %}

```python
from openai import OpenAI

client = OpenAI(
  base_url="https://api.cortecs.ai/v1/embeddings",
  api_key="<API_KEY>",
)

response = client.embeddings.create(
    input="Your text string goes here",
    model="<MODEL_NAME>"
)

print(response.data[0].embedding)
```

{% endtab %}

{% tab title="Node.js" %}

<pre class="language-javascript"><code class="lang-javascript"><strong>import OpenAI from "openai";
</strong>
const openai = new OpenAI({
    baseURL: 'https://api.cortecs.ai/v1/embeddings',
    apiKey: '&#x3C;API_KEY>'
});

const embedding = await openai.embeddings.create({
  model: "&#x3C;MODEL_NAME>",
  input: "Your text string goes here"
});

console.log(embedding);
</code></pre>

{% endtab %}

{% tab title="Curl" %}

```bash
curl https://api.cortecs.ai/v1/embeddings \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <API_KEY>" \
  -d '{
    "input": "Your text string goes here",
    "model": "<MODEL_NAME>"
  }'
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cortecs.ai/usage/embeddings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
