Logo Logo
Logo
  • Pricing
  • Blog
  • API
  • Models
  • About Us
  • Contact
  • Login

API

How to Use the Acurai API Endpoint

The Acurai API endpoint allows you to obtain an accurate extractive Q/A response to a supplied query and corresponding texts.

Important: The Acurai endpoint provides 100% accuracy when you use it properly.

Cut Costs Up To 95%

OpenAI made GPT-4o-mini available for fine tuning the week before our launch. The combination of GPT-4o and GPT-4o-mini has already passed our alpha-level tests. We only charge 5% of the token usage when you specify this model. In other words, for every 100 tokens consumed by these models, we only deduct 5 tokens from your account. To specify the model, be sure to include {model: 'gpt-4o'} in your POST request.

You are encouraged to view the Available Models page to see additional alternatives for reducing your costs and increasing the speed of responses. For more details on reducing latency and costs, see "Cutting Costs and Reducing Latency: RAGFix's Innovative Roadmap"

Charges

The Acurai endpoint involves many AI, ML, and NLP models working in tandem to produce the 100% accurate response. You will be charged for the input and output tokens for each model used. Our base model is currently GPT-4. Although we have achieved 100% accuracy on RAGTruth for GPT 3.5 Turbo for both Subtle and Evident Conflicts, you will notice that GPT 3.5 Turbo provides a fact by fact presentation whereas GPT-4 is more conversational. (See Hallucination Analyzer real-world examples.)

Beta Period

RAGFix entered the beta period after achieving 100% accuracy on RAGTruth QA for GPT 4 and GPT 3.5 Turbo. RAGFix will enter production after the endpoint has been additionally validated on HaluEval QA, Truthful QA, and PopQA. See our product roadmap for more information.

Endpoint URL

The URL of the API endpoint is: https://api.ragfix.ai/acurai

Step 1: Obtain an API Key

First, you need to obtain an API key. This key will authenticate your requests to the API. Contact the service provider or visit their website to get your API key.

Step 2: Make a POST Request

Once you have the API key, you can make a POST request to the endpoint. The request requires the following parameters:

  • query: A string containing your query.
  • texts: An array of texts that contain information likely relevant to the query.
  • apiKey: Your API key.

Response

The response will include a field called content which contains the result of your query.

The default content includes basic HTML formatting. To receive text only, specify {html: false} in your POST request.

Example Requests

Nodejs


            const axios = require('axios');
            
            const apiUrl = 'https://api.ragfix.ai/acurai';
            const apiKey = 'YOUR_API_KEY'; // Replace with your actual API key
            const query = 'your_query_string'; // Replace with your actual query string
            const texts = ['text1', 'text2']; // Replace with your actual texts array
            
            const requestData = {
            query: query,
            texts: texts,
            apiKey: apiKey
            };
            
            axios.post(apiUrl, requestData)
            .then(response => {
                console.log('Content:', response.data.content);
            })
            .catch(error => {
                console.error('Error:', error);
            });
            

Python


            import requests
            
            api_url = 'https://api.ragfix.ai/acurai'
            api_key = 'YOUR_API_KEY'  # Replace with your actual API key
            query = 'your_query_string'  # Replace with your actual query string
            texts = ['text1', 'text2']  # Replace with your actual texts array
            
            request_data = {
                'query': query,
                'texts': texts,
                'apiKey': api_key
            }
            
            response = requests.post(api_url, json=request_data)
            
            if response.status_code == 200:
                print('Content:', response.json().get('content'))
            else:
                print('Error:', response.status_code, response.text)
            

PHP


            <?php
            $api_url = 'https://api.ragfix.ai/acurai';
            $api_key = 'YOUR_API_KEY'; // Replace with your actual API key
            $query = 'your_query_string'; // Replace with your actual query string
            $texts = array('text1', 'text2'); // Replace with your actual texts array
            
            $request_data = json_encode(array(
                'query' => $query,
                'texts' => $texts,
                'apiKey' => $api_key
            ));
            
            $ch = curl_init($api_url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, array(
                'Content-Type: application/json'
            ));
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $request_data);
            
            $response = curl_exec($ch);
            curl_close($ch);
            
            $response_data = json_decode($response, true);
            
            if (isset($response_data['content'])) {
                echo 'Content: ' . $response_data['content'];
            } else {
                echo 'Error: ' . $response;
            }
            ?>
            

Curl


            curl -X POST https://api.ragfix.ai/acurai \
              -H "Content-Type: application/json" \
              -d '{
                "query": "your_query_string",
                "texts": ["text1", "text2"],
                "apiKey": "YOUR_API_KEY"
              }'
            
Logo

Subscribe to our newsletter for the latest in AI, Machine Learning, and Natural Language Processing.

    All Rights Reserved — RAGFix 2024

    Company

    • Blog
    • API
    • About Us
    • Contact

    Open Source

    • EZ ChatGPT FineTuner Client
    • EZ ChatGPT FineTuner Server

    Contact Info

    • Address: Acurai Inc, 1150 NW 72nd Ave Tower 1 Ste 455 #15319, Miami, Florida 33126
    • Email: contact@RAGFix.com
    • Ticket: www.RAGFix.ai/support

    All Rights Reserved — RAGFix 2024

    Thumb