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"
}
相关推荐
卓码软件测评14 小时前
第三方软件测试测评机构【使用web_reg_save_param_ex函数:掌握LoadRunner关联的黄金法则 】
测试工具·ci/cd·性能优化·单元测试·测试用例
快乐小胡!20 小时前
【自动化测试】Selenium选择/定位元素的基本方法
python·selenium·测试工具
PhotonixBay1 天前
车载HUD的 TFT 屏被动散热仿真与太阳光测试
测试工具
Apifox.1 天前
测试用例越堆越多?用 Apifox 测试套件让自动化回归更易维护
运维·前端·后端·测试工具·单元测试·自动化·测试用例
AI_56781 天前
K8s新手入门:从“Pod创建”到“服务暴露”,3个案例理解容器编排
人工智能·学习·测试工具
我的offer在哪里1 天前
Figma 技术深度解析:重新定义协作设计的底层架构与工程实践
测试工具·流程图
weixin_462446231 天前
在宝塔 Nginx 上安装与配置 lua-cjson 教程
nginx·junit·lua
猿小羽1 天前
[TEST] Selenium 自动化测试 - 1769003387277
selenium·测试工具
猿小羽1 天前
[TEST] Selenium 自动化测试 - 1769003091046
selenium·测试工具
线束线缆组件品替网2 天前
Switchcraft TRS XLR 音频线缆国产兼容设计解析
数码相机·测试工具·电脑·音视频·pcb工艺·智能手表