Ointerference
DOCS
API Reference

Embeddings API Reference

Specification for the authenticated POST /v1/embeddings endpoint.

POST /v1/embeddings (Authenticated Endpoint)

Creates an embedding vector representing the input text.

Authenticated Access: Requires an API key passed via Authorization: Bearer sk_live_....


Request

POST /v1/embeddings HTTP/1.1
Host: api.interference.dev
Authorization: Bearer sk_live_YOUR_API_KEY
Content-Type: application/json

{
  "input": "The quick brown fox jumps over the lazy dog",
  "model": "text-embedding-3-small"
}

Parameters

ParameterTypeRequiredDescription
inputstring | arrayYesInput text or array of text strings to embed.
modelstringYesID of the model to use.
encoding_formatstringNoFormat to return the embeddings in. Can be float (default) or base64.

Response

{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        -0.0069292834,
        -0.005336422,
        -0.024047505,
        0.003929112
      ]
    }
  ],
  "model": "text-embedding-3-small",
  "usage": {
    "prompt_tokens": 9,
    "total_tokens": 9
  }
}

On this page