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"
}
相关推荐
游戏开发爱好者83 小时前
Fiddler抓包工具完整教程 HTTPHTTPS抓包、代理配置与API调试实战技巧(开发者进阶指南)
前端·测试工具·ios·小程序·fiddler·uni-app·webview
MCM-RL1111115 小时前
自由落体颅脑损伤打击器 自由落体打击器 脑损伤打击器 自由颅脑损伤落体操作臂
嵌入式硬件·物联网·测试工具·安全·信号处理
AI绘画小335 小时前
【网络安全】Wireshark 抓包过滤:源 / 目的 IP 过滤 + 命令大全
数据库·tcp/ip·测试工具·安全·web安全·wireshark
Pixeler5 小时前
[特殊字符] Selenium 实战教程:等待与表单元素操作
chrome·selenium·测试工具
寻星探路6 小时前
测试开发漫谈12---性能测试工具
测试工具
A-刘晨阳6 小时前
【Windows压力测试工具】 - 使用微软官方工具进行压测 cpu、内存
运维·windows·测试工具·压力测试·cpustres·testlimit
基于底层的菜鸟8 小时前
网络抓包工具——tcpdump &&icmpv6抓包
网络·测试工具·tcpdump
IMPYLH15 小时前
Lua 的 collectgarbage 函数
开发语言·笔记·junit·单元测试·lua
newxtc1 天前
【中国石油和化工网-注册安全分析及升级报告】
人工智能·selenium·测试工具·安全·短信盗刷·石油和化工
IMPYLH1 天前
Lua 的 assert 函数
开发语言·笔记·junit·单元测试·lua