Opensolr API Endpoint: embed
Overview
The embed endpoint allows you to generate vector embeddings for any arbitrary text payload (up to 50,000 characters) and store those embeddings in any Solr index, or use 'em wherever you need 'em. This is ideal for embedding dynamic or ad-hoc content, without having to pre-index data in Solr first.
Endpoint URL
https://api.opensolr.com/solr_manager/api/embed
Supports only POST requests.
Authentication & Core Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | Your Opensolr registration email address. | |
| api_key | string | Yes | Your API key from the Opensolr dashboard. |
| index_name | string | Yes | Name of your Opensolr index/core to use. |
Embedding Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| payload | string | Yes | β | The raw text string to embed. Maximum: 50,000 characters. |
Special Notes
payloadcan be any UTF-8 text (e.g., a document, user input, generated content, etc).- If
payloadis missing or less than 2 characters, the API returns a 404 error with a JSON error response. - You must specify a valid
index_nameto indicate you are an Opensolr Member (only used for authentication purposes). - The response is returned as JSON.
Example Solr Schema Requirement
To store embeddings, your Solr schema must define an appropriate vector field, for example:
<field name="embeddings" type="vector" indexed="true" stored="false" multiValued="false"/> <fieldType name="vector" class="solr.DenseVectorField" vectorDimension="1024" required="false" similarityFunction="cosine"/>
Adjust the name, type, and vectorDimension as needed to fit your use-case and model.
β οΈ IMPORTANT: This API uses the embedding model: BAAI/bge-m3 which produces a 1024D vector representation of your text.
Example Usage
Example: POST Request
POST https://api.opensolr.com/solr_manager/api/embed Content-Type: application/x-www-form-urlencoded email=your@email.com&api_key=YOUR_API_KEY&index_name=your_index&payload=Your text to embed here.
Endpoint Behavior
- Authenticates the user using
emailandapi_key. - Checks for a valid
payloadparameter (must be 2-50,000 characters). - Generates vector embeddings for the provided payload.
- Stores the generated embedding in the specified Solr index.
- Responds with a JSON object containing the result.
Example Response
{ "status": "success", "embedding": [/* vector values */], "length": 4381 }
Or, for invalid input:
{ "ERROR": "Invalid payload" }
Use Cases
- Embed dynamic or user-generated text into your Solr index.
- Integrate with chatbots, summarization tools, or any app needing AI-powered semantic representations on the fly.
- Test or debug embedding functionality before bulk-embedding large datasets.
Support
For more information or help, visit Opensolr Support or use your Opensolr dashboard.

