Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/btreeset_ds2api-rs.json
T

1 line
13 KiB
JSON

{"repo": "btreeset/ds2api-rs", "files": {"README.md": {"048ad14914fe85b02bf9009b185aabe1aae4a6ee": {"t": 1785746561.0443532, "n": 6282, "h": "a1695501d0351007", "c": "# DeepSeek2API-rs (ds2api-rs)\n\n[![](https://img.shields.io/github/license/iidamie/deepseek2api.svg)](LICENSE)\n\nA high-performance Rust port of the original DeepSeek2API. This project bridges the web-based DeepSeek chat interface to standard API formats. \n\nIt supports high-speed streaming output, multi-turn conversations, DeepSeek-R1 \"Deep Think\" reasoning, multi-account rotation, and tool function calling. \n\n**Fully compatible with the OpenAI API format and includes preliminary support for the Anthropic (Claude) API format.**\n\n## Table of Contents\n\n* [Disclaimer](#disclaimer)\n* [Features](#features)\n* [Preparation](#preparation)\n * [Multi-Account Setup](#multi-account-setup)\n* [Deployment](#deployment)\n * [Native (Cargo)](#native-cargo)\n * [Docker](#docker)\n * [Docker Compose](#docker-compose)\n* [API Endpoints](#api-endpoints)\n * [Supported Models](#supported-models)\n * [OpenAI Chat Completions](#openai-chat-completions)\n * [Anthropic Messages](#anthropic-messages)\n* [Notes](#notes)\n * [Nginx Reverse Proxy Optimization](#nginx-reverse-proxy-optimization)\n* [Acknowledgements](#acknowledgements)\n\n## Disclaimer\n\n**Reverse-engineered APIs are inherently unstable. It is highly recommended to use the official DeepSeek API at https://platform.deepseek.com/ to avoid the risk of account bans.**\n\n**This organization and its contributors do not accept any financial donations or commercial transactions. This project is purely for educational, research, and learning purposes!**\n\n**STRICTLY FOR PERSONAL USE ONLY. Do not use this to provide public services or for commercial purposes to avoid putting pressure on official servers. Use at your own risk!**\n\n## Features\n\n* **Rust Rewite:** Built with Axum and Tokio for maximum performance and minimal footprint.\n* **Native PoW Solver:** Uses `wasmtime` to efficiently solve DeepSeek's WebAssembly Proof-of-Work (PoW) challenges.\n* **OpenAI Compatibility:** Drop-in replacement for OpenAI endpoints (`/v1/chat/completions`).\n* **Anthropic Compatibility:** Translate Claude API requests directly to DeepSeek (`/anthropic/v1/messages`).\n* **Web Search:** Support for DeepSeek's web search toggles.\n\n## Preparation\n\nYou will need one or more registered DeepSeek accounts.\n\n### Multi-Account Setup\n\nCurrently, a single account can only stream one response at a time. To handle concurrent requests, you can configure multiple accounts. The service will automatically rotate through available accounts for each request.\n\nCreate a `config.json` file in the root directory:\n\n```json\n{\n \"bind_address\": \"0.0.0.0:5001\",\n \"cors_origins\": [\"*\"],\n \"keys\": [\n \"sk-your-custom-api-key-1\",\n \"sk-your-custom-api-key-2\"\n ],\n \"accounts\": [\n {\n \"email\": \"example1@example.com\",\n \"password\": \"password1\",\n \"token\": \"\"\n },\n {\n \"mobile\": \"12345678901\",\n \"password\": \"password3\",\n \"token\": \"\"\n }\n ]\n}\n```\n* `bind_address`: The host and port the server will bind to.\n* `keys`: Your custom API authentication keys (used as Bearer tokens in your requests).\n* `accounts`: A list of DeepSeek credentials. The system supports email/password or mobile/password logins. Tokens will be automatically fetched and refreshed.\n\n*Note: The Wasm PoW file (`sha3_wasm_bg.7b9ca65ddd.wasm`) must be present in the root directory alongside the config.*\n\n## Deployment\n\n### Native (Cargo)\n\nEnsure you have Rust and Cargo installed. \n\n```shell\ngit clone [https://github.com/your-username/ds2api-rs.git](https://github.com/your-username/ds2api-rs.git)\ncd ds2api-rs\n```\n\nEnsure `config.json` and `sha3_wasm_bg.7b9ca65ddd.wasm` are in the current directory, then run:\n\n```shell\ncargo run --release\n```\n\n### Docker\n\nIf you have built a Docker image (e.g., `ds2api-rs:latest`), you can run it via Docker. Ensure your `config.json` is ready.\n\n```shell\ndocker run -d -p 5001:5001 \\\n -v \"$(pwd)/config.json:/app/config.json\" \\\n --name deepseek2api \\\n ds2api-rs:latest\n```\n\nView real-time logs:\n```shell\ndocker logs -f deepseek2api\n```\n\n### Docker Compose\n\nClone the repository and prepare your `config.json`.\n\n```shell\ndocker-compose up -d\n```\n\n## API Endpoints\n\n### Supported Models\n\nYou can use the following model strings in your requests:\n\n* **Standard Chat:** `deepseek-chat` or `deepseek-v3`\n* **Deep Thinking (R1):** `deepseek-reasoner` or `deepseek-r1`\n* **Chat + Web Search:** `deepseek-chat-search` or `deepseek-v3-search`\n* **Deep Thinking + Web Search:** `deepseek-reasoner-search` or `deepseek-r1-search`\n\n### OpenAI Chat Completions\n\n**POST `/v1/chat/completions`**\n\nHeaders:\n```http\nAuthorization: Bearer <YOUR_CUSTOM_KEY_FROM_CONFIG>\nContent-Type: application/json\n```\n\nRequest body:\n```json\n{\n \"model\": \"deepseek-reasoner\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Who are you?\"\n }\n ],\n \"stream\": true\n}\n```\n\n### Anthropic Messages\n\n**POST `/anthropic/v1/messages`** (or `/claude/messages`)\n\n*Note: Streaming is not yet supported for the Anthropic translation layer in this Rust implementation.*\n\nHeaders:\n```http\nAuthorization: Bearer <YOUR_CUSTOM_KEY_FROM_CONFIG>\nx-api-key: <YOUR_CUSTOM_KEY_FROM_CONFIG>\nContent-Type: application/json\n```\n\nRequest body:\n```json\n{\n \"model\": \"claude-3-5-sonnet-20241022\",\n \"system\": \"You are a helpful assistant.\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Who are you?\"\n }\n ],\n \"stream\": false\n}\n```\n\n## Notes\n\n### Nginx Reverse Proxy Optimization\n\nIf you are using Nginx to reverse proxy this API, please add the following configuration to optimize Server-Sent Events (SSE) streaming output.\n\n```nginx\n# Disable proxy buffering. This ensures Nginx sends chunks from the backend to the client immediately.\nproxy_buffering off;\n# Enable chunked transfer encoding.\nchunked_transfer_encoding on;\n# Send data as soon as possible.\ntcp_nopush on;\n# Do not delay sending small packets.\ntcp_nodelay on;\n# Keep-alive timeout.\nkeepalive_timeout 120;\n```\n\n## Acknowledgements\n\nThis Rust port is based on the original Python implementation of `deepseek2api`. \nSpecial thanks to the [LLM-Red-Team/deepseek-free-api](https://github.com/LLM-Red-Team/deepseek-free-api) project, which provided foundational references for the reverse engineering implementation.\n"}, "a40317a8da0025ae25638fff9b76c9f260a752b5": {"t": 1785765700.843879, "n": 6282, "h": "a1695501d0351007", "c": "# DeepSeek2API-rs (ds2api-rs)\n\n[![](https://img.shields.io/github/license/iidamie/deepseek2api.svg)](LICENSE)\n\nA high-performance Rust port of the original DeepSeek2API. This project bridges the web-based DeepSeek chat interface to standard API formats. \n\nIt supports high-speed streaming output, multi-turn conversations, DeepSeek-R1 \"Deep Think\" reasoning, multi-account rotation, and tool function calling. \n\n**Fully compatible with the OpenAI API format and includes preliminary support for the Anthropic (Claude) API format.**\n\n## Table of Contents\n\n* [Disclaimer](#disclaimer)\n* [Features](#features)\n* [Preparation](#preparation)\n * [Multi-Account Setup](#multi-account-setup)\n* [Deployment](#deployment)\n * [Native (Cargo)](#native-cargo)\n * [Docker](#docker)\n * [Docker Compose](#docker-compose)\n* [API Endpoints](#api-endpoints)\n * [Supported Models](#supported-models)\n * [OpenAI Chat Completions](#openai-chat-completions)\n * [Anthropic Messages](#anthropic-messages)\n* [Notes](#notes)\n * [Nginx Reverse Proxy Optimization](#nginx-reverse-proxy-optimization)\n* [Acknowledgements](#acknowledgements)\n\n## Disclaimer\n\n**Reverse-engineered APIs are inherently unstable. It is highly recommended to use the official DeepSeek API at https://platform.deepseek.com/ to avoid the risk of account bans.**\n\n**This organization and its contributors do not accept any financial donations or commercial transactions. This project is purely for educational, research, and learning purposes!**\n\n**STRICTLY FOR PERSONAL USE ONLY. Do not use this to provide public services or for commercial purposes to avoid putting pressure on official servers. Use at your own risk!**\n\n## Features\n\n* **Rust Rewite:** Built with Axum and Tokio for maximum performance and minimal footprint.\n* **Native PoW Solver:** Uses `wasmtime` to efficiently solve DeepSeek's WebAssembly Proof-of-Work (PoW) challenges.\n* **OpenAI Compatibility:** Drop-in replacement for OpenAI endpoints (`/v1/chat/completions`).\n* **Anthropic Compatibility:** Translate Claude API requests directly to DeepSeek (`/anthropic/v1/messages`).\n* **Web Search:** Support for DeepSeek's web search toggles.\n\n## Preparation\n\nYou will need one or more registered DeepSeek accounts.\n\n### Multi-Account Setup\n\nCurrently, a single account can only stream one response at a time. To handle concurrent requests, you can configure multiple accounts. The service will automatically rotate through available accounts for each request.\n\nCreate a `config.json` file in the root directory:\n\n```json\n{\n \"bind_address\": \"0.0.0.0:5001\",\n \"cors_origins\": [\"*\"],\n \"keys\": [\n \"sk-your-custom-api-key-1\",\n \"sk-your-custom-api-key-2\"\n ],\n \"accounts\": [\n {\n \"email\": \"example1@example.com\",\n \"password\": \"password1\",\n \"token\": \"\"\n },\n {\n \"mobile\": \"12345678901\",\n \"password\": \"password3\",\n \"token\": \"\"\n }\n ]\n}\n```\n* `bind_address`: The host and port the server will bind to.\n* `keys`: Your custom API authentication keys (used as Bearer tokens in your requests).\n* `accounts`: A list of DeepSeek credentials. The system supports email/password or mobile/password logins. Tokens will be automatically fetched and refreshed.\n\n*Note: The Wasm PoW file (`sha3_wasm_bg.7b9ca65ddd.wasm`) must be present in the root directory alongside the config.*\n\n## Deployment\n\n### Native (Cargo)\n\nEnsure you have Rust and Cargo installed. \n\n```shell\ngit clone [https://github.com/your-username/ds2api-rs.git](https://github.com/your-username/ds2api-rs.git)\ncd ds2api-rs\n```\n\nEnsure `config.json` and `sha3_wasm_bg.7b9ca65ddd.wasm` are in the current directory, then run:\n\n```shell\ncargo run --release\n```\n\n### Docker\n\nIf you have built a Docker image (e.g., `ds2api-rs:latest`), you can run it via Docker. Ensure your `config.json` is ready.\n\n```shell\ndocker run -d -p 5001:5001 \\\n -v \"$(pwd)/config.json:/app/config.json\" \\\n --name deepseek2api \\\n ds2api-rs:latest\n```\n\nView real-time logs:\n```shell\ndocker logs -f deepseek2api\n```\n\n### Docker Compose\n\nClone the repository and prepare your `config.json`.\n\n```shell\ndocker-compose up -d\n```\n\n## API Endpoints\n\n### Supported Models\n\nYou can use the following model strings in your requests:\n\n* **Standard Chat:** `deepseek-chat` or `deepseek-v3`\n* **Deep Thinking (R1):** `deepseek-reasoner` or `deepseek-r1`\n* **Chat + Web Search:** `deepseek-chat-search` or `deepseek-v3-search`\n* **Deep Thinking + Web Search:** `deepseek-reasoner-search` or `deepseek-r1-search`\n\n### OpenAI Chat Completions\n\n**POST `/v1/chat/completions`**\n\nHeaders:\n```http\nAuthorization: Bearer <YOUR_CUSTOM_KEY_FROM_CONFIG>\nContent-Type: application/json\n```\n\nRequest body:\n```json\n{\n \"model\": \"deepseek-reasoner\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Who are you?\"\n }\n ],\n \"stream\": true\n}\n```\n\n### Anthropic Messages\n\n**POST `/anthropic/v1/messages`** (or `/claude/messages`)\n\n*Note: Streaming is not yet supported for the Anthropic translation layer in this Rust implementation.*\n\nHeaders:\n```http\nAuthorization: Bearer <YOUR_CUSTOM_KEY_FROM_CONFIG>\nx-api-key: <YOUR_CUSTOM_KEY_FROM_CONFIG>\nContent-Type: application/json\n```\n\nRequest body:\n```json\n{\n \"model\": \"claude-3-5-sonnet-20241022\",\n \"system\": \"You are a helpful assistant.\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Who are you?\"\n }\n ],\n \"stream\": false\n}\n```\n\n## Notes\n\n### Nginx Reverse Proxy Optimization\n\nIf you are using Nginx to reverse proxy this API, please add the following configuration to optimize Server-Sent Events (SSE) streaming output.\n\n```nginx\n# Disable proxy buffering. This ensures Nginx sends chunks from the backend to the client immediately.\nproxy_buffering off;\n# Enable chunked transfer encoding.\nchunked_transfer_encoding on;\n# Send data as soon as possible.\ntcp_nopush on;\n# Do not delay sending small packets.\ntcp_nodelay on;\n# Keep-alive timeout.\nkeepalive_timeout 120;\n```\n\n## Acknowledgements\n\nThis Rust port is based on the original Python implementation of `deepseek2api`. \nSpecial thanks to the [LLM-Red-Team/deepseek-free-api](https://github.com/LLM-Red-Team/deepseek-free-api) project, which provided foundational references for the reverse engineering implementation.\n"}}}}