Embeddings
This page contains the endpoints related to text-embedding capabilities.
Apifox Coverage Notes
- Create text embeddings (OpenAI)
- Batch create embeddings (OpenAI)
- Create text embeddings (Gemini)
Model APIs / Embeddings
POST Create Text Embedding (Gemini)
POST /embeddings
Body Parameters
{
"input": "Your text string goes here",
"model": "gemini-embedding-001"
}
Request Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | No | none |
| body | body | object | No | none |
| » model | body | string | Yes | ID of the model to use. You can call the List models API to see all available models, or review the model overview for descriptions. |
| » input | body | string | Yes | Input text to embed, encoded as a string or token array. To create embeddings for multiple inputs in a single request, pass an array of strings or an array of token arrays. Each input must not exceed 8192 tokens. |
Response Example
200 Response
{
"object": "string",
"data": [
{
"object": "string",
"embedding": [
0
],
"index": 0
}
],
"model": "string",
"usage": {
"prompt_tokens": 0,
"total_tokens": 0
}
}
Responses
| Status | Meaning | Description | Model |
|---|---|---|---|
| 200 | OK | none | Inline |
Response Schema
Status 200
| Name | Type | Required | Constraints | Chinese Name | Description |
|---|---|---|---|---|---|
| » object | string | true | none | none | |
| » data | [object] | true | none | none | |
| »» object | string | false | none | none | |
| »» embedding | [number] | false | none | none | |
| »» index | integer | false | none | none | |
| » model | string | true | none | none | |
| » usage | object | true | none | none | |
| »» prompt_tokens | integer | true | none | none | |
| »» total_tokens | integer | true | none | none |