Free-AI-Things
g4f-working
Python

g4f-working is a daily-updated list of working no-auth AI providers and models from @xtekky/gpt4free. It helps developers, testers, and AI enthusiasts instantly find which models are currently online and accessible without any API keys, tokens, or cookies.

Last updated Aug 9, 2026
130
Stars
15
Forks
1
Issues
0
Stars/day
Attention Score
72
Language breakdown
Python 100.0%
โ–ธ Files click to expand
README

๐Ÿš€ g4f-working

The daily-updated, zero-auth directory of working AI providers & models from GPT4Free

Daily Provider Model Testing License: CC BY-NC 4.0 Python 3.12+ Updated Daily No API Keys Tests

๐Ÿ’ก Like this project? โญ๏ธ Star the repo to support ongoing updates and help others discover it!

๐Ÿ“– Table of Contents


๐ŸŽฏ What is this?

g4f-working is the ultimate, constantly-updated hub for discovering which AI providers and models from @xtekky/gpt4free are working right now โ€” and, crucially, which ones require NO API keys, tokens or cookies.

Skip the hassle of trial-and-error. Every day, this project:

  • ๐Ÿ”„ Spins up a fresh g4f API server.
  • ๐Ÿ” Enumerates every provider and every model g4f knows about (typically 70+ providers, 3,000+ models).
  • ๐Ÿงช Sends a real test request to each provider|model pair for text, image, audio, and video capabilities.
  • ๐Ÿ“ Publishes the list of working ones as plain-text files you can fetch with curl or wget.
No Python needed. No dependencies. No API keys. Just grab the result files.

โœจ What's New in v2.0

The codebase has been refactored from a single 1,160-line file into a clean, modular Python package. All output file names and formats are 100% backwards-compatible โ€” your existing automation will keep working unchanged.

๐Ÿ› Bugs fixed

| # | Bug | Fix | |---|-----|-----| | 1 | testvideogeneration / testaudiogeneration mutated the payload dict across endpoint attempts, so the second endpoint received the wrong body. | Each endpoint now builds its own fresh payload. | | 2 | If the first endpoint returned HTTP 200 but had no media in the body, the tester gave up instead of trying the fallback endpoint. | Now continues to the next endpoint before reporting failure. | | 3 | responsetime was measured inconsistently โ€” sometimes from request start, sometimes from the outer try. | Uniformly measured from starttime at the top of each test. | | 4 | startg4fapi_server used a fixed time.sleep(5) to wait for readiness โ€” flaky on slow CI. | Now polls the server's /v1/providers endpoint until it responds 2xx or times out. | | 5 | signal.signal() was called at module import time, breaking library use. | Moved to an idempotent installsignalhooks() helper that's safe to call from any thread. | | 6 | TestResult dataclass was defined but never used (dead code). | Removed; only TestResultWithTypes is used. | | 7 | Six duplicated saveimage / savevideo / saveaudio* methods. | Consolidated into one MediaSaver class with a clean public API. | | 8 | fetchprovidersandmodels and fetchprovidersandmodelswithtypes were near-duplicates. | Merged into one parameterised fetch(with_types=...) method. | | 9 | responsetypes: List[str] = None with postinit mutation. | Replaced with field(default_factory=lambda: ["text"]). | | 10 | logging.basicConfig was called inside init every time the class was instantiated. | Now called once in main(). |

โœจ New features

  • ๐ŸŽ›๏ธ Full CLI โ€” every setting is overridable via --port, --timeout, --batch-size, etc.
  • ๐ŸŒ Environment variables โ€” G4FPORT, G4FAPIKEY, G4FTIMEOUT, G4FNOSERVER, โ€ฆ
  • ๐Ÿ”Œ Reusable as a library โ€” import from g4f_tester import Config, run and call from your own code.
  • ๐Ÿงช Comprehensive test suite โ€” 76 unit tests covering every module, including the bug-fixes above.
  • ๐Ÿ“ฆ Modular package โ€” clear separation of concerns across 8 focused modules.
  • ๐Ÿ›ก๏ธ Safer cleanup โ€” cleanup_browsers() is now fully idempotent and never raises.

๐Ÿš€ Quick Start

For end users (just want the working list)

Nothing to install. Just fetch the raw files:

# Plain list of working models:
curl -sL https://raw.githubusercontent.com/maruf009sultan/g4f-working/refs/heads/main/working/models.txt

Provider | Model | Type lines:

curl -sL https://raw.githubusercontent.com/maruf009sultan/g4f-working/refs/heads/main/working/working_results.txt

Example output:

Blackbox|gpt-4o-mini|text BlackForestLabs_Flux1Dev|flux-dev|image DuckDuckGo|gpt-4o-mini|text HuggingSpace|command-r-08-2024|text ...

For developers (want to run the tests yourself)

git clone https://github.com/maruf009sultan/g4f-working.git
cd g4f-working

Install dependencies (system + Python)

sudo apt-get install -y ffmpeg flac # macOS: brew install ffmpeg flac pip install -r requirements.txt

Run the full pipeline (starts g4f API server, fetches, tests, reports)

python provider_tester.py

Common CLI overrides

# Use a different port
python provider_tester.py --port 9000

Longer timeout for slow networks

python provider_tester.py --timeout 180

Smaller batches to be gentle on the API

python provider_tester.py --batch-size 10 --max-concurrent 25

Use an already-running g4f server elsewhere

python provider_tester.py --no-server --base-url http://10.0.0.5:8081

Custom test prompts

python provider_tester.py \ --test-message "Ping: please reply with 'pong'." \ --image-prompt "a watercolour painting of a fox" \ --audio-prompt "Hi, this is a TTS test."

๐Ÿ“‚ Repository Structure

g4f-working/
โ”œโ”€โ”€ providertester.py         # ๐Ÿšช Entry point (thin wrapper around the g4ftester package)
โ”œโ”€โ”€ g4f_tester/                # ๐Ÿ“ฆ The modular Python package (v2.0)
โ”‚   โ”œโ”€โ”€ init.py            #    Public API exports
โ”‚   โ”œโ”€โ”€ models.py              #    TestResult / TestResultWithTypes dataclasses
โ”‚   โ”œโ”€โ”€ config.py              #    Config dataclass + CLI arg parser + env-var loader
โ”‚   โ”œโ”€โ”€ server.py              #    g4f API server lifecycle + nodriver cleanup
โ”‚   โ”œโ”€โ”€ fetcher.py             #    ProviderModelFetcher โ€” discovers providers & models
โ”‚   โ”œโ”€โ”€ tester.py              #    ProviderModelTester โ€” probes text/image/audio/video
โ”‚   โ”œโ”€โ”€ media_saver.py         #    MediaSaver โ€” saves text/image/video/audio to disk
โ”‚   โ”œโ”€โ”€ reporter.py            #    TestResultsReporter โ€” writes the 4 result files
โ”‚   โ””โ”€โ”€ runner.py              #    Orchestration + main() + legacy facade class
โ”œโ”€โ”€ tests/                     # ๐Ÿงช 76 unit tests (no network needed)
โ”‚   โ”œโ”€โ”€ test_models.py
โ”‚   โ”œโ”€โ”€ test_config.py
โ”‚   โ”œโ”€โ”€ test_server.py
โ”‚   โ”œโ”€โ”€ testmediasaver.py
โ”‚   โ”œโ”€โ”€ test_fetcher.py
โ”‚   โ”œโ”€โ”€ test_tester.py
โ”‚   โ”œโ”€โ”€ test_reporter.py
โ”‚   โ”œโ”€โ”€ test_facade.py
โ”‚   โ”œโ”€โ”€ run_tests.py           #    Standalone runner (no pytest required)
โ”‚   โ”œโ”€โ”€ smoketestreal.py     #    End-to-end test against a real g4f server
โ”‚   โ””โ”€โ”€ smoke_positive.py      #    Verifies a known-working provider succeeds
โ”œโ”€โ”€ provider/                  # ๐Ÿ“ Daily output: provider/model discovery
โ”‚   โ”œโ”€โ”€ providers_models.json  #    Structured provider โ†’ models mapping
โ”‚   โ”œโ”€โ”€ providers_models.txt   #    Human-readable version of the above
โ”‚   โ””โ”€โ”€ modelsfortesting.txt #    provider|model pairs (one per line)
โ”œโ”€โ”€ working/                   # ๐Ÿ“ Daily output: test results
โ”‚   โ”œโ”€โ”€ test_results.json      #    Full structured report (summary + working + non-working)
โ”‚   โ”œโ”€โ”€ test_results.txt       #    Human-readable version of the above
โ”‚   โ”œโ”€โ”€ working_results.txt    #    provider|model|type for every working entry
โ”‚   โ””โ”€โ”€ models.txt             #    Unique model (type) lines
โ”œโ”€โ”€ output/                    # ๐Ÿ“ Daily output: raw model responses (text/image/audio/video)
โ”œโ”€โ”€ generated_media/           # ๐Ÿ“ Audio recordings from successful TTS tests
โ”œโ”€โ”€ .github/workflows/main.yml # โฐ GitHub Actions: runs daily at 06:00 UTC
โ”œโ”€โ”€ requirements.txt           # ๐Ÿ“ฆ Python dependencies
โ”œโ”€โ”€ pytest.ini                 # โš™๏ธ Pytest configuration
โ”œโ”€โ”€ LICENSE.md                 # ๐Ÿ“œ CC BY-NC 4.0
โ””โ”€โ”€ README.md                  # ๐Ÿ“˜ You are here

โš™๏ธ How It Works

flowchart LR
  A[g4f API server] --> B[Fetch providers]
  B --> C[Fetch models per provider]
  C --> D[For each provider|model pair]
  D --> E{Detect capabilities}
  E -->|text| F[Test chat/completions]
  E -->|image| G[Test images/generate]
  E -->|audio| H[Test audio/speech]
  E -->|video| I[Test video/generate]
  F --> J[Save response to output/]
  G --> J
  H --> J
  I --> J
  J --> K[Aggregate results]
  K --> L[Write working/ files]
  L --> M[Commit & push]
  M -->|daily 06:00 UTC| A
  • Scan โ€” Enumerate every provider and model from g4f.
  • Probe โ€” For each provider|model pair, send a tiny test request for each capability the model advertises (text, image, audio, video).
  • Persist โ€” Save the raw response (text file / image / audio / video) to /output/.
  • Aggregate โ€” Write workingresults.txt, models.txt, testresults.json, and test_results.txt to /working/.
  • Commit โ€” The GitHub Action commits the new files back to main.
  • Repeat โ€” The cron schedule triggers again at 06:00 UTC the next day.

๐Ÿ”ง Configuration

Every aspect of the pipeline is configurable via CLI flags, environment variables, or Python constructor args. Priority: CLI > env vars > defaults.

| Setting | CLI flag | Env var | Default | |---------------------|-----------------------|------------------------|--------------------------------------| | g4f API base URL | --base-url | G4FBASEURL | http://localhost:8081 | | g4f API key | --api-key | G4FAPIKEY | 1234 | | g4f server port | --port | G4F_PORT | 8081 | | Max concurrent reqs | --max-concurrent | G4FMAXCONCURRENT | 50 | | Per-request timeout | --timeout | G4F_TIMEOUT | 120 (seconds) | | Test batch size | --batch-size | G4FBATCHSIZE | 20 | | Provider output dir | --provider-dir | โ€” | provider | | Working output dir | --working-dir | โ€” | working | | Raw output dir | --output-dir | โ€” | output | | Skip server start | --no-server | G4FNOSERVER=1 | false (server starts) | | Text test prompt | --test-message | G4FTESTMESSAGE | Hello, are you working? ... | | Image test prompt | --image-prompt | G4FIMAGEPROMPT | a simple test image of a red apple | | Video test prompt | --video-prompt | G4FVIDEOPROMPT | a simple test video of a cat walking | | Audio test prompt | --audio-prompt | G4FAUDIOPROMPT | Hello, this is a test audio generation |

Run python provider_tester.py --help to see all options.


๐Ÿ“ฆ Using as a Python Library

The new modular design means you can reuse individual pieces in your own projects:

Run the full pipeline programmatically

import asyncio
from g4f_tester import Config, run

cfg = Config.fromenv() # reads G4F* env vars asyncio.run(run(cfg))

Fetch the current provider/model list

from g4f_tester import ProviderModelFetcher

fetcher = ProviderModelFetcher("http://localhost:8081", api_key="1234") data = fetcher.fetch() # โ†’ {"Blackbox": {"models": [...], ...}, ...}

Test a specific provider/model

import aiohttp, asyncio
from g4f_tester import ProviderModelTester

async def main(): tester = ProviderModelTester( base_url="http://localhost:8081", api_key="1234", outputdir="./myoutputs", ) async with aiohttp.ClientSession() as session: results = await tester.testprovidermodel_combination( session, "BlackForestLabs_Flux1Dev", "flux-dev" ) for r in results: print(f"{r.mediatype}: working={r.working} time={r.responsetime:.2f}s")

asyncio.run(main())

Save media responses to disk

import asyncio
from g4f_tester import MediaSaver

async def main(): saver = MediaSaver("./outputs", base_url="http://localhost:8081") # Save from a URL: await saver.saveimageurl("Prov", "model", "https://example.com/img.jpg") # Save from a base64 data URL: await saver.saveaudiodata_url("Prov", "model", "data:audio/mp3;base64,AAAA") # Save raw bytes: await saver.saveaudiobytes("Prov", "model", b"\x00\x01\x02...")

asyncio.run(main())

Backwards compatibility

Existing user scripts keep working unchanged:

# This still works exactly as before:
from provider_tester import ProviderModelFetcherAndTester

tester = ProviderModelFetcherAndTester( "http://localhost:8081", "1234", max_concurrent=50, timeout=120, ) data = tester.fetchprovidersand_models() tester.savetofiles(data) tester.createtestformat(data)

...etc


๐Ÿงช Testing

Run the unit tests (no network required)

# Option A: use the standalone runner (no pytest needed)
python tests/run_tests.py

Option B: use pytest

python -m pytest tests/ -v

Expected output:

======================================== TOTAL: 76 passed, 0 failed ========================================

The unit tests use mocks for the HTTP layer, so they're fast (~3 seconds) and don't need a real g4f server.

Run the end-to-end smoke tests (requires network + g4f installed)

# Spins up a real g4f API server, fetches providers, tests 3 pairs.
python tests/smoketestreal.py

Finds a known-working provider and verifies it actually produces output.

python tests/smoke_positive.py

What's covered

| Test file | What it verifies | |----------------------|--------------------------------------------------------------------| | testmodels.py | Dataclass defaults, responsetypes mutation safety, to_dict(). | | test_config.py | CLI parser, env-var loading, dir creation, header building. | | test_server.py | TCP-port probing, server-readiness polling, idempotent hooks. | | testmediasaver.py| Text/bytes/URL/data-URL saving, filename safety, error recovery. | | test_fetcher.py | Provider/model discovery, JSON+TXT output formats, error handling.| | test_tester.py | Streaming responses, payload-isolation bugfix, endpoint fallback. | | test_reporter.py | All 4 output files, deduplication, empty-result handling. | | test_facade.py | Backwards-compatible API surface for legacy users. |


๐Ÿ“Š Output File Formats

โš ๏ธ These formats are part of the public contract. Many users fetch them via raw.githubusercontent.com URLs โ€” do not change them without bumping the major version.

working/models.txt

Plain list of working models (deduplicated), one per line, in the format model (type):

gpt-4o-mini (text)
flux-dev (image)
tts-1 (audio)
sora-2 (video)

working/working_results.txt

One line per working provider|model|type triple:

Blackbox|gpt-4o-mini|text
BlackForestLabs_Flux1Dev|flux-dev|image
Openai|tts-1|audio

working/test_results.json

Structured report with summary, working models (with response previews), and non-working models (with errors). Suitable for programmatic consumption.

working/test_results.txt

Human-readable summary: total tested, working count, success rate, average response time, response-type breakdown, working models grouped by type, and a list of non-working models with their errors.

provider/providers_models.json + .txt

Full provider โ†’ models mapping. The JSON is the canonical structured form; the TXT is a pretty-printed human-readable version.

provider/modelsfortesting.txt

All provider|model pairs, one per line, prefixed by a # Format: comment. Used by external automation tools to know what was tested.

output/<Provider><Model>*.{txt,jpg,mp3,mp4}

Raw responses from each test. Filenames are constructed by replacing / and \ in the model name with , then appending response.txt, imageN.jpg, audio.mp3, or video.mp4.


๐Ÿค Contributing

Pull requests, issues, and suggestions are welcome! Please:

  • ๐Ÿด Fork the repo and create a feature branch.
  • โœ… Run python tests/run_tests.py before submitting โ€” all 76 tests must pass.
  • ๐Ÿ“ Update the relevant section of this README if you change user-facing behaviour.
  • ๐ŸŽฏ Keep output file formats backwards-compatible (or bump the major version if you must break them).
  • ๐Ÿ“œ Check LICENSE.md before contributing โ€” this project is CC BY-NC 4.0 (non-commercial).

Local development tips

# Run a single test file:
python tests/runtests.py models          # tests/testmodels.py

Run with verbose pytest output:

python -m pytest tests/test_tester.py -v

Quick syntax check on all modules:

python -c "import ast, os; [ast.parse(open(os.path.join(r,f)).read()) for r,,fs in os.walk('g4ftester') for f in fs if f.endswith('.py')]; print('All OK')"

โ“ FAQ

Q: Do I need to run any code to use this?

No! Just fetch the result files:

curl -sL https://raw.githubusercontent.com/maruf009sultan/g4f-working/refs/heads/main/working/models.txt

The Python code only runs in GitHub Actions to produce those files.

Q: What does "no-auth" mean?

A provider/model is "no-auth" if it works without any of:

  • API keys
  • Login tokens
  • Browser cookies
  • OAuth credentials
We test each provider|model pair by sending a real request with no credentials. If it returns a valid response, it goes in the working list.

Q: Why do some result files contain <audio> tags?

Some providers return their text response with embedded media tags. For example:

<audio controls src="/media/1754290396_gpt-4o-mini-audio-preview.mp3"></audio>

The .txt result file is always plain text, but it may contain HTML or markdown that links to actual media. Treat the files as plain text but expect rich media inside.

Q: What's the difference between models.txt and working_results.txt?

  • models.txt: deduplicated list of model names + types (no provider info).
  • working_results.txt: every working provider|model|type triple (provider info included, may have duplicates if multiple providers serve the same model).

Q: How often are results updated?

Daily at 06:00 UTC, via the GitHub Actions cron schedule in .github/workflows/main.yml. You can also trigger a run manually from the Actions tab.

Q: Can I use the code in my own project?

Yes โ€” see ๐Ÿ“ฆ Using as a Python Library above. The package is designed to be imported and reused.

Note the license, though: CC BY-NC 4.0 means non-commercial use only.

Q: I found a bug or have a feature idea. Where do I go?

๐ŸŽ‰ Please open an issue or submit a pull request. See ๐Ÿค Contributing for guidelines.

Q: Will my existing automation break if I upgrade to v2.0?

No. All output file names, formats, and contents are 100% backwards-compatible. The legacy ProviderModelFetcherAndTester class is also re-exported from providertester.py, so even scripts that from providertester import ProviderModelFetcherAndTester keep working unchanged.


๐Ÿ“œ License

This project is licensed under Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) โ€” see LICENSE.md.

In plain English:

  • โœ… Share and adapt the code
  • โœ… Use it for personal and academic projects
  • โŒ No commercial use without permission
  • โœ… Attribution required

๐ŸŒ Links


๐ŸŒŸ Found this useful? Star the repo to help others discover it!

g4f-working โ€” the fastest way to know which GPT4Free providers/models work right now, with NO API keys, ever.

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท Free-AI-Things/g4f-working ยท Updated daily from GitHub