---
title: "聊天补全-OpenRouter Chat API-API黄页|万维易源ShowAPI"
canonical_url: "https://www.showapi.com/playground/openrouter/openrouter/openrouter-chat"
last_updated: "2026-10-14T17:28:09.978Z"
meta:
  description: "通过OpenRouter Chat API轻松集成多模型聊天补全功能，支持高级请求选项，为开发者提供灵活高效的AI交互解决方案。"
  keywords: "OpenRouter API，聊天补全API，AI模型集成，多模型聊天接口，开发者API接入"
  "og:description": "通过OpenRouter Chat API轻松集成多模型聊天补全功能，支持高级请求选项，为开发者提供灵活高效的AI交互解决方案。"
  "og:title": "聊天补全-OpenRouter Chat API-API黄页|万维易源ShowAPI"
  "twitter:description": "通过OpenRouter Chat API轻松集成多模型聊天补全功能，支持高级请求选项，为开发者提供灵活高效的AI交互解决方案。"
  "twitter:title": "聊天补全-OpenRouter Chat API-API黄页|万维易源ShowAPI"
---

# **OpenRouter Chat API**

[OpenRouter-OpenRouter](https://www.showapi.com/playground/openrouter/openrouter) [ 产品首页](https://openrouter.ai/docs/api-reference/overview) [API文档](https://openrouter.ai/docs/api-reference/overview) [应用示例](https://www.showapi.com/aiapp/openrouter/openrouter/openrouter-chat.html)

4593

2025-08-13更新

223 [提交收录](https://www.showapi.com/island/feedback-page?submitrequire=true) [反馈问题](https://www.showapi.com/island/feedback-page?apiurl=/playground/openrouter/openrouter/openrouter-chat) [ 创建我的API](https://www.showapi.com/playground)

OpenRouter Chat API 允许用户通过统一的请求和响应模式与多种语言模型进行交互。API 支持流式传输、模型路由、助手预填充等功能，并提供了详细的响应格式和错误处理机制。

**基础配置**

**Token****\***[去获取Token](https://openrouter.ai/settings/keys)

Bearer认证，形式为Bearer \<token>，其中token是您的认证令牌。

选择接入点：

**POST**

Run

**接入点文档：**[查看](https://openrouter.ai/docs/api-reference/chat-completion)

Run: Ctrl+

↵

接入点描述：发送聊天补全请求到选定模型。请求必须包含“messages”数组。支持所有基础请求的高级选项。

**请求参数**

**model****\***

要使用的模型ID。如果未指定，则使用用户的默认模型。

**messages\[0].content****\***

消息的内容。

**messages\[1].content****\***

消息的内容。

**max\_tokens**

最大令牌数，范围：\[1, context\_length)。

**temperature**

采样温度，范围：\[0, 2]。

**top\_p**

Top-p采样值，范围：(0, 1]。

**stream**

是否启用结果流式传输。

**frequency\_penalty**

频率惩罚，范围：\[-2, 2]。

**presence\_penalty**

存在惩罚，范围：\[-2, 2]。

**repetition\_penalty**

重复惩罚，范围：(0, 2]。

**min\_p**

最小概率阈值，范围：\[0, 1]。

**top\_a**

替代顶部采样参数，范围：\[0, 1]。

**top\_k**

Top-k采样值，范围：\[1, Infinity)。

**user**

用于标识您的终端用户的稳定标识符。用于帮助检测和防止滥用。

**返回结果**

当前为示例返回

返回体

返回头

**使用其他软件测试API**

您可以拷贝Curl语句，直接导入Postman进行测试

拷贝Curl语句