Infistar provides embedding, reranking and generation APIs. Your application prepares documents, stores vectors, enforces access and constructs the final context.

Prepare documents

Clean and split documents, retaining stable IDs, source URLs and access metadata. Send batches to POST https://infistar.ai/v1/embeddings with your Bearer key:
{
  "model": "EMBEDDING_MODEL_ID",
  "input": ["Create API keys in Token Management.", "Download a video when its task completes."]
}
Replace all model placeholders with IDs available to your key. Save each returned data[index].embedding alongside the corresponding source passage. Query and document vectors must use the same model and preprocessing. Re-embed documents when changing embedding models.

Retrieve and rerank

Embed the user’s query and retrieve candidates from your own vector database. Apply tenant and document permissions before sending candidates to another API. Keep the original candidate order. Send POST https://infistar.ai/v1/rerank:
{
  "model": "RERANK_MODEL_ID",
  "query": "Where can I create an API key?",
  "documents": ["Download a completed video.", "Create API keys in Token Management."],
  "top_n": 1,
  "return_documents": true
}
Read results, and use each result’s index to retrieve the original passage and source. Do not use the result’s array position as the source index. Choose candidate counts and relevance thresholds using representative questions; scores are not interchangeable across models.

Generate an answer

Put the selected passages into messages for Chat Completions or input for Responses. Limit context to the model’s capacity. Keep source IDs and URLs yourself so displayed citations correspond to real documents.

Validate before release

  • Keep keys on your server and filter unauthorized passages before retrieval results leave it.
  • Test index-to-source mapping and separately handle authentication, permission, rate-limit and server errors.
  • Compare retrieval alone with retrieval plus reranking for quality, latency and cost using your own data.
  • Record the public model ID, endpoint, request time and source IDs needed to reproduce an answer.
Reranking is optional. Small collections or already-accurate retrieval may not benefit enough to justify it. Infistar does not host your vector store or document permissions through these APIs. Read the Embeddings fields, Rerank fields and Rate limits.