DeepSeek API 官方文档:2026年开发者集成指南与核心功能详解
DeepSeek API provides comprehensive documentation for developers to integrate advanced AI capabilities, including chat completions, function calling, and JSON output, with detailed guides on authentication, pricing, and best practices.
原文翻译: DeepSeek API 为开发者提供全面的文档,用于集成高级AI功能,包括对话补全、函数调用和JSON输出,并包含认证、定价和最佳实践的详细指南。
引言
Introduction
本文旨在为开发者提供一份关于 DeepSeek APIAn AI model API service compatible with OpenAI's API format for accessing DeepSeek's language models. 的清晰、结构化的核心信息概览。DeepSeek APIAn AI model API service compatible with OpenAI's API format for accessing DeepSeek's language models. 提供了强大的模型调用接口,使开发者能够轻松地将先进的大语言模型能力集成到自己的应用程序和服务中。以下内容基于官方文档,提炼了快速入门、核心概念和关键资源,以帮助您高效地开始使用。
This article aims to provide developers with a clear, structured overview of the core information regarding the DeepSeek APIAn AI model API service compatible with OpenAI's API format for accessing DeepSeek's language models.. The DeepSeek APIAn AI model API service compatible with OpenAI's API format for accessing DeepSeek's language models. offers powerful model invocation interfaces, enabling developers to easily integrate advanced large language model capabilities into their own applications and services. The following content, based on official documentation, distills quick start guides, core concepts, and key resources to help you get started efficiently.
快速开始
Quick Start
在调用 DeepSeek APIAn AI model API service compatible with OpenAI's API format for accessing DeepSeek's language models. 之前,您需要完成一些基础准备工作。
Before calling the DeepSeek APIAn AI model API service compatible with OpenAI's API format for accessing DeepSeek's language models., you need to complete some basic preparatory steps.
获取 API 密钥
Obtaining an API Key
使用 DeepSeek APIAn AI model API service compatible with OpenAI's API format for accessing DeepSeek's language models. 的第一步是创建并获取您的专属 API 密钥。这是所有 API 请求进行身份验证的凭证。
The first step in using the DeepSeek APIAn AI model API service compatible with OpenAI's API format for accessing DeepSeek's language models. is to create and obtain your exclusive API key. This credential is used for authenticating all API requests.
- 步骤:访问 DeepSeek Platform 并导航至 API 密钥管理页面进行创建。
- Step: Visit the DeepSeek Platform and navigate to the API key management page to create one.
身份验证
Authentication
所有 API 请求都必须通过 Bearer Token 的方式进行身份验证。
All API requests must be authenticated using a Bearer Token.
- 安全方案类型:
HTTP- Security Scheme Type:
HTTP
- Security Scheme Type:
- HTTP 授权方案:
Bearer- HTTP Authorization Scheme:
Bearer
- HTTP Authorization Scheme:
- 请求头示例:在您的 HTTP 请求头中设置
Authorization: Bearer <your_api_key>。- Request Header Example: Set
Authorization: Bearer <your_api_key>in your HTTP request headers.
- Request Header Example: Set
核心概念与功能
Core Concepts and Features
DeepSeek APIAn AI model API service compatible with OpenAI's API format for accessing DeepSeek's language models. 提供了一系列端点来支持不同的交互模式。
The DeepSeek APIAn AI model API service compatible with OpenAI's API format for accessing DeepSeek's language models. provides a series of endpoints to support different interaction modes.
主要 API 端点
Main API Endpoints
对话补全
- Chat Completions
- 这是最常用的端点,用于实现多轮对话、内容生成等场景。它遵循类似 OpenAI 的 Messages 格式。
- This is the most commonly used endpoint for implementing multi-turn conversations, content generation, and other scenarios. It follows a message format similar to OpenAI's.
文本补全
- Text Completions
- 适用于传统的文本续写任务,给定一个提示词,模型会生成后续文本。
- Suitable for traditional text continuation tasks. Given a prompt, the model generates subsequent text.
模型列表
- Model List
- 用于查询当前可用的模型及其详细信息。
- Used to query currently available models and their detailed information.
关键功能指南
Key Feature Guides
官方文档提供了详细的指南,帮助您充分利用 API 的高级功能:
The official documentation provides detailed guides to help you fully utilize the API's advanced features:
- 思考模式:引导模型进行逐步推理。
- Thinking Mode: Guides the model through step-by-step reasoning.
- 多轮对话:管理带有历史记录的复杂会话。
- Multi-round Chat: Manages complex conversations with history.
- JSON 输出模式:强制模型以结构化的 JSON 格式返回结果。
- JSON Output Mode: Forces the model to return results in a structured JSON format.
- 工具调用:让模型能够调用外部函数或工具。
- Tool Calls: Enables the model to call external functions or tools.
- 上下文硬盘缓存:优化长上下文处理的性能和成本。
- Context Hard Disk Cache: Optimizes performance and cost for long-context processing.
实用资源与支持
Practical Resources and Support
开发者资源
Developer Resources
- 实用集成库:GitHub 上的 Awesome DeepSeek Integration 收集了各种第三方集成和工具。
- Useful Integrations Repository: The Awesome DeepSeek Integration on GitHub collects various third-party integrations and tools.
- API 服务状态:通过 状态页面 实时查看 API 服务的运行状况。
- API Service Status: Check the operational status of the API service in real-time via the Status Page.
支持与社区
Support and Community
如果您在使用过程中遇到问题,可以通过以下渠道寻求帮助:
If you encounter issues during use, you can seek help through the following channels:
- 技术支持邮箱:api-service@deepseek.com
- Technical Support Email: api-service@deepseek.com
- 社区交流:
- Community Communication:
- Discord
- Twitter (@deepseek_ai)
政策与协议
Policies and Agreements
在使用 API 前,请务必阅读并理解相关条款。
Before using the API, be sure to read and understand the relevant terms.
- 服务条款:DeepSeek 开放平台服务条款
- Terms of Service: DeepSeek Open Platform Terms of Service
- 许可证:API 文档基于 MIT 许可证。
- License: The API documentation is based on the MIT License.
总结
Conclusion
DeepSeek APIAn AI model API service compatible with OpenAI's API format for accessing DeepSeek's language models. 以其清晰的文档、丰富的功能和活跃的社区,为开发者提供了构建智能应用的强大基础。建议从获取 API 密钥开始,参照“快速开始”部分进行首次调用,并逐步探索“API 指南”中的高级功能以优化您的应用体验。
The DeepSeek APIAn AI model API service compatible with OpenAI's API format for accessing DeepSeek's language models. provides a powerful foundation for developers to build intelligent applications, thanks to its clear documentation, rich features, and active community. It is recommended to start by obtaining an API key, make your first call by referring to the "Quick Start" section, and gradually explore the advanced features in the "API Guides" to optimize your application experience.
版权与免责声明:本文仅用于信息分享与交流,不构成任何形式的法律、投资、医疗或其他专业建议,也不构成对任何结果的承诺或保证。
文中提及的商标、品牌、Logo、产品名称及相关图片/素材,其权利归各自合法权利人所有。本站内容可能基于公开资料整理,亦可能使用 AI 辅助生成或润色;我们尽力确保准确与合规,但不保证完整性、时效性与适用性,请读者自行甄别并以官方信息为准。
若本文内容或素材涉嫌侵权、隐私不当或存在错误,请相关权利人/当事人联系本站,我们将及时核实并采取删除、修正或下架等处理措施。 也请勿在评论或联系信息中提交身份证号、手机号、住址等个人敏感信息。