Tutorial: Calling V4.1-Flash Native Vision with Python
V4.1-Flash vision goes through the standard chat API. Python example:
from openai import OpenAI
client = OpenAI(api_key="...", base_url="https://api.deepseek.com/v1")
resp = client.chat.completions.create(
model="deepseek-flash",
messages=[{"role": "user", "content": [
{"type": "text", "text": "What does this chart show?"},
{"type": "image_url", "image_url": {"url": "https://example.com/chart.png"}},
]}],
)
- Off-peak window (UTC 16:30–00:30) halves prices
- Stable prefixes hit $0.003 cache pricing
- WebP images usually cost fewer vision tokens