{"id":18144792,"url":"https://github.com/armandris/gpt-broker","last_synced_at":"2026-04-09T07:06:27.057Z","repository":{"id":260544047,"uuid":"834750231","full_name":"ArmanDris/gpt-broker","owner":"ArmanDris","description":"Keeps your OpenAi token safe and your frontend GPT'ed.","archived":false,"fork":false,"pushed_at":"2025-02-08T11:27:46.000Z","size":130,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T12:20:17.584Z","etag":null,"topics":["authentication","docker","jwt","koa","microservice","openai","prometheus","rate-limiting","rest-api","security","supabase"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArmanDris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-07-28T08:43:52.000Z","updated_at":"2025-02-08T11:27:50.000Z","dependencies_parsed_at":"2024-12-20T07:43:06.012Z","dependency_job_id":"fd42ebbc-3e0d-4787-a602-04f7b4105670","html_url":"https://github.com/ArmanDris/gpt-broker","commit_stats":{"total_commits":30,"total_committers":1,"mean_commits":30.0,"dds":0.0,"last_synced_commit":"27b32be9bebe51df5261006b9ddfb9fb7d1e581c"},"previous_names":["armandris/gpt-broker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArmanDris%2Fgpt-broker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArmanDris%2Fgpt-broker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArmanDris%2Fgpt-broker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArmanDris%2Fgpt-broker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArmanDris","download_url":"https://codeload.github.com/ArmanDris/gpt-broker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543779,"owners_count":20955893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["authentication","docker","jwt","koa","microservice","openai","prometheus","rate-limiting","rest-api","security","supabase"],"created_at":"2024-11-01T20:06:11.047Z","updated_at":"2025-12-30T23:06:19.296Z","avatar_url":"https://github.com/ArmanDris.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GPT Broker 💼\n\nGPT Broker keeps your OpenAI token out of frontend code and ensures only authenticated users access sensitive endpoints.\n\nFor Prometheus integration a /metrics endpoint with basic traffic information is exposed. Make sure public requests are denied from accessing it.\n\n## Endpoints:\n\n### /stream\n```sh\n# Streams a chat completion back to the user as it arrives\n\n# Method:\nPOST\n\n# Request Header:\nAuthorization: Bearer \u003csupabase-access-token\u003e\n\n# Request Body:\n{\n    \"messages\": \u003cstring_to_query_4o_with\u003e, # eg. `[ { \"role\": \"system\", \"content\": \"Write me a poem\" }, ... ]`\n    \"temperature\": \u003cfloat_between_0_and_1\u003e,\n    \"model\": \u003cgpt_model_to_use\u003e # either \"gpt-4o\" or \"gpt-4o-mini\"\n}\n```\n\n### /gpt-4o\n```sh\n# Simple endpoint for 4o, supports temperature.\n\n# Method:\nPOST\n\n# Request Header:\nAuthorization: Bearer \u003csupabase-access-token\u003e\n\n# Request Body:\n{\n    \"messages\": \u003cstring_to_query_4o_with\u003e,\n    \"temperature\": \u003cfloat_between_0_and_1\u003e\n}\n```\n\n### /v2/advanced-gpt-4o-mini-complete\n```sh\n# v2 has small syntax tweaks and lets the caller specify a temperature to pass to gpt\n\n# Method:\nPOST\n\n# Request Header:\nAuthorization: Bearer \u003csupabase-access-token\u003e\n\n# Request Body:\n{\n    \"messages\": \u003cmessage_array_for_gpt\u003e, # eg. `[ { \"role\": \"system\", \"content\": \"Write me a poem\" }, ... ]`\n    \"temperature\": \u003cfloat_between_0_and_1\u003e\n}\n```\n\n### /advanced-gpt-4o-mini-complete\n```sh\n# More complicated but allows full control over the prompts passed to ChatGPT.\n# Does not support temperature, for that look for the v2 version of this endpoint.\n\n# Method:\nPOST\n\n# Request Header:\nAuthorization: Bearer \u003csupabase-access-token\u003e\n\n# Request Body:\n{\n    \"messages\": \u003cmessage_array_for_gpt\u003e, # eg. `[ { \"role\": \"system\", \"content\": \"Write me a poem\" }, ... ]`\n}\n```\n\n### /simple-gpt-4o-mini-complete\n```sh\n# For simple requests that fit in a query param.\n\n# Method:\nGET\n\n# Request Parameters:\nprompt=\u003cquery_for_chat_gpt\u003e # eg. \"Write me a poem\"\n\n# Request Header: \nAuthorization: Bearer \u003csupabase-access-token\u003e\n```\n\n### /metrics\n```sh\n# Method:\nGET\n```\n\n## Setup:\n\nPlace two .env files in the root directory of this project. The first should have the information for the \n**SkillSyncDev** supabase project and it should have the name `.env.sksndev`. The second should have the \ninformation for the **techskillsync** supabase project and it should have the name `.env.techsksn`.\n\nBoth .env files should have the following fields:\n```\nOPENAI_API_KEY=your-openai-api-key-here\nSUPABASE_URL=your-supabase-url-here\nSUPABASE_SERVICE_KEY=your-supabase-service-key-here\nREDIS_URL=redis://:@redis-stack:6379\nDAILY_LIMIT=50\nID_WHITE_LIST=[]\n```\n\nNow run `./both_up` to boot up both containers and `./both_down` to stop both containers.\n\n\n## Testing:\n\nThere is a testing suite for both containers as well as the production endpoints. See the project in `test-gpt-broker` for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmandris%2Fgpt-broker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmandris%2Fgpt-broker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmandris%2Fgpt-broker/lists"}