{"id":21445490,"url":"https://github.com/shinchven/google-generative-language-api-cf-proxy","last_synced_at":"2025-07-14T19:30:42.197Z","repository":{"id":213642102,"uuid":"734581569","full_name":"ShinChven/google-generative-language-api-cf-proxy","owner":"ShinChven","description":"CloudFlare worker as a proxy to Google Generative Language API.","archived":false,"fork":false,"pushed_at":"2024-10-16T03:14:28.000Z","size":43,"stargazers_count":18,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-04T21:09:52.160Z","etag":null,"topics":["cloudflare-worker","google-gemini","proxy"],"latest_commit_sha":null,"homepage":"","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/ShinChven.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":"2023-12-22T03:59:45.000Z","updated_at":"2025-04-11T05:20:37.000Z","dependencies_parsed_at":"2023-12-22T05:23:08.705Z","dependency_job_id":"a241547d-6b00-4889-a6d5-5b4e8889d51b","html_url":"https://github.com/ShinChven/google-generative-language-api-cf-proxy","commit_stats":null,"previous_names":["shinchven/google-generative-language-api-cf-proxy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ShinChven/google-generative-language-api-cf-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShinChven%2Fgoogle-generative-language-api-cf-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShinChven%2Fgoogle-generative-language-api-cf-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShinChven%2Fgoogle-generative-language-api-cf-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShinChven%2Fgoogle-generative-language-api-cf-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShinChven","download_url":"https://codeload.github.com/ShinChven/google-generative-language-api-cf-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShinChven%2Fgoogle-generative-language-api-cf-proxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265336283,"owners_count":23749176,"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":["cloudflare-worker","google-gemini","proxy"],"created_at":"2024-11-23T02:35:04.431Z","updated_at":"2025-07-14T19:30:41.977Z","avatar_url":"https://github.com/ShinChven.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Generative Language API CloudFlare Proxy\n\n## Introduction\n\nThis repository provides a CloudFlare Worker setup to proxy the Google Generative Language API. It's especially useful for users who encounter difficulties accessing the API directly.\n\n## Prerequisites\n\n- A CloudFlare account\n- Basic familiarity with terminal/command-line operations\n\n## Setup Instructions\n\n1. **Create a CloudFlare Account:** Sign up for an account at [CloudFlare's website](https://www.cloudflare.com/).\n\n2. **Clone the Repository:** Download or clone this repository to your local machine.\n\n   ```\n   git clone [repository-link]\n   ```\n\n3. **Install CloudFlare CLI:** Open your terminal and run the following command to install the CloudFlare Wrangler CLI.\n\n   ```\n   npm i -g wrangler\n   ```\n\n4. **Configure `wrangler.toml`:** Navigate to the cloned repository's directory and update the `wrangler.toml` file with your desired worker name.\n\n   ```\n   cd [repository-name]\n   vim wrangler.toml\n   ```\n\n5. **Deploy the Worker:** Deploy your CloudFlare worker using the following command.\n\n   ```\n   npm run deploy\n   ```\n\n   This command will automatically compile and upload your worker to CloudFlare.\n\n6. **Set a Domain Trigger:** Go to your CloudFlare dashboard and set a domain in the `Triggers` settings of your worker. This step is crucial for the worker to respond to API requests.\n\n## Usage\n\n```bash\n#!/bin/bash\n\nAPI_KEY=\"you api key\"\n\nPROXY_URL=\"https://proxy.yourdomain.com\"\n\ncurl \\\n  -X POST ${PROXY_URL}'/v1beta/models/gemini-pro:generateContent?key='${API_KEY} \\\n  -H 'Content-Type: application/json' \\\n  -d @\u003c(echo '{\n  \"contents\": [\n    {\n      \"parts\": [\n        { text: \"What is Cyberpunk 2077?\" }\n      ]\n    }\n  ],\n  \"generationConfig\": {\n    \"temperature\": 0.9,\n    \"topK\": 1,\n    \"topP\": 1,\n    \"maxOutputTokens\": 2048,\n    \"stopSequences\": []\n  },\n  \"safetySettings\": [\n    {\n      \"category\": \"HARM_CATEGORY_HARASSMENT\",\n      \"threshold\": \"BLOCK_MEDIUM_AND_ABOVE\"\n    },\n    {\n      \"category\": \"HARM_CATEGORY_HATE_SPEECH\",\n      \"threshold\": \"BLOCK_MEDIUM_AND_ABOVE\"\n    },\n    {\n      \"category\": \"HARM_CATEGORY_SEXUALLY_EXPLICIT\",\n      \"threshold\": \"BLOCK_MEDIUM_AND_ABOVE\"\n    },\n    {\n      \"category\": \"HARM_CATEGORY_DANGEROUS_CONTENT\",\n      \"threshold\": \"BLOCK_MEDIUM_AND_ABOVE\"\n    }\n  ]\n}')\n```\n\n## Contributing\n\nYour contributions to improve this proxy are welcome. Please feel free to fork the repository, make your changes, and submit a pull request.\n\n## License\n\n[LICENSE](./LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinchven%2Fgoogle-generative-language-api-cf-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshinchven%2Fgoogle-generative-language-api-cf-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinchven%2Fgoogle-generative-language-api-cf-proxy/lists"}