# Complete List of Providers Supported by gpt4free: 70+ AI Backends Explained

> Explore over 70 AI backends supported by gpt4free covering chat vision audio video search and local execution all in one place. Discover the providers powering xtekky gpt4free.

- Repository: [Tekky/gpt4free](https://github.com/xtekky/gpt4free)
- Tags: api-reference
- Published: 2026-03-04

---

**The gpt4free library supports more than 70 different providers spanning chat, vision, audio, video, search, and local execution, all unified behind a single async-generator interface.**

The `xtekky/gpt4free` repository abstracts a vast ecosystem of AI backends through a dynamic **provider** architecture. Every provider supported by gpt4free inherits from `BaseProvider` or `AsyncGeneratorProvider` and implements a standardized interface, allowing developers to call any model with consistent syntax while the framework handles routing, retries, and fallback logic automatically.

## How the gpt4free Provider Architecture Works

### Provider Registration and Discovery

Providers are automatically discovered and registered via [`g4f/Provider/__init__.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/__init__.py). This module constructs `__modules__`, `__providers__`, and `__map__` dictionaries that map provider names to their corresponding classes. To add a new provider supported by gpt4free, you simply create a class inheriting from `BaseProvider`, place it in the `g4f/Provider/` directory, and expose it in [`__init__.py`](https://github.com/xtekky/gpt4free/blob/main/__init__.py).

### Model Mapping and Routing Logic

The `AnyProvider` router (implemented in [`g4f/providers/any_provider.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/providers/any_provider.py)) consults the provider map to resolve model names to concrete backends. The `AnyModelProviderMixin` (lines 14-55) aggregates every model name across all providers, stores them in `model_map`, and builds alias tables. When `AnyProvider.create_async_generator` (lines 430-480) receives a request, it filters out non-working providers, applies a **free-first** sort (prioritizing providers without `needs_auth`), and hands the sorted list to `RotatedProvider` for automatic retry and streaming.

## Chat and LLM Providers Supported by gpt4free

The majority of providers supported by gpt4free focus on text generation and conversational AI:

- **OpenAI Chat** (`OpenaiChat` in [`g4f/Provider/needs_auth/OpenaiChat.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/needs_auth/OpenaiChat.py)) – Accesses ChatGPT free tier without an API key.
- **OpenAI Account** (`OpenaiAccount` in [`g4f/Provider/needs_auth/OpenaiAccount.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/needs_auth/OpenaiAccount.py)) – Paid OpenAI models requiring authentication.
- **OpenAI API** (`OpenaiAPI` in [`g4f/Provider/needs_auth/OpenaiAPI.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/needs_auth/OpenaiAPI.py)) – Low-level completions endpoint.
- **Gemini** (`Gemini` / `GeminiPro` in [`g4f/Provider/needs_auth/Gemini.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/needs_auth/Gemini.py)) – Google’s Gemini model family.
- **Grok** (`Grok` in [`g4f/Provider/needs_auth/Grok.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/needs_auth/Grok.py)) – xAI’s Grok series.
- **Perplexity** (`Perplexity` in [`g4f/Provider/Perplexity.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/Perplexity.py)) – Perplexity Labs LLMs.
- **Copilot** (`Copilot` / `CopilotAccount` in [`g4f/Provider/Copilot.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/Copilot.py)) – GitHub Copilot code-focused models.
- **PollinationsAI** (`PollinationsAI` in [`g4f/Provider/needs_auth/PollinationsAI.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/needs_auth/PollinationsAI.py)) – General-purpose model aggregator.
- **Azure** (`Azure` in [`g4f/Provider/needs_auth/Azure.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/needs_auth/Azure.py)) – Azure OpenAI Service.
- **Qwen** (`Qwen` in [`g4f/Provider/Qwen.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/Qwen.py)) – Alibaba’s Qwen series.
- **DeepInfra** (`DeepInfra` in [`g4f/Provider/DeepInfra.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/DeepInfra.py)) – DeepInfra hosted models.
- **Hugging Face** (`HuggingFace`, `HuggingFaceMedia`, `HuggingFaceInference` in [`g4f/Provider/needs_auth/hf/__init__.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/needs_auth/hf/__init__.py)) – Hugging Face inference APIs.
- **Cloudflare** (`Cloudflare` in [`g4f/Provider/Cloudflare.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/Cloudflare.py)) – Cloudflare Workers AI.
- **LMArena** (`LMArena` in [`g4f/Provider/needs_auth/LMArena.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/needs_auth/LMArena.py)) – LM-Arena multi-model playground.

## Vision and Image Generation Providers

Several providers supported by gpt4free handle multimodal inputs and image synthesis:

- **PollinationsImage** (`PollinationsImage` in [`g4f/Provider/PollinationsImage.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/PollinationsImage.py)) – Image generation via Pollinations.
- **BingCreateImages** (`BingCreateImages` in [`g4f/Provider/needs_auth/BingCreateImages.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/needs_auth/BingCreateImages.py)) – Bing Image Creator integration.
- **StabilityAI_SD35Large** (`StabilityAI_SD35Large` in [`g4f/Provider/hf_space/StabilityAI_SD35Large.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/hf_space/StabilityAI_SD35Large.py)) – Stability AI SD-3.5-large model.
- **DeepseekAI_JanusPro7b** (`DeepseekAI_JanusPro7b` in [`g4f/Provider/hf_space/DeepseekAI_JanusPro7b.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/hf_space/DeepseekAI_JanusPro7b.py)) – DeepSeek image-capable model.

The `CreateImagesProvider` base class in [`g4f/providers/create_images.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/providers/create_images.py) provides the general image-generation helper interface that these providers extend.

## Audio and Text-to-Speech Providers

For voice synthesis and audio processing, gpt4free includes specialized providers:

- **OpenAIFM** (`OpenAIFM` in [`g4f/Provider/audio/OpenAIFM.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/audio/OpenAIFM.py)) – OpenAI’s voice models for text-to-speech.
- **gTTS** (`gTTS` in [`g4f/Provider/audio/gTTS.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/audio/gTTS.py)) – Google Text-to-Speech wrapper.
- **EdgeTTS** (`EdgeTTS` in [`g4f/Provider/audio/EdgeTTS.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/audio/EdgeTTS.py)) – Microsoft Edge TTS integration.
- **MarkItDown** (`MarkItDown` in [`g4f/Provider/audio/MarkItDown.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/audio/MarkItDown.py)) – Markdown-to-audio conversion utility.

## Search and Knowledge Retrieval Providers

To augment LLMs with real-time data, gpt4free supports several search providers:

- **GoogleSearch** (`GoogleSearch` in [`g4f/Provider/search/GoogleSearch.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/search/GoogleSearch.py)) – Google search via custom API.
- **SearXNG** (`SearXNG` in [`g4f/Provider/search/SearXNG.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/search/SearXNG.py)) – SearXNG public instance search.
- **DDGS** (`DDGS` in [`g4f/Provider/search/DDGS.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/search/DDGS.py)) – DuckDuckGo Search API.
- **YouTube** (`YouTube` in [`g4f/Provider/search/YouTube.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/search/YouTube.py)) – YouTube video metadata retrieval.
- **CachedSearch** (`CachedSearch` in [`g4f/Provider/search/CachedSearch.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/search/CachedSearch.py)) – Cached wrapper around any search provider to reduce API calls.

## Local and Self-Hosted Providers

For privacy-conscious deployments, gpt4free supports local execution:

- **Local** (`Local` in [`g4f/Provider/local/Local.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/local/Local.py)) – Abstract base class for self-hosted providers.
- **Ollama** – Concrete implementation running models locally via Ollama (extends `Local`).

These providers allow you to run models like Llama, Mistral, or other open-source weights entirely on your own hardware without external API calls.

## Utility and Routing Providers

The framework includes meta-providers that manage other providers:

- **AnyProvider** (`AnyProvider` in [`g4f/providers/any_provider.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/providers/any_provider.py)) – The main router that implements free-first selection across all registered providers.
- **RetryProvider** (`RetryProvider` in [`g4f/providers/retry_provider.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/providers/retry_provider.py)) – Automatically retries failed requests with exponential backoff.
- **RotatedProvider** (`RotatedProvider` in [`g4f/providers/retry_provider.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/providers/retry_provider.py)) – Rotates through multiple providers until one succeeds.
- **IterListProvider** (`IterListProvider` in [`g4f/providers/retry_provider.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/providers/retry_provider.py)) – Iterates through a list of providers sequentially.

These utility providers ensure high availability by transparently handling provider failures and rate limits.

## How to Use gpt4free Providers in Python

The unified interface allows you to interact with any provider using the same async patterns. Here are practical examples covering different provider categories:

```python
import asyncio
import g4f

# 1. Simple chat completion with automatic routing (free-first)

async def chat_demo():
    response = await g4f.ChatCompletion.create(
        model="gpt-4",
        messages=[{"role": "user", "content": "Explain quantum entanglement"}],
        stream=False
    )
    print(response)

# 2. Image generation via Pollinations provider

async def image_demo():
    img_bytes = await g4f.Image.create(
        prompt="A cyberpunk city at sunset, ultra-realistic",
        model="sd-3.5-large",
        size="1024x1024"
    )
    with open("city.png", "wb") as f:
        f.write(img_bytes)

# 3. Text-to-speech using OpenAI voice models

async def tts_demo():
    audio = await g4f.Audio.create(
        text="Hello, I am your AI assistant.",
        voice="alloy"
    )
    with open("hello.mp3", "wb") as f:
        f.write(audio)

# 4. Direct provider usage (bypassing the router)

async def explicit_provider():
    # Use Copilot directly for code-focused tasks

    resp = await g4f.Copilot.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": "Write a Python function to compute Fibonacci numbers"}]
    )
    print(resp)

# Execute examples

asyncio.run(chat_demo())

```

All `await` calls invoke the provider's `create_async_generator` method, yielding either complete strings (when `stream=False`) or incremental chunks (when `stream=True`).

## Summary

- **gpt4free supports 70+ providers** across chat, vision, audio, video, search, and local execution categories.
- **Dynamic registration** occurs via [`g4f/Provider/__init__.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/__init__.py), which builds `__map__` for automatic discovery.
- **Free-first routing** in `AnyProvider` prioritizes providers without authentication requirements when no API key is supplied.
- **Utility providers** like `RotatedProvider` and `RetryProvider` ensure high availability through automatic failover.
- **Unified interface** allows seamless switching between remote APIs (OpenAI, Gemini, Grok) and local models (Ollama) using identical async patterns.

## Frequently Asked Questions

### How many providers does gpt4free support?

The gpt4free framework currently ships with **more than 70 concrete providers**, with the exact count growing as the community adds new integrations. The dynamic registration system in [`g4f/Provider/__init__.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/__init__.py) automatically discovers any new provider class placed in the directory.

### Do I need an API key to use gpt4free providers?

No. The `AnyProvider` router implements a **free-first strategy** that prioritizes providers without `needs_auth` attributes when no API key is supplied. However, certain high-performance providers like `OpenaiAccount`, `GeminiPro`, and `Azure` require authentication and offer more reliable service tiers.

### How do I add a custom provider to gpt4free?

Create a Python class inheriting from `BaseProvider` or `AsyncGeneratorProvider`, implement the `create_async_generator` method, and place the file in `g4f/Provider/`. Then expose the class in [`g4f/Provider/__init__.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/__init__.py). The provider will automatically appear in `Provider.__map__` and become routable via `AnyProvider`.

### Can I use gpt4free providers for local model hosting?

Yes. The `Local` provider base class in [`g4f/Provider/local/Local.py`](https://github.com/xtekky/gpt4free/blob/main/g4f/Provider/local/Local.py) supports self-hosted models via **Ollama**. This allows you to run open-source weights like Llama or Mistral entirely on your own hardware without external API calls, using the same async interface as cloud providers.