Groq API Documentation

Understanding the Groq API, its capabilities, and why we use it for our email enhancement service.


Our email enhancement service is powered by Groq, a high-performance AI inference platform that provides some of the fastest language model inference available today.

This page explains why our email enhancement service requires a subscription and how the Groq API pricing works.

What is Groq?

Groq is an AI technology company that specializes in high-speed inference for Large Language Models (LLMs). Their platform provides access to popular open-source models like Llama 3, Mixtral, and others, but with significantly faster response times than most other services.

Key benefits of Groq include:

  1. Exceptional Speed: Groq processes tokens up to 10x faster than competitors
  2. High-Quality Models: Access to leading AI models from Meta, Mistral, and others
  3. OpenAI-Compatible API: Simple integration with a familiar API format
  4. Reliable Inference: Consistent performance for production applications

Why We Use Groq

We selected Groq for our email enhancement service for several compelling reasons:

  1. Speed of Response: Groq's ultra-fast inference means your enhanced emails are delivered almost instantly
  2. Quality of Output: Access to top-tier models ensures high-quality email enhancements
  3. Reliability: Enterprise-grade API performance for consistent results

Why This Service Is Not Free

The Groq API is a paid service, which is why we must charge for our email enhancement feature.

Token-Based Pricing

Groq operates on a token-based pricing model. Every time you enhance an email:

  • Your email text is converted into tokens (roughly 4 characters per token)
  • These tokens are sent to Groq's API (input tokens)
  • Groq's API generates enhanced text (output tokens)
  • Both input and output tokens are billed at different rates

Current Pricing Structure

Groq charges per million tokens processed. While rates vary by model, typical costs are:

  • Input Tokens: $0.70-$1.50 per million tokens
  • Output Tokens: $0.90-$2.00 per million tokens

For context, a typical business email of 300 words (approximately 400 tokens) could cost between $0.0003 and $0.0008 to enhance, depending on the model used and the length of the enhanced output.

Our Subscription Model

To provide the best value to our users while covering API costs, we've implemented a subscription-based pricing model that:

  • Covers the API costs we incur from Groq
  • Provides a predictable monthly expense for users
  • Includes additional features and benefits
  • Supports ongoing development and improvement of our service

Models We Use

  • Llama 3.3 70B Versatile: A powerful, versatile model from Meta for high-quality text enhancements
  • Mixtral 8x7B: An excellent model from Mistral AI that excels at nuanced writing improvements

These models are selected for their excellent balance of performance, quality, and cost-effectiveness for email enhancement tasks.

Technical Implementation

The Groq API follows an OpenAI-compatible format, making it straightforward to integrate:

// Example API call to Groq for email enhancement
const response = await fetch('https://api.groq.com/openai/v1/chat/completions', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${process.env.GROQ_API_KEY}`
  },
  body: JSON.stringify({
    model: 'llama-3.3-70b-versatile',
    messages: [
      {
        role: 'system',
        content: 'You are an expert email editor that improves clarity, professionalism, and effectiveness.'
      },
      {
        role: 'user',
        content: userEmailText
      }
    ]
  })
});

Resources

For developers interested in learning more about the Groq API:

  • Groq API Playground: Test different models and prompts directly in your browser
  • API Documentation: Explore all API parameters and response attributes
  • Model Information: Details about available models and their capabilities
  • Developer Community: Connect with other developers using Groq