Create embeddings
This page documents the Create Embeddings endpoint in models-model.md style: Overview, Authentication, Parameters, Request examples, Response example.
Overview
- Method:
POST - Path:
/v1/embeddings - Content-Type:
application/json
Authentication
- Use HTTP Bearer Token, e.g.
Authorization: Bearer sk-xxxxx
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | yes | Model ID to use, e.g. text-embedding-3-large (see model list) |
| input | string | array[string] | yes | Text(s) to encode as embeddings. Single string or array of strings supported; length limits depend on the model |
Request examples
Single input example:
json
{
"model": "text-embedding-3-large",
"input": "She is very beautiful and likes..."
}Batch input example:
json
{
"model": "text-embedding-3-large",
"input": [
"Text A",
"Text B"
]
}curl
bash
curl -X POST "https://api.gpt.ge/v1/embeddings" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxx" \
-d '{"model":"text-embedding-3-large","input":"She is very beautiful and likes..."}'JavaScript (fetch)
javascript
fetch('https://api.gpt.ge/v1/embeddings', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer sk-xxxx' },
body: JSON.stringify({ model: 'text-embedding-3-large', input: 'She is very beautiful and likes...' })
}).then(r => r.json()).then(console.log)Python (requests)
python
import requests
payload = { 'model': 'text-embedding-3-large', 'input': 'She is very beautiful and likes...' }
resp = requests.post('https://api.gpt.ge/v1/embeddings', headers={'Content-Type':'application/json','Authorization':'Bearer sk-xxxx'}, json=payload)
print(resp.json())Response example (200)
json
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
-0.022425562,
-0.010263717,
0.022136442,
0.015323295,
-0.0013466021
]
}
],
"model": "text-embedding-3-large",
"usage": { "prompt_tokens": 16, "total_tokens": 16 }
}