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"
}
相关推荐
于眠牧北1 小时前
重写RedisTemplate后在lua脚本中传递参数不需要二次转换
java·junit·lua
csdn_aspnet2 小时前
技术难题:高并发场景下的“超卖”现象(库存一致性)
redis·lua·秒杀
shuair4 小时前
redis执行lua脚本
数据库·redis·lua
Wpa.wk5 小时前
IDE中配置Git常见操作
ide·经验分享·git·测试工具
海特伟业19 小时前
蒸汽阀门内漏检测仪-疏水器内漏检测仪-让蒸汽阀门疏水器内部泄漏由被动抢修转变为主动预防
测试工具
小白-Tester19 小时前
2026最新Postman安装教程[简单易懂]附安装包
开发语言·lua
Saniffer_SH1 天前
【每日一题】PCIe链路协商的时候进入Polling compliance如何排错?
服务器·人工智能·驱动开发·嵌入式硬件·测试工具·fpga开发·自动化
张永清-老清1 天前
每周读书与学习->Jmeter中如何使用Bean Shell脚本(二)Bean Shell的基础语法之变量与数据类型
学习·测试工具·jmeter·压力测试·性能调优·jmeter性能测试·性能分析
0和1的舞者2 天前
高并发论坛系统:单元测试 + 接口自动化 + 性能测试 + CI/CD 全链路测试报告
java·测试开发·测试工具·jmeter·pytest·测试·测试报告