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"
}
相关推荐
测试员周周21 小时前
【jev应用到测试】94 条 UI 报错交给 Jev,三档判对 85.1%,开单闸门定在 0.6
人工智能·python·测试工具·单元测试·测试用例
xfilm埃利测量1 天前
从方阻到电阻率:四探针法如何把薄膜“测明白“
功能测试·测试工具·四探针·薄膜电阻测量
禹凕1 天前
机器学习之Selenium(Machina Learning about Selenium)
爬虫·python·selenium·测试工具·机器学习
大侠归来2 天前
C++ 与 Lua 的协程交互:从原理到实战
c++·lua·交互
疯狂成瘾者3 天前
海康 Artemis 接口对接
开发语言·lua
一线灵3 天前
跨平台游戏引擎 Axmol-2.11.5 发布
游戏引擎·lua
水水不水啊3 天前
告别杂乱的调试窗口:我用 Python + WebView 写了一个现代化串口助手
python·测试工具·嵌入式·嵌入式开发·串口调试·串口助手
花间相见10 天前
【计算基础|网络04】—— HTTP接口实战(下):接口测试、鉴权与跨域排错
java·linux·人工智能·后端·python·计算机网络·postman
霍格沃兹测试学院-小舟畅学11 天前
UI 测试的语义断言:Midscene aiAssert 比像素比对稳在哪、又会骗在哪
人工智能·测试工具
zuozewei11 天前
附录 A:主流工具对比选型表
人工智能·测试工具