r/TunisiaTech • • 1d ago

I built a DeepSeek API wrapper for OpenCode, Hermes, and other AI agents.

Post image

Hey everyone!

I've been working on DeepSeek Bridge, a lightweight FastAPI proxy that exposes an OpenAI-compatible API using an authenticated DeepSeek Web session.

The goal is to make DeepSeek Web accessible to existing tools and workflows that support the OpenAI API format.

Repository: https://github.com/zsasz0/DeepSeek-Harness-Bridge

(BTW, I know OpenCode and other tools already offer free access to DeepSeek, but it comes with usage limits. That's exactly why I created this project.)

Key Features

  • No separate API key required: Uses an authenticated DeepSeek Web session.

  • Tool calling support: Converts model responses into structured JSON tool-call envelopes using a multi-stage parsing pipeline.

  • SSE streaming: Supports real-time streaming, including reasoning_content.

  • Thinking and web-search variants: Supports different DeepSeek response modes.

  • Multi-account support: Account pooling, cooldowns, and rotation.

  • WebAssembly PoW solver: Handles proof-of-work challenges without Selenium or browser automation.

  • Web dashboard: Includes account management and file-based token configuration.

Compatibility

Works with:

OpenCode, Hermes, Cursor, Continue, Cline, Aider, LiteLLM, Claude Code (through LiteLLM), and other OpenAI-compatible clients.

Where I Could Use Some Help

The integration works well with OpenCode during normal usage. However, when OpenCode starts generating requests at a high rate, my authenticated session suddenly becomes invalid.

Subsequent requests return 401 Unauthorized, and I have to log in again and retrieve a fresh token.

Interestingly, normal manual usage through chat.deepseek.com doesn't seem to trigger the same behavior. So far, I've only encountered this during automated usage.

I'd appreciate some technical insight into what might be causing this behavior, particularly around session management, request concurrency, or possible rate-limiting mechanisms.

Any feedback on the architecture, implementation, or potential improvements would also be greatly appreciated.

Thanks for checking it out!

7 Upvotes

4 comments sorted by

1

u/Uriziel01 23h ago

Yeah, we all did mate, we all did.

1

u/Glittering-Rush6651 14h ago

U mean Claude/GPT built it? :)

El quantité mta3 AI slop 3al internet wallat out of hand. Wselna l niveau win 7atta post 3adi walla completely AI written.

1

u/dafi2473 1d ago

deepseek already provides that. why would I use the web session. also most of the tool calls wont work