Embeddings & Reranking
Embeddings turn supported input into vectors for search, clustering, or retrieval. Rerankers score a set of candidate documents against a query so your application can reorder an existing search result set. Neither endpoint generates an answer.
Use an active model ID from the Model Hub or authenticated model catalog. Provider models differ in accepted input, dimensions, truncation, and task hints; Accly routes the supported protocol but does not make these model behaviors identical.
Active retrieval model IDs
Use the exact model ID returned for your account. These are the active configured families for this documentation revision:
| Capability | Active model IDs | Supported Accly shape |
|---|---|---|
| OpenAI-compatible embeddings | text-embedding-ada-002, text-embedding-3-small, text-embedding-3-large | POST /v1/embeddings |
| Google embeddings | gemini-embedding-001, gemini-embedding-2-preview | Native embedContent and OpenAI-compatible embeddings |
| Reranking | BAAI/bge-reranker-v2-m3, Qwen/Qwen3-Reranker-0.6B | POST /v1/rerank |
gemini-embedding-2-preview supports text, image, video, audio, and PDF inputs in the configured catalog. The example below uses text; check the provider guide and your account metadata before sending other modalities. A provider-prefixed BGE alias may also appear in the authenticated catalog, so copy the exact ID your account exposes.
Embeddings
Accly exposes two request formats. A model must explicitly support the selected format; a model being an embedding model does not mean every protocol works with it.
OpenAI-compatible embeddings
POST /v1/embeddings accepts the OpenAI embeddings shape. For example, text-embedding-3-small is configured for this route.
curl https://api.accly.net/v1/embeddings \
-H "Authorization: Bearer $ACCLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "text-embedding-3-small",
"input": "A searchable note about API authentication."
}'The response is the provider’s OpenAI-compatible embedding envelope. Each item in data contains an embedding vector and its input index; usage may include token counts. Use these vectors with your own vector database or similarity search implementation.
Native Google embeddings
Google embedding models can also use the native Gemini embedContent route. gemini-embedding-001 is configured for both native Google and OpenAI-compatible embeddings.
curl https://api.accly.net/v1beta/models/gemini-embedding-001:embedContent \
-H "x-goog-api-key: $ACCLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": {"parts": [{"text": "A searchable note about API authentication."}]},
"taskType": "RETRIEVAL_DOCUMENT"
}'Google returns its native embedding.values response. For a search query, use the task type and query/document pairing recommended by Google’s embeddings guide . The active catalog also includes gemini-embedding-2-preview; its tier, multimodal input, dimensions, and availability are model-specific.
Reranking
POST /v1/rerank accepts a query and non-empty list of text documents. The selected model must be a rerank model with OpenAI-compatible rerank support. Accly currently configures models such as BAAI/bge-reranker-v2-m3 and Qwen/Qwen3-Reranker-0.6B.
curl https://api.accly.net/v1/rerank \
-H "Authorization: Bearer $ACCLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "BAAI/bge-reranker-v2-m3",
"query": "How do Accly API keys authenticate requests?",
"documents": [
"Send an Accly API key in an Authorization bearer header.",
"Request units reset daily at midnight UTC.",
"The gateway accepts x-api-key and x-goog-api-key headers too."
],
"top_n": 2,
"return_documents": true
}'model, query, and at least one document are required. A request may contain up to 1,000 documents; each must be non-empty. If set, top_n must be between 1 and the number of documents. The upstream response is passed through: ranked results include the input index and relevance_score, with token usage when the provider returns it. Use the index to recover your original document and let the returned rank refine, not replace, retrieval.
Choosing the integration
- Use embeddings to index content and retrieve candidates by vector similarity.
- Use reranking after keyword or vector retrieval when relative relevance needs a second scoring pass.
- Send the reranked text to a generation endpoint only if your application needs a generated answer.
For model-specific input limits, dimensionality, task labels, languages, and score interpretation, use the provider links in the Model Hub and provider’s official docs. The gateway guarantees only the endpoint and validation contract documented here. Official references: OpenAI embeddings , Google embeddings , and SiliconFlow rerank .