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}/embeddings1
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model / engine ID, e.g. text-embedding-ada-002 |
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | array | Yes | Text to embed, or an array of texts (batch) |
encoding_format | string | No | float (default) or base64 |
dimensions | integer | No | Output 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."
}'1
2
3
4
5
6
2
3
4
5
6
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 }
}1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
TIP
New projects should prefer OpenAI native format's /v1/embeddings. This endpoint mainly serves clients that depend on the legacy "engines" path.