文本与 Chat
Live
在 ChatGPT 中打开
(opens in new tab)最后核对: 2026-08-11请求模型
发送有顺序的
messages 数组和已上线的文本模型 ID。支持 temperature,以及 max_tokens 或 max_completion_tokens(两个输出上限字段只能传一个);Grok、DeepSeek V4.1 Flash、GLM 5.3 和 GLM 5.3 Flash 还支持 OpenAI-compatible 的 tools、tool_choice、parallel_tool_calls 与 response_format。Grok 4.5 的 reasoning_effort 可取 low、medium 或 high;GLM 5.3 与 GLM 5.3 Flash 可取 low、high 或 max。Papaya 1.0(modelrush/papaya-1.0)适用于文本对话和流式输出,不支持工具或函数调用,也不在 ModelRush Agent 中提供。Papaya 请求只要包含 tools、tool_choice、parallel_tool_calls、functions 或 function_call(即使为空或 false),或包含工具调用历史(tool 或 function 角色消息、tool_calls、tool_call_id 或 function_call),都会在计费前返回 400 unsupported_parameter,并在 param 中标明出错字段;图片内容、response_format 和 reasoning_effort 同样会在计费前直接返回 400,任一输出上限字段最大为 8,192。不传 stream 时返回 JSON Completion;传 stream: true 时返回 OpenAI-compatible Server-Sent Events,并接受 stream_options.include_usage。兼容客户端也可发送 store: false。bashcurl https://api.modelrush.ai/v1/chat/completions \-H "Authorization: Bearer $MODELRUSH_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "modelrush/deepseek-v4.1-flash","messages": [{"role": "user", "content": "Return exactly: ModelRush connected"}]}'
bashcurl https://api.modelrush.ai/v1/chat/completions \-H "Authorization: Bearer $MODELRUSH_API_KEY" \-H "Content-Type: application/json" \-d '{"model":"modelrush/deepseek-v4.1-flash","messages":[{"role":"user","content":"流式返回一个简短答案"}],"stream":true}'
响应契约
响应遵循 Chat Completions 结构,包含
id、model、choices 与 usage。请保存响应 ID,用于支持与对账。限制
ModelRush 不设置全局消息条数上限,也绝不会静默截断、合并、删除或重排对话历史。实际容量由所选模型的上下文窗口、公开的请求体大小限制,以及为该模型 Operation 明确声明的 Provider 特定限制决定。请从
GET /models 读取版本化限制,不要把某个模型的上下文窗口或输出上限复制给其他集成。请求体过大返回 request_too_large;超过上下文窗口返回 context_length_exceeded。