textembedding-gecko

This documentation is valid for the following list of our models:

  • textembedding-gecko-multilingual@001

  • textembedding-gecko@003

Model Overview

A state-of-the-art text embedding model designed to convert textual data into numerical vector representations. It captures semantic meanings and relationships within the text, facilitating various natural language processing (NLP) tasks.

Setup your API Key

If you don’t have an API key for the AI/ML API yet, feel free to use our Quickstart guide.

Submit a request

API Schema

post
Authorizations
Body
modelundefined · enumRequiredPossible values:
inputany ofRequired

Input text to embed, encoded as a string or array of tokens.

string · min: 1Optional
or
string[] · min: 1Optional
dimensionsnumber | nullableOptional

The number of dimensions the resulting output embeddings should have.

auto_truncatebooleanOptional

If enabled, this parameter automatically truncates the input text to fit within the model’s maximum token limit. It helps ensure that longer texts are processed without errors.

Default: true
task_typestring · enumOptional

Optional task type for which the embeddings will be used

Possible values:
titlestringOptional

An optional title for the text. Only applicable when task_type is RETRIEVAL_DOCUMENT.

Note: Specifying a title for RETRIEVAL_DOCUMENT provides better quality embeddings for retrieval.

Responses
201Success
post
POST /v1/embeddings HTTP/1.1
Host: api.aimlapi.com
Authorization: Bearer <YOUR_AIMLAPI_KEY>
Content-Type: application/json
Accept: */*
Content-Length: 144

{
  "model": "textembedding-gecko-multilingual@001",
  "input": "text",
  "dimensions": 1,
  "auto_truncate": true,
  "task_type": "RETRIEVAL_QUERY",
  "title": "text"
}
201Success

No content

Last updated

Was this helpful?