Last updated: 2026-04-20

DeepSeek Integration

Route DeepSeek API calls through SpendLil.

SpendLil proxies DeepSeek's API. Swap api.deepseek.com for deepseek.gateway.spendlil.ai and add X-SpendLil-Key. DeepSeek is OpenAI-compatible — use the OpenAI SDK with the DeepSeek gateway.

URL Pattern

diff Before → After
- POST https://api.deepseek.com/v1/chat/completions
+ POST https://deepseek.gateway.spendlil.ai/v1/chat/completions

OpenAI SDK (Python)

python Use the OpenAI SDK with the DeepSeek gateway
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ['DEEPSEEK_API_KEY'],
    base_url='https://deepseek.gateway.spendlil.ai/v1',
    default_headers={'X-SpendLil-Key': os.environ['SPENDLIL_KEY']},
)

response = client.chat.completions.create(
    model='deepseek-chat',
    messages=[{'role': 'user', 'content': 'Hello'}],
)
print(response.choices[0].message.content)

cURL

bash Direct HTTP request
curl https://deepseek.gateway.spendlil.ai/v1/chat/completions \
  -H "Authorization: Bearer $DEEPSEEK_API_KEY" \
  -H "X-SpendLil-Key: $SPENDLIL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-chat",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
OpenAI-compatible

DeepSeek's API mirrors OpenAI's chat completions schema. Any OpenAI SDK or tool that accepts a base_url override will work unchanged.