← Back to API Ninjas
POST/v1/embeddings

Encode text to vector

Encodes any given text into a 768-dimensional vector using state-of-the-art NLP machine learning models.

API Ninjas·$0.001 per call

Example code

// Using @orth/sdk - The simplest way to call APIs // Install: npm install @orth/sdk import Orthogonal from "@orth/sdk"; const orthogonal = new Orthogonal({ apiKey: process.env.ORTHOGONAL_API_KEY, }); const output = await orthogonal.run({ api: "api-ninjas", path: "/v1/embeddings", body: { "text": "example" } }); console.log(output);

Body parameters

textrequired
string

Query text to embed. Maximum 5000 characters.

    Orthogonal - Giving AI agents the tools they need.