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"
}
相关推荐
微尘hjx1 小时前
【目标检测软件 01】YOLO识别软件功能与操作指南
人工智能·测试工具·yolo·目标检测·计算机视觉·ai·pyqt
测试人社区-千羽2 小时前
Apple自动化测试基础设施(XCTest/XCUITest)面试深度解析
运维·人工智能·测试工具·面试·职场和发展·自动化·开源软件
测试人社区—小叶子3 小时前
移动开发新宠:用Flutter 4.0快速构建跨平台应用
运维·网络·人工智能·测试工具·flutter·自动化
数据科学小丫4 小时前
浏览器 driver (Chrome & Edge)驱动安装、Selenium 安装,使用Selenium进行网页自动化操作与数据抓取(Edge)
selenium·测试工具·自动化
测试19984 小时前
Selenium(Python web测试工具)基本用法详解
自动化测试·软件测试·python·selenium·测试工具·职场和发展·测试用例
测试人社区-千羽5 小时前
AI测试中的伦理考虑因素
运维·人工智能·opencv·测试工具·数据挖掘·自动化·开源软件
TDengine (老段)5 小时前
TDengine 新性能基准测试工具 taosgen
大数据·数据库·物联网·测试工具·时序数据库·tdengine·涛思数据
TTGGGFF6 小时前
爬虫专栏:破解网站检测selenium反爬——“当前环境正在被调试“”
爬虫·selenium·测试工具
我送炭你添花13 小时前
Pelco KBD300A 模拟器:03.Pelco-P 协议 8 字节完整拆解 + 与 Pelco-D 一一对应终极对照表
python·测试工具·运维开发