How to Use DeepSeek API with LobeChat

LobeChat ?? DeepSeek API ??

LobeChat is an open-source ChatGPT/LLM UI framework with plugin support. Connect it to our DeepSeek API Gateway for fast, affordable inference.

Third-party API gateway. Not affiliated with or endorsed by DeepSeek. Not an official DeepSeek service.

Base URL

https://modelrelayapis.cc/v1

Available Models

Setup Steps

  1. Open LobeChat and go to Settings ? Language Model.
  2. Select OpenAI as the API provider.
  3. Set API Base URL to https://modelrelayapis.cc/v1.
  4. Enter your sk-gateway API Key.
  5. Set the model to deepseek-v4-flash (or deepseek-v4-pro for Pro plan users).
  6. Click Test Connection, then start chatting.

Python Example

from openai import OpenAI

client = OpenAI(
    base_url="https://modelrelayapis.cc/v1",
    api_key="sk-gateway-YOUR-KEY"
)

response = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Hello, how are you?"}]
)

print(response.choices[0].message.content)

Quick curl Test

curl https://modelrelayapis.cc/v1/chat/completions   -H "Content-Type: application/json"   -H "Authorization: Bearer sk-gateway-YOUR-KEY"   -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"Hello"}]}'

Common Errors

HTTPMeaning
401Invalid or missing API key
402API budget exhausted ? buy a new package
403Model not allowed for your plan
429Rate limit exceeded
500/502Gateway error ? try again or contact support

Get Your DeepSeek API Key ? From $1

Instant key delivery after PayPal payment. Check your usage anytime on the Dashboard.

View Plans & Buy