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
  • Overview
    • API reference
  • Mesh API
      • POSTCreate Embeddings
LogoLogo
Mesh APIEmbeddings

Create Embeddings

||View as Markdown|
POST
https://api.meshapi.ai/v1/embeddings
POST
/v1/embeddings
$curl -X POST https://api.meshapi.ai/v1/embeddings \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "input": "The quick brown fox jumps over the lazy dog",
> "model": "openai/text-embedding-3-small",
> "dimensions": 1536,
> "encoding_format": "float",
> "input_type": "document",
> "provider": "openai",
> "user": "user_1234567890"
>}'
200Successful
1{
2 "embedding": [
3 0.0123,
4 -0.0456,
5 0.0789,
6 0.0345,
7 -0.0234,
8 0.0567,
9 -0.0678,
10 0.089,
11 0.0123,
12 -0.0456,
13 0.0789,
14 0.0345,
15 -0.0234,
16 0.0567,
17 -0.0678,
18 0.089,
19 0.0123,
20 -0.0456,
21 0.0789,
22 0.0345,
23 -0.0234,
24 0.0567,
25 -0.0678,
26 0.089,
27 0.0123,
28 -0.0456,
29 0.0789,
30 0.0345,
31 -0.0234,
32 0.0567,
33 -0.0678,
34 0.089
35 ],
36 "model": "openai/text-embedding-3-small",
37 "usage": {
38 "prompt_tokens": 9,
39 "total_tokens": 9
40 }
41}
Was this page helpful?
Previous

Create Response

Next

Init Upload

Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
inputstring or list of strings or list of integers or list of lists of integersRequired

Text(s) to embed. Accepts a string, list of strings, list of token IDs, or a list of token ID lists.

modelstring or nullOptional

Model ID to use for embedding, e.g. perplexity/pplx-embed-v1-4b.

dimensionsinteger or nullOptional>=1

Number of dimensions for the output embedding vector (model-dependent).

encoding_formatenum or nullOptional

Format of the returned embedding. Defaults to float.

Allowed values:
input_typestring or nullOptional

Intended use of the embedding, e.g. query or document. Some models use this to apply asymmetric embedding.

providerstring or object or nullOptional

Provider routing preferences. Pass a provider slug string (e.g. 'perplexity') or a ProviderPreferences object to control fallback and ordering behaviour.

userstring or nullOptional<=256 characters

End-user identifier for abuse monitoring (forwarded to OpenRouter).

Response

Successful Response