> ## Documentation Index
> Fetch the complete documentation index at: https://docs.promptguard.co/llms.txt
> Use this file to discover all available pages before exploring further.

# DeepSeek

> Scan DeepSeek traffic through the PromptGuard proxy with any OpenAI client

## Proxy

> [!NOTE]
>
> **Proxy Base URL:** `https://api.promptguard.co/api/v1`
>
> Point your LLM SDK's `base_url` / `baseURL` to this endpoint. Your existing provider API key goes in the `Authorization` header as usual; add your PromptGuard key via `X-API-Key`.

Model ids starting `deepseek-` go to DeepSeek, such as `deepseek-chat` and `deepseek-reasoner`. Hugging Face's `deepseek-ai/` ids are the exception: they go to [Hugging Face](https://docs.promptguard.co/integrations/providers/huggingface.md).

DeepSeek speaks OpenAI's wire format, so PromptGuard forwards your request to `api.deepseek.com/v1` as you sent it and returns DeepSeek's reply unchanged. Any OpenAI client works.

```python Python theme={"system"}
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.promptguard.co/api/v1",
    api_key=os.environ["DEEPSEEK_API_KEY"],  # forwarded to DeepSeek
    default_headers={"X-API-Key": os.environ["PROMPTGUARD_API_KEY"]},
)

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

```typescript Node.js theme={"system"}
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api.promptguard.co/api/v1',
  apiKey: process.env.DEEPSEEK_API_KEY, // forwarded to DeepSeek
  defaultHeaders: { 'X-API-Key': process.env.PROMPTGUARD_API_KEY },
});

const response = await client.chat.completions.create({
  model: 'deepseek-chat',
  messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(response.choices[0].message.content);
```

```bash cURL theme={"system"}
curl https://api.promptguard.co/api/v1/chat/completions \
  -H "X-API-Key: $PROMPTGUARD_API_KEY" \
  -H "Authorization: Bearer $DEEPSEEK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "deepseek-chat", "messages": [{"role": "user", "content": "Hello!"}]}'
```

DeepSeek keys cannot be [stored as provider keys](https://docs.promptguard.co/gateway/provider-keys.md) yet, so send yours in `Authorization` on every request.

## Auto-instrumentation

DeepSeek has no SDK of its own; DeepSeek's docs use the OpenAI client. Pointed at `api.deepseek.com`, that client is the `openai` package, which [auto-instrumentation](https://docs.promptguard.co/integrations/auto-instrumentation.md) patches, so `init()` scans those calls too.

## Next steps

> [card] [Provider keys](https://docs.promptguard.co/gateway/provider-keys.md)
>
> Store your provider credentials once, forwarded server-side

> [card] [Routing rules](https://docs.promptguard.co/gateway/routing-rules.md)
>
> Rewrite the upstream provider or model per request

> [card] [Integrations overview](https://docs.promptguard.co/integrations/overview.md)
>
> Every provider and framework, and how to connect each


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.