POST
/
embeddings
curl --request POST \
  --url https://geekai.dev/api/v1/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "text-embedding-3-small",
  "input": [
    "The food was delicious and the waiter..."
  ],
  "dimensions": 1536,
  "retries": 0
}'
{
  "model": "text-embedding-3-small",
  "data": [
    {
      "embedding": [
        -0.006929,
        0.0023415,
        "..."
      ],
      "index": 0
    }
  ],
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  },
  "object": "list"
}

Note: For setting the embedding model name, refer to the System Supported Embedding Models List. The request/response parameter structure is fully compatible with OpenAI. When switching models, you only need to modify the corresponding model name. If the model request/response parameters are inconsistent with OpenAI, GeekAI will automatically convert and align them at the underlying level. The response data format is fully compatible with OpenAI.

cURL Request Example

curl --location 'https://geekai.dev/api/v1/embeddings' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {YOUR_GEEKAI_API_KEY}' \
--data '{
    "input": [
        "The food was delicious and the waiter..."
    ],
    "model": "text-embedding-3-small"
}'

Authorizations

Authorization
string
header
required

token

Body

application/json

Response

200
application/json

successful response

The response is of type object.