RapidTextAI API Documentation

blog
Author RapidTextAI

Category

Page

Publish

26, July 2024

Text Completion API

Endpoint

https://app.rapidtextai.com/openai/completion?gigsixkey=YOUR_API_KEY

Method

POST

Parameters

Parameter Type Description
messages array Array of message objects with role and content
model string ID of model to use
max_tokens integer Maximum tokens in response (default: 2048)
temperature float Sampling temperature (0-2)
top_p float Nucleus sampling parameter (0-1)
frequency_penalty float Penalty for token frequency (-2 to 2)
presence_penalty float Penalty for token presence (-2 to 2)

Example Request/Response

Sample Request

{
    "model": "gpt-4",
    "messages": [
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Tell me a story"}
    ],
    "temperature": 0.7,
    "max_tokens": 500,
    "top_p": 1,
    "frequency_penalty": 0,
    "presence_penalty": 0
}

Sample Response

{
    "id": "chatcmpl-xyz123",
    "object": "chat.completion",
    "created": 1677858242,
    "model": "gpt-4",
    "choices": [{
        "index": 0,
        "message": {
            "role": "assistant",
            "content": "Once upon a time..."
        },
        "finish_reason": "stop"
    }],
    "usage": {
        "prompt_tokens": 15,
        "completion_tokens": 20,
        "total_tokens": 35
    }
}
Note: Replace YOUR_API_KEY with your actual API key

Available Models

Model ID Name Access Level
gemini-1.5-flash Gemini 1.5 Standard
gpt-4o-mini GPT4o Mini Standard
gpt-4 GPT-4 Standard
gpt-4o GPT-4o Pro Only
grok-2 Grok-2 Pro Only
gemini-1.5-pro Gemini 1.5 Pro Pro Only
deepseek-reasoner Deepseek R1 Pro Only
deepseek-chat Deepseek V3 Standard
gemini-2.0-flash Gemini 2 Standard
gemini-2.0-pro Gemini 2 Pro Pro Only

Article Generation API

Endpoint

https://app.rapidtextai.com/openai/v1/chat/completionsarticle?gigsixkey=YOUR_API_KEY

Method

POST

Parameters

Parameter Type Description
model string ID of model to use
messages array Array containing user message with topic, keywords, tone, audience and style
tools array Optional array of tool configurations for image generation
tool_choice string Tool selection mode (auto/none)
chatsession string Current chat session ID
dataType string Should be set to "article"

Example Request/Response

Sample Request

{
    "model": "gpt-4",
    "messages": [{
        "role": "user",
        "content": [{
            "type": "text",
            "text": "Generate a detailed article on the topic of AI 
            with the following keywords: machine learning, neural networks
            with the tone of voice: professional
            for the target audience: tech professionals
            with the writing style: technical"
        }]
    }],
    "tools": [{
        "type": "function",
        "function": {
            "name": "_generateImage",
            "description": "Generate an image based on article content",
            "parameters": {
                "type": "object",
                "properties": {
                    "prompt": {"type": "string"},
                    "style": {"type": "string"},
                    "size": {"type": "string"}
                }
            }
        }
    }],
    "tool_choice": "auto",
    "chatsession": "session123",
    "dataType": "article"
}

Sample Response

{
    "id": "chatcmpl-xyz123",
    "object": "chat.completion",
    "created": 1677858242,
    "model": "gpt-4",
    "choices": [{
        "index": 0,
        "message": {
            "role": "assistant",
            "content": "Artificial intelligence (AI) is a branch of computer science that aims to create machines that can perform tasks that require human intelligence. Machine learning is a subset of AI that focuses on developing algorithms that allow computers to learn from and make predictions or decisions based on data. Neural networks are a type of machine learning algorithm that is inspired by the structure of the human brain. They consist of interconnected nodes, or neurons, that process and transmit information. Neural networks are used in a variety of applications, including image and speech recognition, natural language processing, and autonomous vehicles. In this article, we will explore the key concepts of AI, machine learning, and neural networks, and discuss their applications in the tech industry."
        },
        "finish_reason": "stop"
    }],
    "usage": {
        "prompt_tokens": 15,
        "completion_tokens": 20,
        "total_tokens": 35
    }
}
Note: The API can optionally generate relevant images for the article content

API Pricing

Usage & Credits

Cost per Operation

  • Single API Request 1 prompt
  • Article Generation 10 prompts
  • Image Generation 50 prompts

Monthly Prompt Allowance

Account Type Monthly Prompts
Free User 100 prompts
Basic Subscriber 10,000 prompts
Premium Subscriber 30,000 prompts
Note: Unused prompts do not roll over to the next month. Subscription levels determine your monthly prompt allocation.

All set to level up
your content game?

Get Started Now
cta-area