Skip to main content
POST
对话完成接口
Find a chat model and put its ID in model. GeekAI translates provider-specific formats into the OpenAI Chat Completions format. Function calling is available on supported models, except Baidu ERNIE and iFlytek Spark. For a custom GPT, use gpt-4-gizmo-*, replacing * with the GPT’s ID. For example, the ID in https://chatgpt.com/g/g-bo0FiWLY7-researchgpt is g-bo0FiWLY7. In addition to standard OpenAI fields, models may return search citations (citations), billable searches (billed_units), video content, and image/video input token counts. Use thinking to configure reasoning on supported models. The response shape depends on whether streaming is enabled. See Text chat for examples.

Authorizations

Authorization
string
header
required

API认证token

Body

application/json
model
string
default:gpt-5-mini
required

对话模型

messages
object[]
required

消息列表

Example:
enable_thinking
boolean
default:false

开启推理模式,仅支持切换思考模式的模型支持

thinking
object

推理模式细节配置

stream
boolean
default:false

是否返回流式响应,默认false

background
boolean
default:false

是否开启后台任务模式,默认false,注意 stream 和 background 不能同时为 true

是否启用联网搜索,默认false

search_config
object

联网搜索配置明细,仅智谱清言和不支持内置搜索工具的模型适用

enable_url_context
boolean
default:false

是否启用 URL Context,默认false,仅部分 Gemini 模型生效

temperature
number

温度参数,默认为代理模型默认值

max_completion_tokens
integer

最大输出token数,默认设置为当前模型最大支持输出

Example:

4096

json_mode
boolean
default:false

是否设置响应格式为JSON对象,默认false

response_format
Text · object

指定响应输出格式,默认不指定为文本输出,如果设置该配置项会覆盖json_mode设置

modalities
enum<string>[]

输出的多模态类型列表

Available options:
text,
image,
audio,
video
audio
object

音频输出配置

image
object

图像生成配置,仅 Gemini 3 Pro Image 适用

tools
array

可调用的工具函数列表

tool_choice

模型在生成响应时应如何选择使用哪个工具(或多个工具)

Available options:
none,
auto,
required
tool_config
object

工具函数调用配置(兼容gemini)

parallel_tool_calls
boolean
default:true

是否并发调用工具函数

image_generation
boolean
default:false

是否强制出图,仅支持对话画图的模型支持

stop
string[]

停止生成的触发词列表

logprobs
boolean
default:false

是否返回token概率

top_logprobs
integer

每个位置返回的最可能token数

Example:

2

frequency_penalty
number
default:0

频率惩罚系数

presence_penalty
number
default:0

存在惩罚系数

top_p
number
default:1

核采样阈值

top_k
integer
default:1

最高概率采样数

seed
integer

随机数种子

n
integer
default:1

生成结果数量

metadata
object

自定义元数据

sess_id
string<uuid>

第三方应用自行实现的会话ID

retries
integer
default:0

自动重试次数,默认0

Response

成功响应

id
string

请求ID

status
enum<string>

请求状态,只有后台模式才会返回

Available options:
pending,
running,
succeed
created
integer

请求创建Unix时间戳

model
string

对话使用的模型

object
string

响应对象类型

choices
object[]

生成的对话列表

usage
object

tokens消耗统计

citations
string[]

引用的文献/链接列表

system_fingerprint
string

系统指纹