Skip to main content

Quickstart: Compressa REST API

This guide shows how to start using Compressa via curl requests.

Get API_KEY

You can get the key after registration.

Embeddings

curl -X 'POST' \
'https://compressa-api.mil-team.ru/v1/embeddings' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <your_key_here>' \
-d '{
"model": "Compressa-Embedding",
"input": "string"
}'

Chat completions

curl -X 'POST' \
'https://compressa-api.mil-team.ru/v1/chat/completions' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <your_key_here>' \
-d '{
"model": "Compressa-LLM",
"messages": [
{"role": "user", "content": "Who won the world series in 2020?"}
],
"max_tokens": 128,
"temperature": 0.5,
"stream": false
}'

Rerank

curl -X POST "https://compressa-api.mil-team.ru/v1/rerank" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H 'Authorization: Bearer <your_key_here>' \
-d '{
"model": "Compressa-ReRank",
"query": "Query?",
"documents": [
"document 1",
"document 2",
"document 3"
],
"return_documents": false
}'