Simple ChatGPT API

FREEMIUM
От LightningDev | Обновлено 4 days ago | Artificial Intelligence/Machine Learning
Популярность

9.7 / 10

Задержка

877ms

Уровень обслуживания

99%

Health Check

N/A

ПРОЧТИ МЕНЯ

Simple ChatGPT API Documentation

Overview

The Simple ChatGPT API provides a straightforward interface for integrating conversational AI capabilities into various applications. This API utilizes OpenAI’s ChatGPT model to generate human-like text responses based on the input provided. It’s perfect for creating chatbots, automating customer support, and enhancing user interaction.

Base URL

The base URL for all API requests is:

https://simple-chatgpt-api.p.rapidapi.com

Authentication

To authenticate with the Simple ChatGPT API, you will need to include your RapidAPI key in the header of each request. You can find your key in your RapidAPI Developer Dashboard.

Header:

headers: {
    'content-type': 'application/json',
    'X-RapidAPI-Key': 'Your_RapidAPI_Key',
    'X-RapidAPI-Host': 'simple-chatgpt-api.p.rapidapi.com'
}

Endpoints

Generate Response with model GPT 3.5 & GPT 4

Generates a response based on the input text provided.

  • Endpoint for GPT 3.5: /ask
  • Endpoint for GPT 4: /ask/gpt4
  • Method: POST
  • Headers:
    • Content-Type: application/json
    • X-RapidAPI-Key: Your_RapidAPI_Key
    • X-RapidAPI-Host: simple-chatgpt-api.p.rapidapi.com
  • Body:
    {
      "question": "Your input text"
    }
    
  • Response:
    {
      "answer": "Generated text response from the ChatGPT model."
    }
    

Example Request:

curl -X POST \
   https://simple-chatgpt-api.p.rapidapi.com/ask \
    -H 'Content-Type: application/json' \
    -H 'X-RapidAPI-Key: Your_RapidAPI_Key' \
    -H 'X-RapidAPI-Host: simple-chatgpt-api.p.rapidapi.com' \
    -d '{"question": "Hello, how can I help you today?"}'

Example Response:

{
  "answer": "Hello! I'm here to assist you. What do you need help with today?"
}

Error Handling

Errors are returned using standard HTTP response codes. In addition to the HTTP code, responses will also include a brief description of the error.

  • 400 Bad Request: The request was unacceptable, often due to missing a required parameter.
  • 401 Unauthorized: Incorrect or missing authentication credentials.
  • 500 Internal Server Error: An error occurred on our servers while processing the request.

Rate Limiting

Please be aware that the API is subject to rate limiting. The limits are designed to ensure equitable distribution of services to all users. If you exceed these limits, your requests will be throttled until the limit resets.

For more detailed information on specific limits, refer to your API subscription details in your RapidAPI dashboard.

Подписчики: 10
Создатель API:
Rapid account: Lightning Dev
LightningDev
LightningDev
Войдите, чтобы оценить API
Оценки: 5 - Голосов: 1