Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 2.05 KB

using-embeddings-api.mdx

File metadata and controls

57 lines (42 loc) · 2.05 KB
meta content tags dates
title description
Using Embeddings API
This page explains how to use the Embeddings API
h1 paragraph
Using Embeddings API
This page explains how to use the Embeddings API
generative-apis ai-data embeddings-api
validation posted
2024-09-03
2024-09-03

Scaleway Generative APIs are designed as a drop-in replacement for the OpenAI APIs. If you have clustering or classification tasks already using one of OpenAI's client libraries, you can easily configure it to point to Scaleway Embeddings API, and get your existing applications running with open-weight embedding models hosted at Scaleway.

Create embeddings

Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.

Request sample:

curl --request POST \
     --url https://api.scaleway.ai/v1/embeddings \
     --header 'Authorization: Bearer ${SCW_SECRET_KEY}' \
     --header 'Content-Type: application/json'
     --data '{
     "model": "sentence-t5-xxl",
     "input": "<string>"
     }'

Headers

Find required headers in this page.

Body

Required parameters

Param Type Description
input string or array Input text to embed, encoded as a string or array of strings. It cannot be an empty string.
model string The name of the model to query.

Our embeddings API is OpenAI compatible. Use OpenAI’s API reference for more detailed information on the usage.

Unsupported parameters

  • encoding_format (default float)
  • dimensions

If you have a use case requiring one of these unsupported parameters, please contact us via Slack on #ai channel.

Check our [Python code examples](/generative-apis/how-to/query-embedding-models/#querying-embedding-models-via-api) to query embedding models using Scaleway's Embeddings API.