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"
}
相关推荐
羑悻的小杀马特18 小时前
Lua vs C++:核心设计哲学差异——从“系统基石”到“灵活工具”的思维碰撞
c++·lua
UTP协同自动化测试19 小时前
UTP测试系统为家电及智能家居产品打造高效、合规、体验至上的验证体系
功能测试·物联网·测试工具·视觉检测·压力测试·模块测试·测试覆盖率
慧都小项19 小时前
JAVA自动化测试平台Parasoft Jtest 插件Eclipse/IDEA安装教程
java·软件测试·测试工具·eclipse·intellij-idea
少云清21 小时前
【接口测试】1_Postman _Postman环境搭建
测试工具·postman
程序员杰哥21 小时前
如何使用Postman做接口自动化测试?
自动化测试·软件测试·python·测试工具·测试用例·接口测试·postman
天才测试猿21 小时前
Jmeter 命令行压测&生成HTML测试报告
自动化测试·软件测试·python·测试工具·jmeter·职场和发展·jenkins
啊巴矲21 小时前
小白从零开始勇闯人工智能:爬虫初级篇(Selenium库)
爬虫·selenium·测试工具
少云清1 天前
【接口测试】2_Postman _Postman基础使用
测试工具·postman
小毅&Nora1 天前
【后端】【工具】Redis Lua脚本漏洞深度解析:从CVE-2022-0543到Redis 7.x的全面防御指南
redis·安全·lua
2501_924064111 天前
2025年PC软件跨系统兼容性测试与Web自动化工具深度对比
测试工具