Postman调用deepseek API接口

官网链接

首次调用 API | DeepSeek API Docs

复制代码
curl https://api.deepseek.com/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <DeepSeek API Key>" \
  -d '{
        "model": "deepseek-chat",
        "messages": [
          {"role": "system", "content": "You are a helpful assistant."},
          {"role": "user", "content": "Hello!"}
        ],
        "stream": false
      }'

可见需要两个参数:Content-Type 和 Authorization

输入

复制代码
{
  "messages": [
    {
      "role": "system",
      "content": "I'm researching developer tools and I need the shortest answers possible"
    },
    {
      "role": "user",
      "content": "What does Postman do?"
    }
  ],
  "model": "deepseek-chat",
  "temperature": 1,
  "max_tokens": 1000,
  "top_p": 1,
  "stream": false
}

返回

复制代码
{
    "id": "012df6ff-a63b-4b63-b539-b121cd491925",
    "object": "chat.completion",
    "created": 1743671093,
    "model": "deepseek-chat",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "Postman is an API development tool for testing, documenting, and sharing APIs.  \n\nShort version: **API tester & collaboration tool**.  \n\nShorter: **API tool**.  \n\nShortest: **API**."
            },
            "logprobs": null,
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 21,
        "completion_tokens": 42,
        "total_tokens": 63,
        "prompt_tokens_details": {
            "cached_tokens": 0
        },
        "prompt_cache_hit_tokens": 0,
        "prompt_cache_miss_tokens": 21
    },
    "system_fingerprint": "fp_3d5141a69a_prod0225"
}
相关推荐
卓码软件测评2 小时前
CMA-CNAS软件测评报告机构【Apifox动态Mock响应处理复杂业务逻辑设计】
测试工具·性能优化·单元测试·测试用例
小白学大数据2 小时前
使用 Selenium 爬取京东手机销量与评分数据 (1)
爬虫·selenium·测试工具·智能手机
_200_2 小时前
Lua 流程控制
开发语言·junit·lua
Kang.Charles2 小时前
Lua UI系统框架逻辑详解
ui·lua
oMcLin2 小时前
如何在 Rocky Linux 8.6 上配置并调优 Nginx 与 Lua 脚本,提升 API 网关的性能与并发处理能力
linux·nginx·lua
卓码软件测评2 小时前
第三方CMA.CNAS软件评测机构【深入理解Apifox的数据模型:定义和管理API数据结构】
测试工具·ci/cd·测试用例
程序员三藏3 小时前
单元测试详解
自动化测试·软件测试·python·测试工具·职场和发展·单元测试·测试用例
可可南木18 小时前
3070文件格式--2--board文件格式详解 2
功能测试·测试工具·pcb工艺
测试老哥20 小时前
2026最新软件测试面试热点问题(含答案+文档)
自动化测试·软件测试·python·测试工具·面试·职场和发展·测试用例