Embeddings
POST
/v1/embeddingsConvert text or an array of texts into vector representations.
Vector dimensions, batch limits, and optional fields depend on the selected model and Provider. Choose a model with embedding capability from the model catalog.
Core request fields
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | An embedding model ID. |
input | string | array | Yes | Text or an array of texts to embed. |
encoding_format | string | No | Output encoding when supported by the model route. |
dimensions | integer | No | Requested dimensions when supported by the model route. |
Request examples
curl
curl https://api.noxgate.net/v1/embeddings \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_MODEL_ID","input":["First document","Second document"]}'Python · OpenAI SDK
from openai import OpenAI
client = OpenAI(api_key="sk-your-api-key", base_url="https://api.noxgate.net/v1")
response = client.embeddings.create(model="YOUR_MODEL_ID", input=["First document", "Second document"])
print(response.data[0].embedding)Node.js · OpenAI SDK
import OpenAI from "openai";
const client = new OpenAI({ apiKey: "sk-your-api-key", baseURL: "https://api.noxgate.net/v1" });
const response = await client.embeddings.create({ model: "YOUR_MODEL_ID", input: ["First document", "Second document"] });
console.log(response.data[0].embedding);Successful response
JSON
{"object":"list","data":[{"object":"embedding","index":0,"embedding":[0.012,-0.031,0.008]}],"model":"YOUR_MODEL_ID","usage":{"prompt_tokens":4,"total_tokens":4}}