DEEPSEEK API · MULTIMODAL VISION
Add image understanding with DeepSeek V4 Flash Vision
Integrate DeepSeek V4 Flash and Pro for text, or Flash Vision for image understanding, through one OpenAI-compatible endpoint. OK-API is an independent gateway, not DeepSeek's official API platform. Use your OK-API key with the base URL below.
/v1
Unified API prefix
SSE
Streaming responses
Vision
Image understanding
Files
Files API inputs
Run it now
curl https://api.ok-api.net/v1/chat/completions \
-H "Authorization: Bearer $OK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"Hello"}],"stream":false}'01
DeepSeek API integration in three steps
Keep the OpenAI SDK and message structure, then replace only the base URL, API key, and model. This confines the integration change to configuration instead of spreading it across business logic.
- Create an OK-API key and store it in the OK_API_KEY server environment variable
- Use https://api.ok-api.net/v1 as the base URL; check /v1/models for your key's available models
- Send a Chat Completions request, or keep your OpenAI SDK and update base URL, key, and model
02
The first multimodal DeepSeek V4 route
DeepSeek V4 Flash Vision adds image understanding to the Flash family. It accepts image_url and file content blocks in Chat Completions and input_image blocks in the Responses API. It analyzes images; it does not generate them.
- Model ID: deepseek-v4-flash-vision-exp
- Image URL, uploaded file, and Responses image inputs
- Use /v1/files for reusable uploaded inputs
03
Protocol features agents depend on
Coding agents need more than text generation. They rely on stable stream events, tool arguments, clear errors, and reasoning state that survives multiple turns. OK-API exposes these capabilities behind a consistent endpoint.
- SSE streaming
- Tools and multi-turn messages
- Thinking controls and reasoning effort
04
Key and cost governance
Never ship an upstream provider credential to a client. Create a separate user key for each application, restrict its quota and model access, and revoke only that key if it is exposed.
- Separate development, staging, and production keys
- Store keys server-side and outside source control
- Review model and token usage in one dashboard
05
When to add Harness
A standard SDK is enough for direct API calls. Use DeepSeek Harness when the task must repeatedly inspect a project, run shell commands, edit files, invoke tools, and verify results.
- Single request: call the API directly
- Multi-step tool loop: use Harness
- Central model policy: use the API Gateway
FAQ
Frequently asked questions
Is OK-API the official DeepSeek API?+
No. OK-API is an independent gateway. Use a DeepSeek official key only with DeepSeek's own endpoint; use an OK-API key with api.ok-api.net. Review our trust page for model sourcing and data-handling information.
Can I call the DeepSeek API with the OpenAI SDK?+
Yes. For OpenAI-compatible Chat Completions, you normally change the base URL, API key, and model name.
Which model should I use for images?+
Use deepseek-v4-flash-vision-exp for image understanding. Use V4 Flash for fast text workloads and V4 Pro for more complex reasoning and long agent tasks.
Can I put my API key in a browser application?+
No. Store it in server-side environment variables or a secrets manager and proxy requests through your backend.
RELATED GUIDES