https://api.laozhang.ai/v1.
Models
These models list the Embeddings endpoint in the public pricing as of September 29, 2026. Prices are per 1M tokens; see the model catalog for current prices and token groups.
Of the OpenAI models, only
text-embedding-3-small and text-embedding-3-large accept the dimensions parameter for shorter vectors; text-embedding-ada-002 always returns 1536 values.
For the vector sizes and options of the Alibaba models, see Alibaba Cloud Model Studio: Embedding.
These models accept text only; they do not embed images directly:
- To search images by content, describe each image with a vision model first, then embed the description.
- Don’t pass a Base64 image as the
inputstring. The request still returns a vector, but it represents the characters, not the picture.
Create embeddings
Create an API key in Token management and export it in your terminal:- cURL
- Python
Read the response
The response holds one entry per input. In this shortened example, each vector is cut to three values;text-embedding-3-small returns 1536:
data[i].index is the position of the input text in your request. Sort by index, or look entries up by it, before you store vectors next to their texts. usage shows the tokens counted for the request; the charge appears in call logs.
Request shorter vectors
With the client from the Python example, adddimensions when you call a text-embedding-3 model:
Use the vectors
- Embed stored documents and search queries with the same model and the same
dimensions. Vectors from different models or sizes cannot be compared, so re-embed stored documents when you change either. - Each model limits how long one input can be and how many inputs one request can hold. Split long documents into chunks and send large collections in batches.
- Cosine similarity is a common way to compare vectors. Configure your vector database with the same distance metric.
Handle errors
- 400: check
model, remove empty strings frominput, shorten over-long texts, and senddimensionsonly to atext-embedding-3model. - 401: check the
Authorization: Bearerheader and the API key. - 404 or model not available: check the exact model ID and your token group in the model catalog.
- 429 or 5xx: check call logs before retrying, and retry with backoff.