{"id":23128450,"url":"https://github.com/tctien342/chatgpt-proxy","last_synced_at":"2026-05-01T09:31:29.420Z","repository":{"id":234152280,"uuid":"788353462","full_name":"tctien342/chatgpt-proxy","owner":"tctien342","description":"This project serves as a proxy for the OpenAI API. Using bun as runtime.","archived":false,"fork":false,"pushed_at":"2024-05-02T08:41:01.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T06:12:38.636Z","etag":null,"topics":["chatgpt-api","openai","openai-proxy"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tctien342.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-18T08:51:22.000Z","updated_at":"2024-05-02T08:41:05.000Z","dependencies_parsed_at":"2024-05-02T08:40:33.426Z","dependency_job_id":null,"html_url":"https://github.com/tctien342/chatgpt-proxy","commit_stats":null,"previous_names":["tctien342/chatgpt-proxy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tctien342/chatgpt-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tctien342%2Fchatgpt-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tctien342%2Fchatgpt-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tctien342%2Fchatgpt-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tctien342%2Fchatgpt-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tctien342","download_url":"https://codeload.github.com/tctien342/chatgpt-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tctien342%2Fchatgpt-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32492100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt-api","openai","openai-proxy"],"created_at":"2024-12-17T09:26:52.358Z","updated_at":"2026-05-01T09:31:29.402Z","avatar_url":"https://github.com/tctien342.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAI Proxy\n\nThis project serves as a proxy for the OpenAI API. Using `bun` as runtime.\n\n## Getting Started\n\nTo get started with this project, you'll need to install the necessary dependencies. You can do this by running:\n\n```sh\nbun install\n```\n\n## Development\n\nTo start the development server, run:\n\n```sh\nbun dev\n```\n\nThis will start the server and watch for changes in the [`src/index.ts`](\"src/index.ts\") file.\n\n## Docker Compose\n\nThis project includes a `docker-compose.yml` file for running the application in a Docker container. This can be useful for development and testing, as well as for deploying the application in a production environment.\n\nTo use Docker Compose, you'll first need to install Docker and Docker Compose on your machine. Once you've done that, you can start the application with the following command:\n\n```sh\ndocker-compose up\n```\n\nThis will build the Docker image for the application (if it hasn't been built already) and start a new container. The application will be accessible at `http://localhost:3000`.\n\n## Environment Variables\n\nThis project uses environment variables for configuration. These are stored in the [`.env`](\".env\") file. You'll need to provide your own `API_TOKEN` in this file.\n\nIn the Docker environment, these variables are set in the `docker-compose.yml` file:\n\n```yml\nversion: \"3\"\nservices:\n  openai-proxy:\n    build: .\n    container_name: openai-proxy\n    restart: always\n    ports:\n      - \"3000:3000\"\n    environment:\n      - API_TOKEN=sk-1234567890abcdef\n      - AGENT_ROLL_INTERVAL=60000\n```\n\nPlease replace `sk-1234567890abcdef` with your middleware API token. Default will be a random token each time container started if `API_TOKEN` empty.\n\n## Code Structure\n\nThe main entry point for the application is [`src/index.ts`](\"src/index.ts\"). This project also includes several utility functions and classes:\n\n- [`src/openai.ts`](\"src/openai.ts\"): Contains various utility functions for interacting with the OpenAI API.\n- [`src/fetch.ts`](\"src/fetch.ts\"): Defines the `Fetcher` class for making HTTP requests.\n- [`src/agent.ts`](\"src/agent.ts\"): Defines the `AgentManager` class for managing user agents.\n- [`src/tools.ts`](\"src/tools.ts\"): Contains the `AppLogger` class for logging.\n\n## Testing\n\nCurrently, this project does not have any tests defined.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a pull request.\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n\n## Acknowledgements\n\nSpecial thanks to @PawanOsman for his [wonderful project](https://github.com/PawanOsman/ChatGPT), which served as inspiration for this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftctien342%2Fchatgpt-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftctien342%2Fchatgpt-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftctien342%2Fchatgpt-proxy/lists"}