Query model Embedding
v1
post
/1/ai/{product_id}/openai/v1/embeddings
Path parameters
product_id
requiredinteger
AI TOOLS API product identifier - Use the following endpoint to retrieve your product identifier.
Examples:78849
Body Parameters
application/jsonencoding_formatstring
Possible values:float
The encoding format of the returned embeddings. Defaults to float.
Examples:float
inputrequiredarray
Input text to embed, encoded as a string or array of tokens.
modestring
Possible values:indexquery
Specify the mode of the embedding request.
Examples:query
modelrequiredstring
Possible values:bge_multilingual_gemma2mini_lm_l12_v2
Model name to use
Examples:bge_multilingual_gemma2
task_descriptionstring
Optional set your custom task information in query mode
Examples:example
Response Body
application/json
objectstring
The object type, which is always "list".
Examples:list
dataarrayofEmbedding object
An embedding object
modelstring
ID of the model used for the request
Examples:bge_multilingual_gemma2
usagerequiredEmbedding Response
Usage statistics for embedding request
Example request
<?php
use GuzzleHttp\Client;
$client = new Client();
$headers = [
'Authorization' => 'Bearer YOUR-TOKEN-HERE',
'Content-Type' => 'application/json'
];
$body = '{
"input": [],
"model": "bge_multilingual_gemma2"
}';
$request = new Request('POST', 'https://api.infomaniak.com/1/ai/{product_id}/openai/v1/embeddings', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
Example response
application/json
{"object":"list","data":[{"index":0,"object":"embedding","embedding":[3.71]}],"model":"bge_multilingual_gemma2","usage":{"prompt_tokens":60883,"total_tokens":21912}}