# xtekky/gpt4free

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/xtekky-gpt4free).**

66,335 stars · 13,574 forks · Python · GPL-3.0

## Links

- GitHub: https://github.com/xtekky/gpt4free
- Homepage: https://t.me/g4f_channel
- awesome-repositories: https://awesome-repositories.com/repository/xtekky-gpt4free.md

## Topics

`chatbot` `chatbots` `chatgpt` `chatgpt-4` `chatgpt-api` `chatgpt-free` `chatgpt4` `deepseek` `deepseek-api` `deepseek-r1` `gpt` `gpt-4` `gpt-4o` `gpt4` `gpt4-api` `language-model` `openai` `openai-api` `openai-chatgpt` `reverse-engineering`

## Description

This project provides a unified interface for interacting with a wide range of artificial intelligence services, acting as a central orchestration layer for text and image generation. It standardizes access to diverse AI backends, allowing developers to integrate multiple language and vision models through a single, consistent programming interface. By abstracting provider-specific protocols and authentication requirements, the tool simplifies the development of applications that rely on external AI services.

The platform distinguishes itself through a resilient request routing architecture designed to maintain service availability. It features an automated failover mechanism that monitors request status and dynamically switches between secondary providers when primary endpoints encounter errors or rate limits. This capability is complemented by support for both remote API interactions and local model execution, enabling users to run language models directly on their own hardware infrastructure.

Beyond core connectivity, the system includes advanced tools for managing complex conversational states and real-time data retrieval. It supports sequential message history to maintain context across long sessions and integrates live web search capabilities to provide up-to-date information. The client also handles multimodal inputs, allowing for the processing of visual content and the generation of images from text descriptions through asynchronous, non-blocking communication patterns.

## Tags

### Artificial Intelligence & ML

- [Language Model Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/artificial-intelligence-tooling/language-model-integrations.md) — Aggregates numerous artificial intelligence services into a single, consistent programming interface for text and image generation.
- [Model Request Orchestrators](https://awesome-repositories.com/f/artificial-intelligence-ml/artificial-intelligence-tooling/language-model-integrations/model-orchestration-management/model-request-orchestrators.md) — Coordinates conversation history and asynchronous communication across a diverse array of local and remote artificial intelligence backends.
- [Model Provider Adapters](https://awesome-repositories.com/f/artificial-intelligence-ml/artificial-intelligence-tooling/language-model-integrations/model-provider-adapters.md) — Normalizes requests and responses across different model providers to enable consistent text completion within applications. ([source](https://g4f.dev/docs/providers-and-models.html))
- [Conversation Management](https://awesome-repositories.com/f/artificial-intelligence-ml/language-model-orchestration/conversation-management.md) — Tracks sequential message history to facilitate coherent, multi-turn interactions across various language models.
- [AI Request Routers](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-inference-serving/request-routing-gateways/ai-request-routers.md) — Routes incoming requests through a unified interface that dynamically selects and cycles between multiple third-party service providers.
- [Failover Strategies](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-inference-serving/request-routing-gateways/failover-strategies.md) — Implements automated request routing to alternative service providers, ensuring continuous availability when primary endpoints encounter failures or limitations. ([source](https://g4f.dev/docs/async_client))
- [Multimodal AI Applications](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/multimodal-processing-tools/multimodal-ai-applications.md) — Supports applications that process both text and visual inputs to generate comprehensive responses or create new imagery.
- [Asynchronous Chat Completions](https://awesome-repositories.com/f/artificial-intelligence-ml/language-model-orchestration/language-model-interaction-patterns/asynchronous-chat-completions.md) — Enables non-blocking message processing and streaming responses from various artificial intelligence models through a unified interface. ([source](https://g4f.dev/docs/async_client))
- [Model Inference and Serving](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-inference-serving.md) — Facilitates local execution of language models by interfacing directly with hardware runtimes to bypass external network dependencies.
- [Web Browsing Tools](https://awesome-repositories.com/f/artificial-intelligence-ml/artificial-intelligence-tooling/agent-and-tool-integrations/web-browsing-tools.md) — Grants autonomous agents the ability to perform live web searches and retrieve real-time data. ([source](https://g4f.dev/docs/async_client))
- [Conversation History Managers](https://awesome-repositories.com/f/artificial-intelligence-ml/artificial-intelligence-tooling/language-model-integrations/conversation-history-managers.md) — Maintains and sequences message history to ensure models retain context throughout stateful user interactions. ([source](https://g4f.dev/docs/async_client))
- [Synchronous Text Completion](https://awesome-repositories.com/f/artificial-intelligence-ml/artificial-intelligence-tooling/language-model-integrations/synchronous-text-completion.md) — Sends message history to models to receive incremental text responses while manually managing conversation state for ongoing dialogue. ([source](https://g4f.dev/docs/client))
- [Multimodal Reasoning Tasks](https://awesome-repositories.com/f/artificial-intelligence-ml/artificial-intelligence-tooling/multimodal-reasoning-tasks.md) — Processes images by sending them to vision-capable models to generate descriptive text summaries or detailed analysis based on visual content. ([source](https://g4f.dev/docs/client))
- [Conversation State Management](https://awesome-repositories.com/f/artificial-intelligence-ml/conversation-state-management.md) — Preserves a local state of conversation history to ensure consistent dialogue flow when interacting with stateless model endpoints.
- [Image Generation Services](https://awesome-repositories.com/f/artificial-intelligence-ml/artificial-intelligence-tooling/multimodal-reasoning-tasks/image-generation-services.md) — Creates images from text descriptions and returns results in various formats including local file paths, web links, or encoded data. ([source](https://g4f.dev/docs/client))

### DevOps & Infrastructure

- [Automated Failover Mechanisms](https://awesome-repositories.com/f/devops-infrastructure/devops/operational-reliability/automated-failover-mechanisms.md) — Monitors request success and automatically redirects traffic to alternative service providers when primary endpoints encounter errors or rate limits.
- [Request Retries](https://awesome-repositories.com/f/devops-infrastructure/api-service-management/api-resilience/request-retries.md) — Ensures application stability by automatically retrying failed requests and switching between different service providers to maintain continuous availability.

### Networking & Communication

- [Asynchronous Client Orchestrators](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/network-orchestration/asynchronous-client-orchestrators.md) — Handles non-blocking network requests to manage concurrent streaming responses across multiple external artificial intelligence services.
- [Failover Proxies](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/network-proxying-tools/network-proxies/failover-proxies.md) — Provides a resilient routing layer that automatically cycles through secondary service providers to maintain uptime during endpoint failures.

### Part of an Awesome List

- [Infrastructure and Utilities](https://awesome-repositories.com/f/awesome-lists/ai/infrastructure-and-utilities.md) — Provides access to third-party AI APIs via reverse engineering.
- [More to explore](https://awesome-repositories.com/f/awesome-lists/ai/more-to-explore.md) — Provides access to various language model APIs.

### Software Engineering & Architecture

- [Automated Retry Strategies](https://awesome-repositories.com/f/software-engineering-architecture/performance-reliability/reliability-patterns/automated-retry-strategies.md) — Executes automated retry logic and error management to resolve transient network failures and maintain performance during external service communication. ([source](https://g4f.dev/docs/async_client))
