Lesson 06 · DeepSeek Mastery Pro+ ~12 min read Updated November 2026

DeepSeek API: your first call in ten minutes.

Because DeepSeek mirrors the OpenAI and Anthropic APIs, you can point your existing code at it by changing two lines. Here is the clean path from zero to a working call.

01From zero to first response

  1. Create a DeepSeek platform account and open the API keys page.
  2. Generate a key and store it as an environment variable — never hard-code it.
  3. Point your existing OpenAI (or Anthropic) client at DeepSeek's base URL and set the model to a current name — deepseek-flash for the latest Flash model (V4.1 Flash as of November 2026), or deepseek-v4-pro for Pro.
  4. Send a test message, confirm you get a response, and check the token usage in the dashboard.
OpenAI-compatible call (pseudocode)client = OpenAI(base_url="https://api.deepseek.com", api_key=ENV["DEEPSEEK_API_KEY"]) resp = client.chat.completions.create( model="deepseek-flash", messages=[{"role":"user","content":"Say hello in one sentence."}] ) print(resp.choices[0].message.content)
Two lines, not a rewrite

The whole point: keep your SDK, your message format, and your tooling. You change the base URL and the model name — everything else stays. That is what makes migrating a prototype trivial.

Set a spending limit and rotate keys you have exposed. Confirm the exact base URL and current model identifiers in DeepSeek's docs, since names and endpoints evolve.

02New: the app's tools, as API switches

On November 13, 2026, DeepSeek opened up the pieces that make its own chat app work — so you no longer have to wire up search, scraping and file parsing yourself. Per DeepSeek's API changelog, the deepseek-flash model supports these in the Messages, Responses and Chat Completions APIs, with the tool calls and context assembly handled on DeepSeek's side:

  1. Web search — enable the deepseek_web_search tool and the model searches when the question needs it and answers with citations. With thinking turned on, it becomes a multi-step “deep thinking search” that reads links on its own.
  2. URL reading — enable deepseek_read_url and links in the user's message are fetched and read into context.
  3. File input — upload PDFs, Office files or images; DeepSeek extracts the text (or parses rich layouts) and adds it to the conversation.
  4. Safety check — an optional parameter that reviews inputs and outputs and returns a refusal marker on risky content.

Search and Fetch, OCR, speech recognition (ASR) and text-to-speech (TTS) are also available as standalone APIs, and DeepSeek open-sourced a demo chat client built on them that can import your DeepSeek chat history.

What this changes for you

A “chat with web search and file upload” prototype used to mean a search API, a scraper and a document parser glued together. Now it is one model call with tool switches. The trade-off: you're relying on DeepSeek's search index and parsing quality, and tool calls add cost — check the current rates on DeepSeek's Models & Pricing page before you scale.

If you put this in front of the public, DeepSeek's own docs say to turn on the safety check parameter — and the same docs note public services may carry legal obligations (content review, model registration, AI labeling) depending on where you operate. Get that answered before launch, not after.
Frequently asked

DeepSeek — your questions, answered

How do I use the DeepSeek API?
Create an account, generate an API key, then point your existing OpenAI or Anthropic client at DeepSeek's base URL with a current model name (deepseek-flash as of November 2026). No new SDK needed.
Is the DeepSeek API compatible with OpenAI?
Yes — it mirrors the OpenAI (and Anthropic) request format, so most code works by changing the base URL and model name.
How do I keep my DeepSeek API key safe?
Store it in an environment variable, never commit it to code, set a spending limit, and rotate any key that may have leaked.
What base URL and model names do I use?
The base URL is https://api.deepseek.com. As of November 2026, use deepseek-flash for the latest Flash model (V4.1 Flash) or deepseek-v4-pro for Pro; older names like deepseek-v4-flash are temporarily routed to V4.1 Flash. Names change, so confirm in DeepSeek's docs.
What are DeepSeek's application APIs?
Since November 13, 2026, DeepSeek lets developers switch on the same tools its app uses: web search (the deepseek_web_search tool), URL reading (deepseek_read_url), file input for PDFs, Office files and images, and an optional safety check that reviews inputs and outputs. Search and Fetch, OCR, speech-to-text and text-to-speech are also offered as standalone APIs. They work with the deepseek-flash model in the Messages, Responses and Chat Completions APIs; check DeepSeek's pricing page for tool costs.