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"
}
相关推荐
我的xiaodoujiao11 小时前
使用PyMySQL模块技术操作MySQL数据库
数据库·python·测试工具·mysql
mCell19 小时前
Lua 编程入门:从基础语法到元表
javascript·算法·lua
摸摸芋1 天前
postman(ai篇)
测试工具·postman
St_rive1 天前
selenium元素定位方法
selenium·测试工具
St_rive1 天前
selenium常用等待方式
selenium·测试工具
随风而飘1861 天前
罗德与施瓦茨 FSP13 中高端频谱分析仪
网络·功能测试·测试工具
测试狗科研平台1 天前
从实验室到量产:测试狗新材料中试的技术路径与平台支撑
测试工具·服务发现·材料工程
szarron1 天前
VNA6 便携式矢量网络分析仪:从入门到精通
数据库·嵌入式硬件·测试工具·5g·射频工程
不拘一格的叶三少1 天前
Pytest + Playwright 自动化测试工程设计要点 & 目录结构
测试工具·pytest
测试19983 天前
Python接口测试之requests库安装和导入
自动化测试·软件测试·python·测试工具·职场和发展·测试用例·接口测试