Criar embeddings
post/v1/embeddings
Converte texto em embeddings vetoriais.
Autenticação
Envie sua chave de API da OLETOKEN como token Bearer. As chaves são criadas na página Chaves de API do console.
Authorization: Bearer $OLETOKEN_API_KEYCorpo da requisição
Content-Type:application/json
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| model | string | — | |
| input | string | string[] | O texto a converter em embedding | |
| encoding_format | stringdefault: floatfloatbase64 | — | — |
| dimensions | integer | — | Dimensões do vetor de saída |
Respostas
200Embedding criado
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| object | string | — | — |
| data | object[] | — | — |
| object | string | — | — |
| index | integer | — | — |
| embedding | number[] | — | — |
| model | string | — | — |
| usage | object | — | — |
| prompt_tokens | integer | — | — |
| total_tokens | integer | — | — |
Requisição de exemplo
curl -X POST 'https://api.oletoken.ai/v1/embeddings' \
-H "Authorization: Bearer $OLETOKEN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "text-embedding-ada-002",
"input": "string"
}'
