# Deepseek

> Call the DeepSeek API (deepseek-v4-pro, deepseek-v4-flash, and deepseek-v4-flash-vision-exp) through RunAPI using OpenAI-compatible Chat Completions and Responses. Use for DeepSeek text, image input, streaming, the verified Flash function path, or an existing compatibility client that needs the conditional reference.

- Skill: `runapi-ai/deepseek` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add runapi-ai/deepseek`
- Raw SKILL.md: https://api.skillmd.com/api/skills/runapi-ai/deepseek/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: runapi-ai (https://skillmd.com/u/runapi-ai)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/runapi-ai/deepseek

---


# DeepSeek on RunAPI

Use OpenAI-compatible endpoints at `https://runapi.ai/v1` as the primary protocol.

## Primary protocol recipe

### Authenticate

Set `OPENAI_API_KEY` to a RunAPI API key and `OPENAI_BASE_URL` to `https://runapi.ai/v1`.

### Send request

```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_RUNAPI_TOKEN", base_url="https://runapi.ai/v1")
response = client.chat.completions.create(
    model="deepseek-v4-pro",
    messages=[{"role": "user", "content": "Explain this decision."}],
)
print(response.choices[0].message.content)
print(response.usage)
```

For long output, set `stream=True` and
`stream_options={"include_usage": True}`; consume through `[DONE]`.
`deepseek-v4-flash` additionally supports one custom function on Responses;
keep automatic tool selection and one serial call/result lifecycle.

For image input, use `deepseek-v4-flash-vision-exp` with a Chat Completions
message content array containing a text part and an `image_url` part. The image
URL must be publicly reachable and use JPEG, PNG, GIF, or WebP.

### Verify result

For Chat, require final assistant content, `finish_reason`, and `usage`. For
Responses, require final output, one usage-bearing `response.completed`, and
`[DONE]` when streaming.

### Stop boundaries

Correct a rejected shape once using the structured error. Retry transport once
only before any response or Usage and when replay is safe. Record a terminal
error and stop without changing model or protocol. Add tools, reasoning,
storage, cache controls, documents, or multimodal input only when the current
RunAPI contract verifies the exact model/protocol shape.

## Compatibility protocols

Load [compatibility protocols](references/compatibility-protocols.md) only when an existing client requires Anthropic Messages or Gemini contents.

## Supported models

| Model ID | Use when |
|---|---|
| `deepseek-v4-flash-vision-exp` | Image input and vision tasks |
| `deepseek-v4-pro` | Higher-quality verified text workloads |
| `deepseek-v4-flash` | Fast text and one verified custom-function lifecycle |

## References

- <https://runapi.ai/models/deepseek.md>
- <https://runapi.ai/providers/deepseek.md>
- <https://runapi.ai/models.md>

