๐—จ๐˜€๐—ฒ ๐——๐—ฒ๐—ฒ๐—ฝ๐—ฆ๐—ฒ๐—ฒ๐—ธ ๐—”๐—ฃ๐—œ ๐˜„๐—ถ๐˜๐—ต ๐—ฃ๐˜†๐˜๐—ต๐—ผ๐—ป

DeepSeek is cheap. Most tutorials skip the basics. This is the simple version.

Why use it?

Setup steps:

Install the tool: pip install openai

Use this code:

import os from openai import OpenAI

client = OpenAI( api_key=os.environ.get("DEEPSEEK_API_KEY"), base_url="https://api.deepseek.com", )

response = client.chat.completions.create( model="deepseek-v4-flash", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Explain what an API is in one sentence."}, ], )

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

Only the base_url and model name change.

Pricing:

Warnings:

You have a cheap AI API. This code works with other models.

What are you building? Was signup easy outside the US? Is this common?

Source: https://dev.to/jieming_liang/how-to-use-the-deepseek-api-in-python-a-beginners-guide-2026-fne Optional learning community: https://t.me/GyaanSetuAi