API Reference
Text SeriesPOSTCreate Embedding
API Reference

Create Embedding

POSThttps://api.tokenbay.com/v1/embeddings

Create 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

openai
POST/v1/embeddings

Request

schema

The gateway authenticates and routes by model. Same-protocol requests are forwarded; protocol conversion may map or reject fields that the target upstream cannot represent.

modelstringRequired

Embedding model ID shown by the live Models API or console.

inputstring | string[]Required

Text to embed. Token ID arrays are not a portable gateway input and may be rejected when conversion is required.

encoding_formatstringOptional

Output encoding. float is the interoperable default; base64 is supported only when the selected model and channel can preserve it.

floatbase64
dimensionsintegerOptional

Requested output dimensions. Support, valid values, and whether the field is forwarded depend on the selected model and channel.

userstringOptional

Optional client-side user identifier. Do not include sensitive data.

Response

schema

Successful non-streaming responses normally use an OpenAI-compatible embedding list. Concrete dimensions and optional fields remain model- and channel-dependent.

objectstringOptional

Usually list for an OpenAI-compatible embeddings response.

data[]array<object>Optional

One embedding result for each accepted input item.

data[].objectstringOptional

Usually embedding.

data[].indexintegerOptional

Input item index.

data[].embeddingnumber[] | stringOptional

Vector values, or a base64 string when the selected upstream supports base64 output.

modelstringOptional

Model name reported by the upstream or gateway conversion.

usageobjectOptional

Token usage when the upstream provides it.

usage.prompt_tokensintegerOptional

Input token count.

usage.total_tokensintegerOptional

Total 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.

Related