Skip to main content

Usage Credits

Overview

Ragapi operates on a credit-based system, where each API request consumes a certain number of credits. This system allows you to track usage and ensure that you are managing costs effectively.

Credit Usage

  • 1 Store Request: Every request to the /store-document endpoint consumes 25 credits. This is the cost for processing and storing the document embeddings in Pinecone.
  • 1 Conversation Request: Every request to the /conversation endpoint consumes 2 credits. This includes the cost of both querying the context and interacting with the LLM (Large Language Model) to generate a response.

Conversation Request Breakdown

A conversation request consists of two parts:

  1. Querying the Context: When a conversation request is made, Ragapi first queries the stored documents to gather relevant context based on the provided query and the stored embeddings.
  2. Asking the Question to LLM: After the context is gathered, the question is sent to the LLM model to generate a response based on the retrieved context.

Logs and Credit Consumption

In the logs, you will see two distinct items for each conversation request:

  • query_document: This corresponds to the querying process where Ragapi retrieves the relevant context from the stored documents.
  • prompt: This corresponds to the step where the query is passed to the LLM model to generate an answer.

Each of these items counts as one part of the total cost for a conversation request, which together consumes 2 credits in total.