# chatanywhere/gpt_api_free architecture

> Architecture diagram of the GitHub repository chatanywhere/gpt_api_free, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chatanywhere/gpt_api_free
- Repository: https://github.com/chatanywhere/gpt_api_free

## Overview

This repository is a collection of Python examples for using ChatAnywhere’s hosted, OpenAI-compatible API; it does not contain the proxy service itself. The examples cover text and multimodal chat, response APIs, image generation/editing, and audio transcription/speech. Source excerpts were unavailable, so the diagram does not assert call relationships between individual demos and the remote service; dashed links indicate that their runtime use is inferred from their purpose and the README’s API description.

Main entry points: [`demo/openai_chat_completion_demo.py`](https://github.com/chatanywhere/gpt_api_free/blob/main/demo/openai_chat_completion_demo.py) (Chat completion), [`demo/openai_chat_completion_picture_demo.py`](https://github.com/chatanywhere/gpt_api_free/blob/main/demo/openai_chat_completion_picture_demo.py) (Picture chat), [`demo/openai_chat_completion_audio_demo.py`](https://github.com/chatanywhere/gpt_api_free/blob/main/demo/openai_chat_completion_audio_demo.py) (Audio chat), [`demo/openai_response_demo.py`](https://github.com/chatanywhere/gpt_api_free/blob/main/demo/openai_response_demo.py) (Responses API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chat["Chat examples"]
  node_text_chat["Chat completion"]
  node_image_chat["Picture chat"]
  node_audio_chat["Audio chat"]
  node_responses["Responses API"]
end

subgraph group_media["Image examples"]
  node_image_gen["Image generation"]
  node_image_edit["Image editing"]
end

subgraph group_audio["Audio examples"]
  node_transcription["Transcription"]
  node_speech["Audio speech"]
end

node_user(("API user"))
node_api{{"ChatAnywhere API"}}

node_user -.->|"runs example"| node_text_chat
node_user -.->|"runs example"| node_image_chat
node_user -.->|"runs example"| node_audio_chat
node_user -.->|"runs example"| node_responses
node_user -.->|"runs example"| node_image_gen
node_user -.->|"runs example"| node_image_edit
node_user -.->|"runs example"| node_transcription
node_user -.->|"runs example"| node_speech
node_text_chat -.->|"calls API"| node_api
node_image_chat -.->|"calls API"| node_api
node_audio_chat -.->|"calls API"| node_api
node_responses -.->|"calls API"| node_api
node_image_gen -.->|"calls API"| node_api
node_image_edit -.->|"calls API"| node_api
node_transcription -.->|"calls API"| node_api
node_speech -.->|"calls API"| node_api

click node_text_chat "https://github.com/chatanywhere/gpt_api_free/blob/main/demo/openai_chat_completion_demo.py"
click node_image_chat "https://github.com/chatanywhere/gpt_api_free/blob/main/demo/openai_chat_completion_picture_demo.py"
click node_audio_chat "https://github.com/chatanywhere/gpt_api_free/blob/main/demo/openai_chat_completion_audio_demo.py"
click node_responses "https://github.com/chatanywhere/gpt_api_free/blob/main/demo/openai_response_demo.py"
click node_image_gen "https://github.com/chatanywhere/gpt_api_free/blob/main/demo/gpt_image_1_gen_demo.py"
click node_image_edit "https://github.com/chatanywhere/gpt_api_free/blob/main/demo/gpt_image_1_edit_demo.py"
click node_transcription "https://github.com/chatanywhere/gpt_api_free/blob/main/demo/transcriptions_demo.py"
click node_speech "https://github.com/chatanywhere/gpt_api_free/blob/main/demo/audio_speech_demo.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_text_chat,node_image_chat,node_audio_chat,node_responses,node_user toneBlue
class node_image_gen,node_image_edit toneAmber
class node_transcription,node_speech,node_api toneMint
```

## Components

### Chat examples

- [Chat completion](https://github.com/chatanywhere/gpt_api_free/blob/main/demo/openai_chat_completion_demo.py): `demo/openai_chat_completion_demo.py`
- [Picture chat](https://github.com/chatanywhere/gpt_api_free/blob/main/demo/openai_chat_completion_picture_demo.py): `demo/openai_chat_completion_picture_demo.py`
- [Audio chat](https://github.com/chatanywhere/gpt_api_free/blob/main/demo/openai_chat_completion_audio_demo.py): `demo/openai_chat_completion_audio_demo.py`
- [Responses API](https://github.com/chatanywhere/gpt_api_free/blob/main/demo/openai_response_demo.py): `demo/openai_response_demo.py`

### Image examples

- [Image generation](https://github.com/chatanywhere/gpt_api_free/blob/main/demo/gpt_image_1_gen_demo.py): `demo/gpt_image_1_gen_demo.py`
- [Image editing](https://github.com/chatanywhere/gpt_api_free/blob/main/demo/gpt_image_1_edit_demo.py): `demo/gpt_image_1_edit_demo.py`

### Audio examples

- [Transcription](https://github.com/chatanywhere/gpt_api_free/blob/main/demo/transcriptions_demo.py): `demo/transcriptions_demo.py`
- [Audio speech](https://github.com/chatanywhere/gpt_api_free/blob/main/demo/audio_speech_demo.py): `demo/audio_speech_demo.py`

### Other components

- **API user**
- **ChatAnywhere API**

## Connections

- API user → Chat completion: runs example
- API user → Picture chat: runs example
- API user → Audio chat: runs example
- API user → Responses API: runs example
- API user → Image generation: runs example
- API user → Image editing: runs example
- API user → Transcription: runs example
- API user → Audio speech: runs example
- Chat completion → ChatAnywhere API: calls API
- Picture chat → ChatAnywhere API: calls API
- Audio chat → ChatAnywhere API: calls API
- Responses API → ChatAnywhere API: calls API
- Image generation → ChatAnywhere API: calls API
- Image editing → ChatAnywhere API: calls API
- Transcription → ChatAnywhere API: calls API
- Audio speech → ChatAnywhere API: calls API
