Embeddings — OneHub
Generate embeddings. Currently routes to OpenAI.
Docs
Docs Quick Start Authentication SDK Setup Available Models Rate Limits Chat Completions Streaming List Models Embeddings Image Generation Text to Speech Speech to Text Billing & Wallet Webhooks ErrorsEmbeddings
POST https://www.onehub.design/v1/embeddings
Request
curl https://www.onehub.design/v1/embeddings \
-H "Authorization: Bearer sk-onehub-xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/text-embedding-3-small",
"input": ["Hello world", "Another document"]
}'
Response
{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [-0.0055, 0.0212, -0.0301, 0.0124],
"index": 0
},
{
"object": "embedding",
"embedding": [0.0031, -0.0114, 0.0278, -0.0029],
"index": 1
}
],
"model": "openai/text-embedding-3-small",
"usage": { "prompt_tokens": 8, "total_tokens": 8 }
}
Parameters
| Field | Type | Description |
|---|---|---|
model | string | Embedding model ID, e.g. openai/text-embedding-3-small |
input | string / array | Text or array of strings to embed |
dimensions | number | Optional output dimensionality |
encoding_format | string | float (default) or base64 |
Embeddings output is a dense vector you can store and index for semantic search and RAG (retrieval-augmented generation) pipelines.