ShareAI Platform Docs

Create text embeddings

Generate text embeddings with ShareAI for semantic search, retrieval and similarity, with supported input formats and model requirements.

View as Markdown
On this page
POST https://api.shareai.now/api/v1/embeddings

Convert one or more texts into embedding vectors.

Base URL
https://api.shareai.now
Authentication
Bearer API key or approved OAuth access token

Choose an embedding model enabled on ShareAI and allowed by your credential. Chat models cannot be substituted for embedding models. Model availability and supported options depend on the configured provider.

Send a request#

cURL

curl --fail-with-body --request POST \
  "https://api.shareai.now/api/v1/embeddings" \
  -H "Authorization: Bearer $SHAREAI_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "YOUR_EMBEDDING_MODEL",
  "input": [
    "How do I connect a device?",
    "Where can I read my usage?"
  ],
  "encoding_format": "float"
}'

Request fields#

FieldValue
modelAn enabled embedding model ID.
inputA nonempty string or an array of up to 128 nonempty strings.
encoding_formatfloat or base64.
dimensionsOptional integer from 1 to 65536; the selected model must support it.

Read the vectors#

Read the data array and use each result’s index to match its embedding to the input. Keep the same model and dimensions when embedding your documents and search queries. The result also includes provider-reported usage.

Batch within limits#

Combined input text is limited to 256 KiB. Responses are synchronous and limited to 2 MiB, so large vectors or batches can exceed the response limit. Reduce the batch size or use supported smaller dimensions. Token-ID arrays are not accepted.

Authentication and availability#

An approved OAuth access token can replace the API key. Account-funded requests require surcharge and an accepted plan. Model and provider restrictions still apply. If the model is not enabled for embeddings, choose an available embedding model; changing the credential cannot enable a model.

Usage#

Embeddings consume input tokens. Check model pricing before running a large batch and use Console Usage to review activity. Handle validation, authorization and availability errors before retrying.

Last updated September 15, 2026

ShareAI Platform Docs
All documentation

Search by title or content.

Ask about this page

Choose an assistant to explore this page. You can also copy the page and paste it into your conversation.

Ask ChatGPTAsk ClaudeAsk GrokAsk ShareAI