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"
}
相关推荐
上海合宙LuatOS1 天前
LuatOS扩展库API——【air153C_wtd】外部硬件看门狗
物联网·lua·air153c_wtd 库
上海合宙LuatOS1 天前
LuatOS核心库API——【ymodem】文件传输协议
物联网·lua·ymodem协议
lakernote1 天前
EasyPostman 重大更新:正式支持插件模式,当前已上线 5 个官方插件
java·测试工具·开源·postman
上海合宙LuatOS1 天前
LuatOS核心库API——【xxtea】XXTEA加解密算法
lua·xxtea分组加密算法
oi..1 天前
Flag入门—Flag在返回包中
网络·笔记·测试工具·安全·网络安全
Vic101011 天前
Wireshark 解密 HTTPS 流量
测试工具·https·wireshark
上海合宙LuatOS2 天前
LuatOS扩展库API——【airlbs 】airlbs 定位服务
物联网·lua·嵌入式实时数据库·airlbs定位服务
老神在在0012 天前
测试分类+自动化测试01
功能测试·学习·单元测试·postman
月亮!2 天前
6大AI测试工具极限压测:微软TuringAI竟率先崩溃
java·人工智能·python·测试工具·microsoft·云原生·压力测试
上海合宙LuatOS2 天前
LuatOS扩展库API——【dhcpsrv】DHCP服务器
物联网·开源·lua·luatos