Skip to content

USE MODELS LIKE GPT-4o ,4o-mini and more for completely free in your apps :)

Notifications You must be signed in to change notification settings

Parthsadaria/FreeGPT-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 

Repository files navigation

🌟 Loki.AI API Documentation

Powerful AI Integration at Your Fingertips

Made with Love Developer

πŸš€ Quick Start Guide

Base URL

https://parthsadaria-lokiai.hf.space

API Endpoints

Endpoint URL Description
Chat Completions /chat/completions Main chat interface
SearchGPT /searchgpt?q=todays news Search functionality
Models /models Available models list

πŸŽ‰ Supports streaming functionality!

πŸ›‘οΈ Authentication

No authentication required!

🎊 It's completely FREE!

πŸ“¦ Request Format

{
    "model": "gpt-4o",
    "messages": [
        {
            "role": "user",
            "content": "Hello, AI!"
        }
    ],
    "stream": false
}

πŸ“€ Response Format

{
  "id": "chatcmpl-89DmxGJl4oqEultjlLBnGfdkV7Euk",
  "model": "gpt-4o",
  "object": "chat.completion",
  "created": 1731674826,
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I assist you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 11,
    "completion_tokens": 9,
    "total_tokens": 20
  }
}

πŸ› οΈ Example Usage

import openai

# Set API details
api_key = ''  # No key needed!
openai.api_base = "https://parthsadaria-lokiai.hf.space"
openai.api_key = api_key

def chat_with_gpt():
    try:
        response = openai.ChatCompletion.create(
            model="gpt-4o", 
            messages=[{"role": "user", "content": "hi homie"}],
            stream=False
        )
        print(response['choices'][0]['message']['content'])
    except Exception as e:
        print(f"Error: {e}")

chat_with_gpt()

🎨 Available Models

GPT Family

  • gpt-4o
  • gpt-4o-mini
  • gpt-3.5-turbo

Llama Family

  • llama-3.1-7b
  • llama-3.1-405b
  • llama-3.1-80b

Gemini Models

  • gemini-pro
  • gemini-1.5-flash

Mistral Models

  • mistral-medium
  • mixtral-8x7b

πŸ“š For a complete list of models, visit: Models Documentation


Built with ❀️ by Parth Sadaria

About

USE MODELS LIKE GPT-4o ,4o-mini and more for completely free in your apps :)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published