{"id":23011484,"url":"https://github.com/lopinx/serverless-api-proxy","last_synced_at":"2025-04-23T01:27:51.496Z","repository":{"id":268218075,"uuid":"903642744","full_name":"lopinx/serverless-api-proxy","owner":"lopinx","description":"Multi-API Proxy Gateway Based on Vercel Routes, Cloudflare Workers, and Netlify Redirects","archived":false,"fork":false,"pushed_at":"2024-12-29T13:09:47.000Z","size":8,"stargazers_count":11,"open_issues_count":1,"forks_count":10,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T20:51:08.713Z","etag":null,"topics":["ai","api","api-gateway","apiproxy","claude","cohere","discord","fireworks","gemini","groq","huggingface","llama","novita","openai","openrouter","portkey","telegram","together"],"latest_commit_sha":null,"homepage":"https://vercel-api-proxy.lopins.cn","language":"JavaScript","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/lopinx.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}},"created_at":"2024-12-15T06:34:09.000Z","updated_at":"2025-03-22T03:00:37.000Z","dependencies_parsed_at":"2024-12-15T09:32:15.639Z","dependency_job_id":"03f023e1-d16d-48c9-9bb9-b71046e5265d","html_url":"https://github.com/lopinx/serverless-api-proxy","commit_stats":null,"previous_names":["lopinx/serverless-api-proxy"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopinx%2Fserverless-api-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopinx%2Fserverless-api-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopinx%2Fserverless-api-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopinx%2Fserverless-api-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lopinx","download_url":"https://codeload.github.com/lopinx/serverless-api-proxy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250351386,"owners_count":21416313,"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":["ai","api","api-gateway","apiproxy","claude","cohere","discord","fireworks","gemini","groq","huggingface","llama","novita","openai","openrouter","portkey","telegram","together"],"created_at":"2024-12-15T10:09:06.478Z","updated_at":"2025-04-23T01:27:51.481Z","avatar_url":"https://github.com/lopinx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"right\"\u003e\n   \u003ca href=\"README_CN.md\"\u003e中文\u003c/a\u003e | \u003cstrong\u003eEnglish\u003c/strong\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eServerless API Proxy\u003c/h1\u003e\n\u003cp\u003eServerless API Proxy: Multi-API Proxy Gateway Based on Vercel Routes, Cloudflare Workers, and Netlify Redirects\u003c/p\u003e\n\u003c/div\u003e\n\n## Notice\n\n**Due to login restrictions on the original account([lopins](https://github.com/lopins)), I'm now using this account([lopinx](https://github.com/lopinx)) for maintenance purposes.**\n\n## Support\n\n- openai\n- gemini\n- groq\n- claude\n- cohere\n- huggingface.co\n- Fireworks AI\n- ...\n\n## How to deploy\n\n### Vercel\n\n[![Deploy to Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/lopinx/serverless-api-proxy)\n\n### Cloudflare\n\n[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/lopinx/serverless-api-proxy)\n\n### Netlify\n\n[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/lopinx/serverless-api-proxy)\n\n## How to use\n\n### Configure proxy address\n\n```\n# openai\nhttps://self.domain/openai/\n\n# gemini\nhttps://self.domain/gemini/\n\n# groq\nhttps://self.domain/groq/\n\n# claude\nhttps://self.domain/claude/\n\n# cohere\nhttps://self.domain/cohere/\n\n# huggingface\nhttps://self.domain/huggingface/\n\n# fireworks\nhttps://self.domain/fireworks/\n```\n\n| Name | Original API | Proxy API | Use Example |\n| :---: | :--- | :--- | :--- |\n| OpenAI API | \u003chttps://api.openai.com/v1\u003e | `/openai/v1` | `/openai/v1/chat/completions` |\n| Gemini API | \u003chttps://generativelanguage.googleapis.com/v1\u003e | `/gemini/v1` | `/gemini/v1/models/gemini-pro:generateContent?key=AIzaSyBbBDDvGwJqKjsmE6CpNheqmzp30bz9saI` |\n| Gemini API | \u003chttps://generativelanguage.googleapis.com/v1beta\u003e | `/gemini/v1beta` | `/gemini/v1beta/models/gemini-pro:generateContent?key=AIzaSyBbBDDvGwJqKjsmE6CpNheqmzp30bz9saI` |\n| Groq API | \u003chttps://api.groq.com/groq/openai/v1\u003e | `/groq/openai/v1` | `/groq/openai/v1/chat/completions` |\n| Claude API | \u003chttps://api.anthropic.com/v1\u003e | `/claude/v1` | `/claude/v1/completions` |\n| Cohere API | \u003chttps://api.cohere.ai/v1\u003e | `/cohere/v1` | `/cohere/v1/chat/completions` |\n| Huggingface API | \u003chttps://api-inference.huggingface.co\u003e | `/huggingface` | `/huggingface/models/meta-llama/Llama-3.1-70B-Instruct/v1/chat/completions` |\n| Fireworks API | \u003chttps://api.fireworks.ai/v1\u003e | `/fireworks/v1` | `/fireworks/v1/chat/completions` |\n\n\n### API Usage\n\n``` python\nimport random\nimport re\n\nfrom openai import OpenAI\n\nApiKey = \"sk-Qa7GFtgCspCVfVGqKhm43QFmEB1FxsFvkXNysVycCuwDv2rz\"\nBaseUrl = \"https://self.domain/openai/v1\"\nmodels = [\n    \"gpt-3.5-turbo\",\n    \"gpt-4o-mini\"\n]\n\ndef gentext():\n    client = OpenAI(api_key=ApiKey, base_url=BaseUrl)\n    model = random.choice(models)\n    try:\n        completion = client.chat.completions.create(\n            model=model,\n            messages=[\n                {\n                    \"role\": \"system\",\n                    \"content\": \"You are a smart and creative novelist.\"\n                },\n                {\n                    \"role\": \"user\",\n                    \"content\": \"As the king of fairy tales, please write a short fairy tale, the theme of the story is to always maintain a kind heart, to stimulate children's interest and imagination in learning, and to help children better understand and accept the truth and values contained in the story. Only the story content is output, and the title and others are not required.\"\n                }\n            ],\n            top_p=0.7,\n            temperature=0.7\n        )\n        text = completion.choices[0].message.content\n        print(f\"{model}：{re.sub(r'\\n+', '', text)}\")\n    except Exception as e:\n        print(f\"{model}：{str(e)}\\n\")\n```\n\n## Vercel Region List\n\nhttps://vercel.com/docs/edge-network/regions#region-list","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flopinx%2Fserverless-api-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flopinx%2Fserverless-api-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flopinx%2Fserverless-api-proxy/lists"}