{"id":27773569,"url":"https://github.com/k8scat/flux-api","last_synced_at":"2025-07-19T11:33:17.544Z","repository":{"id":254949167,"uuid":"848049025","full_name":"k8scat/flux-api","owner":"k8scat","description":"免费渠道的 Flux 文生图 API，同时兼容 OpenAI 的 Image 和 Chat 接口，支持自动翻译 Prompt，可以直接接入 one-api / one-hub / new-api 等中转平台","archived":false,"fork":false,"pushed_at":"2024-12-12T00:23:13.000Z","size":44,"stargazers_count":20,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-19T08:27:48.529Z","etag":null,"topics":["ai","flux","flux-api","flux-v1","getimgai","openai","siliconflow"],"latest_commit_sha":null,"homepage":"https://openai-all.com","language":"Go","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/k8scat.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}},"created_at":"2024-08-27T03:14:29.000Z","updated_at":"2025-06-11T02:41:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"527ed8a6-d36f-4fd4-9aee-6ad26843866c","html_url":"https://github.com/k8scat/flux-api","commit_stats":null,"previous_names":["k8scat/flux-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/k8scat/flux-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k8scat%2Fflux-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k8scat%2Fflux-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k8scat%2Fflux-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k8scat%2Fflux-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k8scat","download_url":"https://codeload.github.com/k8scat/flux-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k8scat%2Fflux-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265926920,"owners_count":23850886,"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","flux","flux-api","flux-v1","getimgai","openai","siliconflow"],"created_at":"2025-04-30T01:10:24.771Z","updated_at":"2025-07-19T11:33:17.536Z","avatar_url":"https://github.com/k8scat.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flux-API\n\n**免费渠道的 Flux 文生图 API，同时兼容 OpenAI 的 Image 和 Chat 接口，支持自动翻译 Prompt，可以直接接入 [one-api](https://github.com/songquanpeng/one-api) / [one-hub](https://github.com/MartialBE/one-hub) / [new-api](https://github.com/Calcium-Ion/new-api) 等中转平台**\n\n演示地址：[openai-all.com](https://openai-all.com)\n\n生成图片：\n\n\u003cimg src=\"https://chat.ggemini.pro/a-cute-baby-sea-otter.png\" width=\"240\"\u003e\n\n## 免费渠道\n\n- [x] [SiliconFlow](https://docs.siliconflow.cn/reference/black-forest-labsflux1-schnell) 限时免费\n- [x] [Getimg.AI](https://getimg.ai/pricing) 每个月100次免费\n\n## 运行\n\n```bash\ndocker run -d -p 8080:8080 --name flux-api k8scat/flux-api:latest\n```\n\n**Flux 对中文理解不好，支持开启自动翻译功能：**\n\n```bash\ndocker run -d -p 8080:8080 --name flux-api \\\n    -e TRANSLATE_ENABLE=true \\\n    -e TRANSLATE_API_BASE=https://api.openai-all.com \\\n    -e TRANSLATE_API_KEY=sk-xxx \\\n    -e TRANSLATE_MODEL=gpt-4o \\\n    -e TRANSLATE_PROMPT_TEMPLATE=\"Translate into English: %s\" \\\n    k8scat/flux-api:latest\n```\n\n## 使用说明\n\n### 兼容 Image 接口\n\n```bash\ncurl http://127.0.0.1:8080/v1/images/generations \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer #AUTH\" \\\n  -d '{\n    \"model\": \"#MODEL\",\n    \"prompt\": \"A cute baby sea otter\",\n    \"n\": 1,\n    \"size\": \"1024x1024\"\n  }'\n```\n\n### 兼容 Chat 接口\n\n```bash\ncurl http://127.0.0.1:8080/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer #AUTH\" \\\n  -d '{\n    \"model\": \"#MODEL\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"A cute baby sea otter\"\n      }\n    ]\n  }'\n```\n\n### SiliconFlow 配置\n\n- #MODEL =\u003e 固定值 `FLUX.1-schnell`\n- #AUTH =\u003e SiliconFlow 的 API Key，获取地址：https://cloud.siliconflow.cn/account/ak\n\n### GetimgAI 配置\n\n- #MODEL =\u003e 固定值 `flux-v1`\n- #AUTH =\u003e [GetimgAI](https://getimg.ai/text-to-image) 浏览器登录后的完整 Cookie\n\n## 交流群\n\n\u003cimg src=\"https://chat.ggemini.pro/flux-api.jpg\" width=\"240\" /\u003e\n\n## 开源许可\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk8scat%2Fflux-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk8scat%2Fflux-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk8scat%2Fflux-api/lists"}