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 小时前
软件测试之bug分析定位技巧
自动化测试·软件测试·python·测试工具·职场和发展·测试用例·bug
thekenofdis1 天前
Lua脚本执行多个redis命令提示“CROSSSLOT Keys in request don‘t hash to the same slot“问题
redis·lua·哈希算法
安冬的码畜日常2 天前
【JUnit实战3_33】第二十章:用 JUnit 5 进行测试驱动开发(TDD)(下)——TDD 项目的重构过程及新功能的开发实战
测试工具·junit·单元测试·测试驱动开发·tdd·junit5·test-driven
爱学测试的雨果2 天前
软件测试面试题总结【含答案】
功能测试·测试工具·面试
霜绛2 天前
Unity:lua热更新(一)——AB包AssetBundle、Lua语法
笔记·学习·游戏·unity·lua
霜绛2 天前
Unity:lua热更新(二)——Lua语法(续)
笔记·学习·unity·游戏引擎·lua
测试19982 天前
如何用Appium实现移动端UI自动化测试?
自动化测试·软件测试·python·测试工具·ui·职场和发展·appium
FAREWELL000752 天前
Lua环境的配置 和 Lua的一些简单语法逻辑
开发语言·lua
FAREWELL000752 天前
Lua学习记录(1) --- Lua中的条件分支语句和循环语句
学习·lua