/v1/embeddings, store the returned vector, and search it with your vector database.
Create an embedding
Use an embedding-capable model ID from the Models page or the model directory. The examples below call the OpenAI-compatible Embeddings API.These examples use the placeholder
your-embedding-model-id. Replace it with an available embedding model ID from the Models page or model directory before you run the request.Response example
A successful response can look like this. The response includes one vector for each input item; the vector below is shortened for readability:Batch input
Send an array of strings when you want several vectors from one request:cURL
Example model records
This example model catalog response shows the
/api/models envelope and one OpenAI-compatible embedding model record shape. Some embedding records use an empty model_type; choose an embedding model by ID and endpoint support instead of relying on that field alone.cURL
Common errors
Input too long
Input too long
Split long documents into chunks before embedding.
Wrong model type
Wrong model type
Choose an embedding-capable model from the model directory.
Vector dimensions mismatch
Vector dimensions mismatch
Keep the same model and dimensions for one vector index.
Missing API key
Missing API key
Send
Authorization: Bearer $COMETAPI_KEY.Error codes and retry strategy
400
400
Do not retry until the input, model ID, or dimensions setting is fixed.
401
401
Do not retry until the API key is present and valid.
404
404
Check the base URL, path, and model ID before retrying.
429
429
Retry with exponential backoff and reduce batch size or concurrency.
500 or 503
500 or 503
Retry with backoff for transient provider or service errors.
Pricing and model directory
Models page
Read how CometAPI exposes model IDs in the docs.
Model directory
Browse model availability and capabilities.
Pricing
Check pricing before you call a model.