Skip to content

h4ks-com/g4f-api

 
 

Repository files navigation

g4f-api

Alternative API for getting text completions from the g4f project

Live at

Quick Start

./start.sh

Then make requests:

curl -X POST http://localhost:8001/api/completions \
  -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": "Hello!"}]}'

Provider Management

This API uses a whitelist approach for provider management. Only curated, working providers are enabled (see PROVIDER_WHITELIST in backend/dependencies.py). This ensures reliable responses and fast failures.

Testing Providers

Test all whitelisted providers automatically:

uv run python3 test_providers.py

This will test each provider and show you which ones are currently working. Update PROVIDER_WHITELIST based on the results.

About

REST API for gpt4free

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 89.6%
  • HTML 6.9%
  • JavaScript 1.9%
  • CSS 1.1%
  • Dockerfile 0.5%