Create Embedding
https://api.tokenbay.com/v1/embeddingsCreate vector embeddings through the OpenAI-compatible Embeddings API
Converts text into vectors for semantic search, retrieval, clustering, and related workloads.
Use a model available to the current API key; input batching, dimensions, and encoding support vary by model and channel.
Create Embedding
/v1/embeddingsRequest
schemaThe gateway authenticates and routes by model. Same-protocol requests are forwarded; protocol conversion may map or reject fields that the target upstream cannot represent.
modelstringRequiredEmbedding model ID shown by the live Models API or console.
inputstring | string[]RequiredText to embed. Token ID arrays are not a portable gateway input and may be rejected when conversion is required.
encoding_formatstringOptionalOutput encoding. float is the interoperable default; base64 is supported only when the selected model and channel can preserve it.
floatbase64dimensionsintegerOptionalRequested output dimensions. Support, valid values, and whether the field is forwarded depend on the selected model and channel.
userstringOptionalOptional client-side user identifier. Do not include sensitive data.
Response
schemaSuccessful non-streaming responses normally use an OpenAI-compatible embedding list. Concrete dimensions and optional fields remain model- and channel-dependent.
objectstringOptionalUsually list for an OpenAI-compatible embeddings response.
data[]array<object>Optional
One embedding result for each accepted input item.
data[].objectstringOptionalUsually embedding.
data[].indexintegerOptionalInput item index.
data[].embeddingnumber[] | stringOptionalVector values, or a base64 string when the selected upstream supports base64 output.
modelstringOptionalModel name reported by the upstream or gateway conversion.
usageobjectOptional
Token usage when the upstream provides it.
usage.prompt_tokensintegerOptionalInput token count.
usage.total_tokensintegerOptionalTotal token count.
Use a model ID returned by the live Models API or console; this page does not promise a fixed embedding model list.
input accepts one string or a string array when the selected upstream supports batching. Batch limits and token limits vary by model and channel.
dimensions is model-specific. When the gateway converts to Gemini, unsupported dimensions may be dropped and invalid values or fields without an equivalent may be rejected.
encoding_format=float is the portable default. encoding_format=base64 is not guaranteed across converted channels and may be rejected when the response format cannot be preserved.
The legacy /v1/engines/{model}/embeddings path is documented separately for compatibility with older clients.
