AI & LLM

Embedding Vector Response JSON Example

A JSON example of an embeddings API response — includes the float vector, model, index, and token usage. Copy-ready for semantic search, RAG, and vector databases.

{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0.0023064255,
        -0.009327292,
        0.015797347,
        -0.0073122089,
        0.041634988,
        -0.018429902
      ]
    }
  ],
  "model": "text-embedding-3-small",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

Field Reference

datarequiredarray<object>One embedding object per input string, in request order
data[].indexrequiredintegerPosition of this embedding matching the input array index
data[].embeddingrequiredarray<number>The dense float vector. Real vectors have 256–3072 dimensions (truncated here)
modelrequiredstringEmbedding model used; determines the vector dimensionality
usage.total_tokensrequiredintegerTokens consumed embedding the input — used for billing

Variants

Request bodySend one or many strings to embed in a single call.
{
  "model": "text-embedding-3-small",
  "input": [
    "How do I reset my password?"
  ],
  "encoding_format": "float"
}
Stored vector recordHow an embedding is typically persisted in a vector database with metadata.
Stored vector record
{
  "id": "doc_4821#chunk_3",
  "values": [
    0.0023064255,
    -0.009327292,
    0.015797347,
    -0.0073122089
  ],
  "metadata": {
    "source": "help-center/account.md",
    "title": "Resetting your password",
    "chunk": 3,
    "tokens": 128
  }
}

Common Use Cases

  • Indexing documents for semantic search and retrieval-augmented generation (RAG)
  • Finding similar items by cosine similarity between vectors
  • Clustering or deduplicating text by embedding distance
embeddingsvectorsemantic searchragvector database

Validate or format this JSON

One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.

Frequently Asked Questions

It depends on the model. text-embedding-3-small returns 1536 dimensions, text-embedding-3-large returns 3072, and many open models use 384 or 768. The examples here are truncated to a few numbers for readability — store the full array.

JSON is fine for transport and small datasets, but for millions of vectors use a vector database (Pinecone, Weaviate, pgvector, Qdrant) that stores them in a compact binary format and supports fast nearest-neighbour search. Keep the JSON metadata alongside each vector.

No. Embeddings are only comparable within the same model and dimensionality. If you change embedding models, you must re-embed your entire corpus before similarity comparisons are meaningful.

Related JSON Examples