{"id":28401499,"url":"https://github.com/llm-red-team/jimeng-free-api","last_synced_at":"2025-06-28T20:32:27.108Z","repository":{"id":266943822,"uuid":"899123886","full_name":"LLM-Red-Team/jimeng-free-api","owner":"LLM-Red-Team","description":"🚀 即梦3.0逆向API【特长：图像生成顶流】，零配置部署，多路token支持，仅供测试，如需商用请前往官方开放平台。","archived":false,"fork":false,"pushed_at":"2025-04-09T01:52:59.000Z","size":820,"stargazers_count":678,"open_issues_count":15,"forks_count":135,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-06-01T20:30:44.361Z","etag":null,"topics":["bytedance","chatbot","chatgpt-api","image-generation","image-generation-ai","jimeng","llm"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LLM-Red-Team.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-05T17:00:12.000Z","updated_at":"2025-06-01T07:41:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"094c2cb5-c4f1-4fc8-a6bc-f0599ccad68f","html_url":"https://github.com/LLM-Red-Team/jimeng-free-api","commit_stats":null,"previous_names":["llm-red-team/jimeng-free-api"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/LLM-Red-Team/jimeng-free-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLM-Red-Team%2Fjimeng-free-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLM-Red-Team%2Fjimeng-free-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLM-Red-Team%2Fjimeng-free-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLM-Red-Team%2Fjimeng-free-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LLM-Red-Team","download_url":"https://codeload.github.com/LLM-Red-Team/jimeng-free-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLM-Red-Team%2Fjimeng-free-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262492759,"owners_count":23319726,"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":["bytedance","chatbot","chatgpt-api","image-generation","image-generation-ai","jimeng","llm"],"created_at":"2025-06-01T12:39:07.478Z","updated_at":"2025-06-28T20:32:27.088Z","avatar_url":"https://github.com/LLM-Red-Team.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jimeng AI Free 服务\n\n[![](https://img.shields.io/github/license/llm-red-team/jimeng-free-api.svg)](LICENSE)\n![](https://img.shields.io/github/stars/llm-red-team/jimeng-free-api.svg)\n![](https://img.shields.io/github/forks/llm-red-team/jimeng-free-api.svg)\n![](https://img.shields.io/docker/pulls/vinlic/jimeng-free-api.svg)\n\n支持即梦超强图像生成能力（目前官方每日赠送 66 积分，可生成 66 次），零配置部署，多路 token 支持。\n\n与 OpenAI 接口完全兼容。\n\n还有以下十个 free-api 欢迎关注：\n\nMoonshot AI（Kimi.ai）接口转 API [kimi-free-api](https://github.com/LLM-Red-Team/kimi-free-api)\n\n阶跃星辰 (跃问 StepChat) 接口转 API [step-free-api](https://github.com/LLM-Red-Team/step-free-api)\n\n阿里通义 (Qwen) 接口转 API [qwen-free-api](https://github.com/LLM-Red-Team/qwen-free-api)\n\n智谱 AI (智谱清言) 接口转 API [glm-free-api](https://github.com/LLM-Red-Team/glm-free-api)\n\n秘塔 AI (Metaso) 接口转 API [metaso-free-api](https://github.com/LLM-Red-Team/metaso-free-api)\n\n字节跳动（豆包）接口转 API [doubao-free-api](https://github.com/LLM-Red-Team/doubao-free-api)\n\n讯飞星火（Spark）接口转 API [spark-free-api](https://github.com/LLM-Red-Team/spark-free-api)\n\nMiniMax（海螺 AI）接口转 API [hailuo-free-api](https://github.com/LLM-Red-Team/hailuo-free-api)\n\n深度求索（DeepSeek）接口转 API [deepseek-free-api](https://github.com/LLM-Red-Team/deepseek-free-api)\n\n聆心智能 (Emohaa) 接口转 API [emohaa-free-api](https://github.com/LLM-Red-Team/emohaa-free-api)\n\n## 目录\n\n- [Jimeng AI Free 服务](#jimeng-ai-free-服务)\n  - [目录](#目录)\n  - [免责声明](#免责声明)\n  - [接入准备](#接入准备)\n    - [多账号接入](#多账号接入)\n  - [效果展示](#效果展示)\n  - [Docker 部署](#docker-部署)\n    - [Docker-compose 部署](#docker-compose-部署)\n    - [Render 部署](#render-部署)\n    - [Vercel 部署](#vercel-部署)\n  - [原生部署](#原生部署)\n  - [推荐使用客户端](#推荐使用客户端)\n  - [接口列表](#接口列表)\n    - [对话补全](#对话补全)\n    - [图像生成](#图像生成)\n  - [Star History](#star-history)\n\n## 免责声明\n\n**逆向 API 是不稳定的，建议前往即梦 AI 官方 https://jimeng.jianying.com/ 体验功能，避免封禁的风险。**\n\n**本组织和个人不接受任何资金捐助和交易，此项目是纯粹研究交流学习性质！**\n\n**仅限自用，禁止对外提供服务或商用，避免对官方造成服务压力，否则风险自担！**\n\n**仅限自用，禁止对外提供服务或商用，避免对官方造成服务压力，否则风险自担！**\n\n**仅限自用，禁止对外提供服务或商用，避免对官方造成服务压力，否则风险自担！**\n\n## 接入准备\n\n从 [即梦](https://jimeng.jianying.com/) 获取 sessionid\n\n进入即梦登录账号，然后 F12 打开开发者工具，从 Application \u003e Cookies 中找到`sessionid`的值，这将作为 Authorization 的 Bearer Token 值：`Authorization: Bearer sessionid`\n\n![example0](./doc/example-0.png)\n\n### 多账号接入\n\n你可以通过提供多个账号的 sessionid 并使用`,`拼接提供：\n\n`Authorization: Bearer sessionid1,sessionid2,sessionid3`\n\n每次请求服务会从中挑选一个。\n\n## 效果展示\n\n```text\n可爱的熊猫漫画，熊猫看到地上有一个叫“即梦”的时间机器，然后说了一句“我借用一下没事吧”\n```\n\n![example1](./doc/example-1.jpeg)\n\n## Docker 部署\n\n请准备一台具有公网 IP 的服务器并将 8000 端口开放。\n\n拉取镜像并启动服务\n\n```shell\ndocker run -it -d --init --name jimeng-free-api -p 8000:8000 -e TZ=Asia/Shanghai vinlic/jimeng-free-api:latest\n```\n\n查看服务实时日志\n\n```shell\ndocker logs -f jimeng-free-api\n```\n\n重启服务\n\n```shell\ndocker restart jimeng-free-api\n```\n\n停止服务\n\n```shell\ndocker stop jimeng-free-api\n```\n\n### Docker-compose 部署\n\n```yaml\nversion: \"3\"\n\nservices:\n  jimeng-free-api:\n    container_name: jimeng-free-api\n    image: vinlic/jimeng-free-api:latest\n    restart: always\n    ports:\n      - \"8000:8000\"\n    environment:\n      - TZ=Asia/Shanghai\n```\n\n### Render 部署\n\n**注意：部分部署区域可能无法连接即梦，如容器日志出现请求超时或无法连接，请切换其他区域部署！**\n**注意：免费账户的容器实例将在一段时间不活动时自动停止运行，这会导致下次请求时遇到 50 秒或更长的延迟，建议查看[Render 容器保活](https://github.com/LLM-Red-Team/free-api-hub/#Render%E5%AE%B9%E5%99%A8%E4%BF%9D%E6%B4%BB)**\n\n1. fork 本项目到你的 github 账号下。\n\n2. 访问 [Render](https://dashboard.render.com/) 并登录你的 github 账号。\n\n3. 构建你的 Web Service（New+ -\u003e Build and deploy from a Git repository -\u003e Connect 你 fork 的项目 -\u003e 选择部署区域 -\u003e 选择实例类型为 Free -\u003e Create Web Service）。\n\n4. 等待构建完成后，复制分配的域名并拼接 URL 访问即可。\n\n### Vercel 部署\n\n**注意：Vercel 免费账户的请求响应超时时间为 10 秒，但接口响应通常较久，可能会遇到 Vercel 返回的 504 超时错误！**\n\n请先确保安装了 Node.js 环境。\n\n```shell\nnpm i -g vercel --registry http://registry.npmmirror.com\nvercel login\ngit clone https://github.com/LLM-Red-Team/jimeng-free-api\ncd jimeng-free-api\nvercel --prod\n```\n\n## 原生部署\n\n请准备一台具有公网 IP 的服务器并将 8000 端口开放。\n\n请先安装好 Node.js 环境并且配置好环境变量，确认 node 命令可用。\n\n安装依赖\n\n```shell\nnpm i\n```\n\n安装 PM2 进行进程守护\n\n```shell\nnpm i -g pm2\n```\n\n编译构建，看到 dist 目录就是构建完成\n\n```shell\nnpm run build\n```\n\n启动服务\n\n```shell\npm2 start dist/index.js --name \"jimeng-free-api\"\n```\n\n查看服务实时日志\n\n```shell\npm2 logs jimeng-free-api\n```\n\n重启服务\n\n```shell\npm2 reload jimeng-free-api\n```\n\n停止服务\n\n```shell\npm2 stop jimeng-free-api\n```\n\n## 推荐使用客户端\n\n使用以下二次开发客户端接入 free-api 系列项目更快更简单，支持文档/图像上传！\n\n由 [Clivia](https://github.com/Yanyutin753/lobe-chat) 二次开发的 LobeChat [https://github.com/Yanyutin753/lobe-chat](https://github.com/Yanyutin753/lobe-chat)\n\n由 [时光@](https://github.com/SuYxh) 二次开发的 ChatGPT Web [https://github.com/SuYxh/chatgpt-web-sea](https://github.com/SuYxh/chatgpt-web-sea)\n\n## 接口列表\n\n目前支持与 openai 兼容的 `/v1/chat/completions` 接口，可自行使用与 openai 或其他兼容的客户端接入接口，或者使用 [dify](https://dify.ai/) 等线上服务接入使用。\n\n### 对话补全\n\n对话补全接口，与 openai 的 [chat-completions-api](https://platform.openai.com/docs/guides/text-generation/chat-completions-api) 兼容。\n\n**POST /v1/chat/completions**\n\nheader 需要设置 Authorization 头部：\n\n```\nAuthorization: Bearer [sessionid]\n```\n\n请求数据：\n\n```json\n{\n  // jimeng-3.0（默认） / jimeng-2.1 / jimeng-2.0-pro / jimeng-2.0 / jimeng-1.4 / jimeng-xl-pro\n  \"model\": \"jimeng-3.0\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"少女祈祷中...\"\n    }\n  ],\n  // 如果使用SSE流请设置为true，默认false\n  \"stream\": false\n}\n```\n\n响应数据：\n\n```json\n{\n  \"id\": \"b400abe0-b4c3-11ef-b2eb-4175f5393bfd\",\n  \"model\": \"jimeng-3.0\",\n  \"object\": \"chat.completion\",\n  \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\": \"assistant\",\n        \"content\": \"![image_0](https://p6-heycan-hgt-sign.byteimg.com/tos-cn-i-3jr8j4ixpe/3b381b78fe2f46aaac952753d6d7faa7~tplv-3jr8j4ixpe-aigc_resize:0:0.jpeg?lk3s=43402efa\u0026x-expires=1735344000\u0026x-signature=zcGIxn%2BBIxI%2BTYj2RU4BflvSox8%3D\u0026format=.jpeg)\\n![image_1](https://p6-heycan-hgt-sign.byteimg.com/tos-cn-i-3jr8j4ixpe/370482573be7454381cb38cc650b5c5f~tplv-3jr8j4ixpe-aigc_resize:0:0.jpeg?lk3s=43402efa\u0026x-expires=1735344000\u0026x-signature=FqnNJruwTWxrhrRGwhQvGKtHOSE%3D\u0026format=.jpeg)\\n![image_2](https://p9-heycan-hgt-sign.byteimg.com/tos-cn-i-3jr8j4ixpe/e1b0248c9b0e4fbea8a479c5677a1610~tplv-3jr8j4ixpe-aigc_resize:0:0.jpeg?lk3s=43402efa\u0026x-expires=1735344000\u0026x-signature=N7wjAj2JWdA5YE9B3Bld7COu5jk%3D\u0026format=.jpeg)\\n![image_3](https://p9-heycan-hgt-sign.byteimg.com/tos-cn-i-3jr8j4ixpe/9da2e379ea8d4c2bb24dc30180223cf9~tplv-3jr8j4ixpe-aigc_resize:0:0.jpeg?lk3s=43402efa\u0026x-expires=1735344000\u0026x-signature=vhwI8xtHW%2FcQT%2BCAPue%2FCye12Hs%3D\u0026format=.jpeg)\\n\"\n      },\n      \"finish_reason\": \"stop\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\": 1,\n    \"completion_tokens\": 1,\n    \"total_tokens\": 2\n  },\n  \"created\": 1733593810\n}\n```\n\n### 图像生成\n\n图像生成接口，与 openai 的 [images-create-api](https://platform.openai.com/docs/api-reference/images/create) 兼容。\n\n**POST /v1/images/generations**\n\nheader 需要设置 Authorization 头部：\n\n```\nAuthorization: Bearer [sessionid]\n```\n\n请求数据：\n\n```json\n{\n  // jimeng-3.0（默认） /  jimeng-2.1 / jimeng-2.0-pro / jimeng-2.0 / jimeng-1.4 / jimeng-xl-pro\n  \"model\": \"jimeng-3.0\",\n  // 提示词，必填\n  \"prompt\": \"少女祈祷中...\",\n  // 反向提示词，默认空字符串\n  \"negativePrompt\": \"\",\n  // 图像宽度，默认1024\n  \"width\": 1024,\n  // 图像高度，默认1024\n  \"height\": 1024,\n  // 精细度，取值范围0-1，默认0.5\n  \"sample_strength\": 0.5\n}\n```\n\n响应数据：\n\n```json\n{\n  \"created\": 1733593745,\n  \"data\": [\n    {\n      \"url\": \"https://p9-heycan-hgt-sign.byteimg.com/tos-cn-i-3jr8j4ixpe/61bceb3afeb54c1c80ffdd598ac2f72d~tplv-3jr8j4ixpe-aigc_resize:0:0.jpeg?lk3s=43402efa\u0026x-expires=1735344000\u0026x-signature=DUY6jlx4zAXRYJeATyjZ3O6F1Pw%3D\u0026format=.jpeg\"\n    },\n    {\n      \"url\": \"https://p3-heycan-hgt-sign.byteimg.com/tos-cn-i-3jr8j4ixpe/e37ab3cd95854cd7b37fb697ea2cb4da~tplv-3jr8j4ixpe-aigc_resize:0:0.jpeg?lk3s=43402efa\u0026x-expires=1735344000\u0026x-signature=oKtY400tjZeydKMyPZufjt0Qpjs%3D\u0026format=.jpeg\"\n    },\n    {\n      \"url\": \"https://p9-heycan-hgt-sign.byteimg.com/tos-cn-i-3jr8j4ixpe/13841ff1c30940cf931eccc22405656b~tplv-3jr8j4ixpe-aigc_resize:0:0.jpeg?lk3s=43402efa\u0026x-expires=1735344000\u0026x-signature=4UffSRMmOeYoC0u%2B5igl9S%2BfYKs%3D\u0026format=.jpeg\"\n    },\n    {\n      \"url\": \"https://p6-heycan-hgt-sign.byteimg.com/tos-cn-i-3jr8j4ixpe/731c350244b745d5990e8931b79b7fe7~tplv-3jr8j4ixpe-aigc_resize:0:0.jpeg?lk3s=43402efa\u0026x-expires=1735344000\u0026x-signature=ywYjZQeP3t2yyvx6Wlud%2BCB28nU%3D\u0026format=.jpeg\"\n    }\n  ]\n}\n```\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=LLM-Red-Team/doubao-free-api\u0026type=Date)](https://star-history.com/#LLM-Red-Team/doubao-free-api\u0026Date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllm-red-team%2Fjimeng-free-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllm-red-team%2Fjimeng-free-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllm-red-team%2Fjimeng-free-api/lists"}