Models Hub
API ReferenceAudio & Others

Embeddings

OpenAI Embeddings API compatible endpoint for converting text into vectors. Supports models such as `gemini-embedding-001`, `text-embedding-004`, and `amazon.titan-embed-text-v2:0`.

Edit this page
POST
/v1/embeddings

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/embeddings" \  -H "Content-Type: application/json" \  -d '{    "model": "gemini-embedding-001",    "input": "Models Hub is an enterprise-grade AI API gateway"  }'
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0
      ]
    }
  ],
  "model": "string",
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0,
    "input_tokens": 0,
    "output_tokens": 0
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "request_id": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "request_id": "string"
  }
}