Skip to main content
POST
/
v1
/
embeddings
curl --request POST \
  --url https://api.foxapi.cc/v1/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "text-embedding-3-small",
  "input": "Machine learning is a branch of artificial intelligence"
}
'
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "embedding": [
        0.0023064255,
        -0.009327292,
        0.015797347
      ],
      "index": 0
    }
  ],
  "model": "<string>",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

Authorizations

Authorization
string
header
required

All APIs require Bearer Token authentication

Add to request header:

Authorization: Bearer YOUR_API_KEY

Body

application/json
model
string
required

Embedding model name

Example:

"text-embedding-3-small"

input
required

Input text to embed, encoded as a string or array of strings

encoding_format
enum<string>
default:float

The format to return the embeddings in

Available options:
float,
base64
dimensions
integer

The number of dimensions the resulting output embeddings should have. Only supported in some models.

Response

Embedding response

object
enum<string>

Object type

Available options:
list
data
object[]

List of embedding objects

model
string

Model used

usage
object

Token usage statistics