For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DocsAPI ReferenceSDKs
DocsAPI ReferenceSDKs
  • Introduction
    • Product Overview
    • Pricing
    • Model Explanation
    • Available Models
  • Guides
    • Quickstart
    • Authentication
    • BYOK
    • Dashboard Guide
    • Prompt Templates
    • Embeddings
    • RAG (Files & Search)
    • Audio
    • Images & Vision
    • Image Generation
    • Compare
    • Batch API
    • Auto Routing
    • Realtime Audio
  • SDKs
    • Node.js (TypeScript)
    • Python
    • Go
  • Infrastructure
    • Architecture
LogoLogo
On this page
  • Quick start
  • Request fields
  • Batch input in a single request
  • Response shape
  • Choosing a model
  • SDK coverage
  • Common errors
Guides

Embeddings

||View as Markdown|
Was this page helpful?
Edit this page
Previous

Prompt Templates

Next

RAG (Retrieval-Augmented Generation)

Built with

The Embeddings API turns text into vectors you can use for semantic search, retrieval, clustering, and ranking.

1POST https://api.meshapi.ai/v1/embeddings
2Authorization: Bearer rsk_<your_key>

Quick start

curl
Node.js SDK
Python SDK
$curl https://api.meshapi.ai/v1/embeddings \
> -H "Authorization: Bearer <YOUR_RSK_KEY>" \
> -H "Content-Type: application/json" \
> -d '{
> "model": "openai/text-embedding-3-small",
> "input": "The quick brown fox jumps over the lazy dog."
> }'

Request fields

FieldTypeNotes
modelstringEmbedding model ID. Required unless your key has a default model.
inputstring | string[] | int[] | int[][]Text or tokenized input.
dimensionsintegerOptional output size for models that support truncation.
encoding_format"float" | "base64"Output format.
input_typestringOptional hint for asymmetric embedding models.
providerstring | objectOptional provider routing preferences.
userstringOptional end-user identifier for abuse monitoring.

Batch input in a single request

You can embed multiple strings in one API call:

$curl https://api.meshapi.ai/v1/embeddings \
> -H "Authorization: Bearer <YOUR_RSK_KEY>" \
> -H "Content-Type: application/json" \
> -d '{
> "model": "openai/text-embedding-3-small",
> "input": [
> "first sentence",
> "second sentence",
> "third sentence"
> ]
> }'

The returned data array matches the order of your input array.

Response shape

1{
2 "object": "list",
3 "data": [
4 {
5 "object": "embedding",
6 "index": 0,
7 "embedding": [-0.0123, 0.0456]
8 }
9 ],
10 "model": "openai/text-embedding-3-small",
11 "usage": {
12 "prompt_tokens": 12,
13 "total_tokens": 12
14 }
15}

Choosing a model

Use GET /v1/models to inspect available embedding models and their pricing. For embeddings, the most useful fields are:

  • model_type
  • context_length
  • pricing
  • is_free

SDK coverage

The official SDKs all expose first-class embeddings resources:

  • Node: client.embeddings.create(...)
  • Python: client.embeddings.create(...)
  • Go: client.Embeddings.Create(...)
  • Java: client.embeddings().create(...)

Common errors

HTTPMeaning
401Missing or invalid API key
402Balance or spend limit issue
422Invalid request body
429Rate limit exceeded