Cognitivers docs
API reference

Embeddings

Turn text into vectors for retrieval over your own corpus.

POST https://api.cognitivers.com/v1/embeddings

cog-embed returns 1,536-dimension vectors and is priced per input token, with no output charge. It exists for the case where a hosted embedding API declines to index the material you need to search: incident reports, forum dumps, leaked corpora, clinical notes, extremist material you are studying rather than publishing.

Request

curl https://api.cognitivers.com/v1/embeddings \
  -H "Authorization: Bearer $COGNITIVERS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "cog-embed",
    "input": ["first document", "second document"]
  }'

input takes a string or an array of strings. Send batches rather than one call per document: the per-request overhead is small but not free, and a batch of a few hundred short passages is a normal unit of work.

Response

{
  "object": "list",
  "model": "cog-embed",
  "data": [
    { "object": "embedding", "index": 0, "embedding": [0.013, -0.221, "..."] },
    { "object": "embedding", "index": 1, "embedding": [0.077, 0.004, "..."] }
  ],
  "usage": { "prompt_tokens": 12, "total_tokens": 12 }
}

Vectors are returned in the same order as the inputs. Store the model id alongside them: if you ever change embedding model, vectors from two different models are not comparable, and a mixed index silently returns nonsense.

Limits

Dimensions1,536
Context32,768 input tokens
Output chargenone

Retrieval

The usual shape: embed your corpus once, embed the query at request time, take the nearest vectors, and pass those passages to cog-fast or cog-pro as context. For a large corpus, keep the index in a vector store rather than in memory; the embedding endpoint does not store anything for you.

On this page