AGTCloud API Docs
GuidesAPI ReferenceIntegrations and resourcesUpdate and help

Embeddings

Convert text into vectors for semantic search, RAG, and content recommendations.

Overview

Embeddings convert text into vectors so applications can retrieve content by semantic similarity. Common uses include semantic search, retrieval-augmented generation (RAG), and related-content recommendations.

Embeddings retrieve candidates from a large collection. Rerank receives a query and candidate documents and refines their order. You can use either capability independently or combine them into a two-stage retrieval pipeline.

API access

Base URL

https://api.agtcloud.cn/v1

Create embeddings

curl 'https://api.agtcloud.cn/v1/embeddings' \
  -H 'Authorization: Bearer your-api-key' \
  -H 'Content-Type: application/json' \
  --data '{
    "model": "MODEL_ID",
    "input": [
      "AGTCloud provides a unified model API.",
      "Embeddings can power semantic retrieval."
    ]
  }'
ParameterRequiredDescription
modelYesEmbedding model ID
inputYesA text value, text array, or token array
encoding_formatNoEncoding format for returned vectors
dimensionsNoRequested output dimensions; supported by selected models only

Read the result

  • data[].embedding: generated vector.
  • data[].index: input index associated with the vector.
  • usage: token usage for the request.

Keep indexing and queries consistent

SettingPossible result when inconsistent
Model and versionOld and new vectors use different spaces and cannot be compared reliably
Vector dimensionsVector-store writes or similarity calculations fail
Text preprocessingQuery and document representations drift apart
Distance metricScore meaning and ranking change

Learn more

On this page