Skip to content

Embeddings · Gemini Native Format

Naming note

Some documentation classifies this endpoint as "Gemini native format." Based on its actual path and parameters, it is really OpenAI's earlier "engines" path style (the model ID goes in the path rather than the request body) — functionally identical to OpenAI native format's /v1/embeddings, just a different path shape.

Create embeddings with a specific engine

POST /v1/engines/{model}/embeddings

Path parameters

ParameterTypeRequiredDescription
modelstringYesModel / engine ID, e.g. text-embedding-ada-002

Request parameters

ParameterTypeRequiredDescription
inputstring | arrayYesText to embed, or an array of texts (batch)
encoding_formatstringNofloat (default) or base64
dimensionsintegerNoOutput vector dimensions

Request example

bash
curl https://ai.youqi.tech/v1/engines/text-embedding-ada-002/embeddings \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "YouQi AI is a unified AI model gateway."
  }'

Response example

json
{
  "object": "list",
  "data": [
    { "object": "embedding", "index": 0, "embedding": [0.0023, -0.0091, 0.0157] }
  ],
  "model": "text-embedding-ada-002",
  "usage": { "prompt_tokens": 18, "total_tokens": 18 }
}

TIP

New projects should prefer OpenAI native format's /v1/embeddings. This endpoint mainly serves clients that depend on the legacy "engines" path.