Embeddings
Create text embeddings for search, retrieval and clustering with text-embedding-3-small and text-embedding-3-large through the OpenAI-compatible endpoint.
← すべてのドキュメントEmbeddings turn text into vectors you can store in a vector database for semantic search, retrieval-augmented generation (RAG), clustering and deduplication.
Endpoint
POST https://api.apisea.ai/v1/embeddings| Model | Dimensions | Best for |
|---|---|---|
text-embedding-3-small | 1536 (adjustable) | Low-cost search and RAG at scale |
text-embedding-3-large | 3072 (adjustable) | Highest retrieval quality |
text-embedding-ada-002 | 1536 | Compatibility with existing indexes |
Request
curl https://api.apisea.ai/v1/embeddings \
-H "Authorization: Bearer $APISEA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "text-embedding-3-small", "input": ["How do I reset my password?", "Billing and invoices"]}'from openai import OpenAI
client = OpenAI(api_key="sk-sea-...", base_url="https://api.apisea.ai/v1")
resp = client.embeddings.create(model="text-embedding-3-small", input=["first text", "second text"])
vectors = [d.embedding for d in resp.data]
print(len(vectors), len(vectors[0]))Parameters
| Parameter | Type | Description |
|---|---|---|
model | string | Embedding model id. |
input | string or array | Text or list of texts to embed. Batch up to a few hundred short texts per call. |
dimensions | integer | Optional. Shorten the vector (text-embedding-3 models only). |
encoding_format | string | float (default) or base64. |
Response
{
"object": "list",
"data": [{"object": "embedding", "index": 0, "embedding": [0.0023, -0.0091, ...]}],
"model": "text-embedding-3-small",
"usage": {"prompt_tokens": 12, "total_tokens": 12}
}Embeddings are billed per input token at the rate on each model page.
Tips
- Normalize and chunk documents (for example 300–800 tokens with some overlap) before embedding.
- Use the same model for indexing and querying; vectors from different models are not comparable.
- Store the model id alongside each vector so you can re-index safely later.
ドキュメントに問題が見つかりましたか?support@apisea.aiまでメールでお知らせください。