---
title: "/v1/embeddings"
description: "Create embeddings for one or more inputs."
section: api-reference
order: 2
layout: api-reference
updated: "2026-05-27"
---

`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](/docs/getting-started/authentication) for how to mint and rotate keys.

```http
Authorization: Bearer $OMNIVA_API_KEY
```

## Parameters

| name | type | required | description |
| --- | --- | --- | --- |
| model | string | true | ID of the embeddings model to use. Browse the Embeddings tab in Model Library for available IDs in your workspace. |
| input | string \| string[] | true | 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](/docs/getting-started/models-overview). The example below is truncated for readability (`...` stands in for the remaining 764 floats).

`HTTP 200` `application/json`

```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

| Status | Code | When |
|---|---|---|
| 400 | `invalid_payload` | `model` or `input` is missing from the request body. |
| 401 | `unauthorized` | Missing `Authorization` header or non-Bearer scheme. |
| 401 | `invalid_api_key` | Bearer token did not resolve to a live API key. |
| 404 | `model_not_found` | The requested `model` ID is not enabled for your workspace. |
| 429 | `rate_limited` | Workspace rate limit exceeded — back off and retry with jitter. |
| 500 | `internal_error` | Unexpected gateway failure — safe to retry. |
| [503](/docs/reference/errors#503-service-unavailable) | `upstream_unavailable` | The model is temporarily not serving requests — retry with backoff. |

See [Errors](/docs/reference/errors) for the full error envelope and retry guidance.

## Code samples

  
**Python**

```python
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))
```

  
**TypeScript**

```typescript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.OMNIVA_API_KEY,
  baseURL: "https://api.tokenfactory.omniva.com/v1",
});

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

const vector = resp.data[0].embedding;
console.log(vector.length);
```

  
**cURL**

```bash
curl https://api.tokenfactory.omniva.com/v1/embeddings \
  -H "Authorization: Bearer $OMNIVA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nomic-ai/nomic-embed-text",
    "input": "The quick brown fox jumps over the lazy dog."
  }'
```

## 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

  - [Embeddings guide](/docs/serverless/embeddings) — Common embedding workflows: indexing, retrieval, similarity, batching.
  - [Models overview](/docs/getting-started/models-overview) — Browse the embedding models available in your workspace.
  - [Chat completions API](/docs/api-reference/chat-completions) — The sibling endpoint for text generation against the same gateway.
  - [Tokens, pricing & quotas](/docs/serverless/pricing) — How tokens are counted and how workspace quotas behave. Embedding rates are quoted on request.

