Section
Embeddings

/v1/embeddings

Create embeddings for one or more inputs.

POST/v1/embeddings

Create one or more embeddings (vector representations) from input text. OpenAI-compatible wire shape — the openai SDKs work with a base_url swap to https://api.tokenfactory.omniva.com/v1.

#Authentication

Bearer token in the Authorization header. See Authentication for how to mint and rotate keys.

HTTP
Authorization: Bearer $OMNIVA_API_KEY

#Parameters

FieldTypeDescription
modelrequired
stringID of the embeddings model to use. Browse the Embeddings tab in Model Library for available IDs in your workspace.
inputrequired
string | string[]The text to embed. Pass a single string for one embedding, or an array of strings to embed a batch in a single call. Embeddings in the response preserve input order via the index field.

#Response

Returns a list object whose data contains one embedding per input, in the same order as the request.

Production embeddings are 768-dimensional for nomic-ai/nomic-embed-text; other models use different dimensionalities — check the model's entry in Model Library. The example below is truncated for readability (... stands in for the remaining 764 floats).

200application/json
{
"object": "list",
"data": [
  {
    "object": "embedding",
    "index": 0,
    "embedding": [0.012, -0.034, 0.087, "... 765 more dimensions"]
  }
],
"model": "nomic-ai/nomic-embed-text",
"usage": {
  "prompt_tokens": 12,
  "total_tokens": 12
}
}

#Response fields

  • object — always "list".
  • data[].object — always "embedding".
  • data[].index — zero-based position matching the corresponding input.
  • data[].embedding — array of floats. Dimensionality depends on the model.
  • model — echoes the requested model ID.
  • usage.prompt_tokens / usage.total_tokens — token accounting for billing.

#Batched input

Pass an array of strings to embed multiple inputs in a single call. The response data array preserves input order via index — if your downstream code depends on order, key off index rather than assuming positional alignment.

Request:

JSON
{
  "model": "nomic-ai/nomic-embed-text",
  "input": [
    "The quick brown fox jumps over the lazy dog.",
    "Embeddings encode semantic meaning into vectors.",
    "Pricing tiers are listed on the dashboard."
  ]
}

Response:

JSON
{
  "object": "list",
  "data": [
    { "object": "embedding", "index": 0, "embedding": [0.012, -0.034, "..."] },
    { "object": "embedding", "index": 1, "embedding": [0.087, 0.005, "..."] },
    { "object": "embedding", "index": 2, "embedding": [-0.021, 0.063, "..."] }
  ],
  "model": "nomic-ai/nomic-embed-text",
  "usage": { "prompt_tokens": 27, "total_tokens": 27 }
}

#Errors

StatusCodeWhen
400invalid_payloadmodel or input is missing from the request body.
401unauthorizedMissing Authorization header or non-Bearer scheme.
401invalid_api_keyBearer token did not resolve to a live API key.
404model_not_foundThe requested model ID is not enabled for your workspace.
429rate_limitedWorkspace rate limit exceeded — back off and retry with jitter.
500internal_errorUnexpected gateway failure — safe to retry.
503upstream_unavailableThe model is temporarily not serving requests — retry with backoff.

See Errors for the full error envelope and retry guidance.

#Code samples

from openai import OpenAI
import os

client = OpenAI(
  api_key=os.environ["OMNIVA_API_KEY"],
  base_url="https://api.tokenfactory.omniva.com/v1",
)

resp = client.embeddings.create(
  model="nomic-ai/nomic-embed-text",
  input="The quick brown fox jumps over the lazy dog.",
)

vector = resp.data[0].embedding
print(len(vector))

#Not yet supported

The handler currently accepts only model and input. The following OpenAI request fields are recognized in the spec but not yet implemented — they are silently ignored if sent:

  • encoding_format — output is always a JSON array of floats. base64 encoding is not available.
  • dimensions — output dimensionality is fixed by the model; you cannot request a truncated vector.
  • user — end-user identifier for abuse tracking is not propagated.
Coming

These parameters are on the roadmap for parity with the OpenAI embeddings API. Track progress in the changelog.

#What next

Was this page helpful?