Skip to main content
POST
/
v1beta
/
models
/
{model}
:embedContent
curl --request POST \
  --url https://api.foxapi.cc/v1beta/models/{model}:embedContent \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "content": {
    "parts": [
      {
        "text": "What is deep learning?"
      }
    ]
  }
}
'
{
  "embedding": {
    "values": [
      0.0123,
      -0.0456,
      0.0789,
      0.0234,
      -0.0567
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.foxapi.cc/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

All endpoints require Bearer Token authentication

Add the following to your request headers:

Authorization: Bearer YOUR_API_KEY

Path Parameters

model
string
required

Embedding model name, e.g. gemini-embedding-2-preview

Example:

"gemini-embedding-2-preview"

Body

application/json
content
object
required

The content to embed

taskType
enum<string>

Embedding task type, which affects the optimization direction of the embedding vector. Note: gemini-embedding-2-preview does not support this field; that model uses a prompt prefix approach to specify task types (e.g. task: search result | query: {content})

Available options:
RETRIEVAL_QUERY,
RETRIEVAL_DOCUMENT,
SEMANTIC_SIMILARITY,
CLASSIFICATION,
CLUSTERING,
QUESTION_ANSWERING,
FACT_VERIFICATION,
CODE_RETRIEVAL_QUERY
title
string

Document title, only effective when taskType is RETRIEVAL_DOCUMENT

outputDimensionality
integer

Output vector dimensionality, used for dimensionality reduction. Default 3072

Response

Embedding response

embedding
object

Embedding result