Skip to main content
POST
/
embeddings
CheapestInference SDK (Python)
from cheapestinference import CheapestInference
import os

client = CheapestInference(
    api_key=os.environ.get("CHEAPESTINFERENCE_API_KEY"),
)

response = client.embeddings.create(
    model="BAAI/bge-large-en-v1.5",
    input="New York City",
)

print(response.data[0].embedding)
{
  "object": "list",
  "model": "<string>",
  "data": [
    {
      "object": "embedding",
      "embedding": [
        123
      ],
      "index": 123
    }
  ]
}

Authorizations

Authorization
string
header
default:default
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
required

The name of the embedding model to use.

See all of CheapestInference's embedding models

Available options:
WhereIsAI/UAE-Large-V1,
BAAI/bge-large-en-v1.5,
BAAI/bge-base-en-v1.5
Example:

"BAAI/bge-base-en-v1.5"

input
required

A string providing the text for the model to embed.

Example:

"Our solar system orbits the Milky Way galaxy at about 515,000 mph"

completion_window
string | null

Time window for completing the request. Can be null, a duration string (e.g., '1s', '24h', '7d'), or 'now' for immediate processing.

Example:

"24h"

webhook_url
string<uri> | null

Optional webhook URL to receive completion notifications. Must be a valid HTTPS URL.

Example:

"https://example.com/webhook"

Response

200

object
enum<string>
required
Available options:
list
model
string
required
data
object[]
required