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"
}
相关推荐
Forworder22 分钟前
【测试】Bug和用例
selenium·测试工具·单元测试·测试用例·bug·postman·ab测试
Feng.Lee9 小时前
聊一聊如何使用自动化测试来提高接口测试效率的?
功能测试·测试工具·可用性测试
.生产的驴14 小时前
SpringBoot 执行Lua脚本 服务端执行 减少性能损耗 优化性能 优化连接性能
java·数据库·spring boot·后端·junit·maven·lua
头疼的程序员21 小时前
移动端 UI自动化测试学习之Appium框架(包含adb调试工具介绍)
测试工具·appium
程序员杰哥21 小时前
2025年软件测试面试八股文(含答案+文档)
自动化测试·软件测试·python·测试工具·面试·职场和发展·测试用例
小小数媒成员1 天前
Unity—lua基础语法
unity·junit·lua
龙哥·三年风水1 天前
openresty+lua+redis把非正常访问的域名加入黑名单
redis·lua·openresty
LDM>W<1 天前
黑马点评-分布式锁Lua脚本
java·分布式·lua
奋斗的老史2 天前
利用Lua脚本限制用户的访问频率
开发语言·junit·lua
空城机2 天前
时代变了,我选择ApiFox替代Postman
测试工具·postman