Note: For setting the chat model name, refer to System Supported Chat Model List. The request/response parameter structure is fully compatible with OpenAI. When switching models, you only need to modify the corresponding model name. If the model request/response parameters are inconsistent with OpenAI, GeekAI will automatically convert and align them. Except for Baidu ERNIE Bot and iFlytek Spark, all other platforms support function calling (the specific supported models are subject to platform restrictions). When calling the GPTs model API, you need to replace the * in gpt-4-gizmo-* with the corresponding GPTs’ gizmo_id, which can be obtained by extracting it from the GPTs URL. For example, for https://chatgpt.com/g/g-bo0FiWLY7-researchgpt, the corresponding gizmo_id is g-bo0FiWLY7.
The response data structure is fully compatible with OpenAI and builds upon it to add new features for adapting to other models. It provides support for cited links (citations), search billing units (billed_units), video in message content, image/video input tokens, and inference mode settings (thinking). The response structure changes depending on whether it is a streaming output or not. You can refer to the request examples below to make a judgment:
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"极客智坊","colors":{"primary":"#16A34A","light":"#07C983","dark":"#15803D"},"logo":{"light":"https://mintcdn.com/geekai/O3NwfoCr_3liylVV/logo/geekai-logo.png?fit=max\u0026auto=format\u0026n=O3NwfoCr_3liylVV\u0026q=85\u0026s=8edc923acd300ea2b9049b14795c8c7a","dark":"https://mintcdn.com/geekai/O3NwfoCr_3liylVV/logo/geekai-logo.png?fit=max\u0026auto=format\u0026n=O3NwfoCr_3liylVV\u0026q=85\u0026s=8edc923acd300ea2b9049b14795c8c7a"},"favicon":"https://mintcdn.com/geekai/O3NwfoCr_3liylVV/geekai-icon.webp?fit=max\u0026auto=format\u0026n=O3NwfoCr_3liylVV\u0026q=85\u0026s=b0091b79891520b5d274b34c5ea4e970","navbar":{"links":[{"href":"https://geekai.co/models","label":"模型广场"}],"primary":{"type":"button","label":"模型对话","href":"https://geekai.co/chat"}},"seo":{"metatags":{"og:image":"/geekai-icon.webp"},"indexing":"all"},"styling":{"latex":false},"navigation":{"languages":[{"language":"cn","href":"cn/docs/introduction"},{"language":"en","href":"en/docs/introduction"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"geekai","hasAudioNarration":false,"actualSubdomain":"geekai","customDomains":["docs.geekai.co"],"gitSource":{"type":"github","owner":"geekai-pub","repo":"geekai-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6aecba4ce142d265493aaba0","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"cn","tag":"画图模型","count":44},{"language":"cn","tag":"视频模型","count":42},{"language":"cn","tag":"API手册","count":37},{"language":"cn","tag":"文本模型","count":36},{"language":"cn","tag":"第三方集成","count":26},{"language":"cn","tag":"第三方应用集成","count":26},{"language":"en","tag":"API Reference","count":24},{"language":"cn","tag":"Chat API","count":14},{"language":"en","tag":"Use Cases","count":13},{"language":"en","tag":"AI Apps","count":13},{"language":"cn","tag":"字节豆包","count":10},{"language":"cn","tag":"可灵AI","count":10},{"language":"cn","tag":"语音模型","count":9},{"language":"en","tag":"User Guides","count":7},{"language":"en","tag":"Getting Started","count":7},{"language":"en","tag":"API KEY","count":6},{"language":"en","tag":"Agent","count":5},{"language":"en","tag":"Chat","count":3},{"language":"en","tag":"Audio","count":2},{"language":"en","tag":"File","count":2}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"en/api/chat","slug":"/en/api/chat","pageMetadata":{"title":"Chat Completions","openapi":"openapi.yaml POST /chat/completions","sidebarTitle":"Chat","description":null,"href":"/en/api/chat"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsx(Note,{children:_jsxs(_components.p,{children:[`Note: For setting the chat model name, refer to `,_jsx(_components.a,{href:`https://geekai.dev/models`,children:`System Supported Chat Model List`}),`. The request/response parameter structure is fully compatible with `,_jsx(_components.a,{href:`https://platform.openai.com/docs/api-reference/chat/create`,children:`OpenAI`}),`. When switching models, you only need to modify the corresponding model name. If the model request/response parameters are inconsistent with OpenAI, GeekAI will automatically convert and align them. Except for Baidu ERNIE Bot and iFlytek Spark, all other platforms support function calling (the specific supported models are subject to platform restrictions). When calling the GPTs model API, you need to replace the * in gpt-4-gizmo-* with the corresponding GPTs’ gizmo_id, which can be obtained by extracting it from the GPTs URL. For example, for `,_jsx(_components.a,{href:`https://chatgpt.com/g/g-bo0FiWLY7-researchgpt`,children:`https://chatgpt.com/g/g-bo0FiWLY7-researchgpt`}),`, the corresponding gizmo_id is g-bo0FiWLY7.`]})}),`\n`,_jsxs(_components.p,{children:[`The response data structure is fully compatible with OpenAI and builds upon it to add new features for adapting to other models. It provides support for cited links (`,_jsx(_components.code,{children:`citations`}),`), search billing units (`,_jsx(_components.code,{children:`billed_units`}),`), video in message content, image/video input tokens, and inference mode settings (`,_jsx(_components.code,{children:`thinking`}),`). The response structure changes depending on whether it is a streaming output or not. You can refer to the request examples below to make a judgment:`]}),`\n`,_jsx(Heading,{level:`3`,id:`curl-request-example`,children:`cURL Request Example`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --location`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://geekai.dev/api/v1/chat/completions'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization: Bearer {YOUR_GEEKAI_API_KEY}'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--data-raw `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"gpt-4o-mini\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"role\": \"user\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\": \"hi\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"stream\": false`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`})}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Chat Completions","openapi":"openapi.yaml POST /chat/completions","sidebarTitle":"Chat","description":null,"href":"/en/api/chat"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"cURL Request Example","slug":"curl-request-example","depth":3,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Chat"],"summary":"对话完成接口","description":"用于创建对话完成的接口,支持多种对话模型,可配置各种参数来控制响应的生成。","operationId":"createChatCompletion","requestBody":"80bce497-0661-4d57-aa56-e0fa05992ecc","responses":{"200":"8682aeef-461a-4eed-b6e2-0a5a764ee4a0","400":"f3a1cfab-d811-4f2b-8358-72a8dc6d9743","401":"32bd4d86-bd78-4d3b-a741-344ca77a8791","500":"48f52648-57a4-4c52-b7c1-0e49d48ebf53"},"method":"post","type":"path","servers":["4c6526f1-81af-4587-a055-b547f5a24663","26977d9e-6f12-4ba8-8c98-247e40469cde"],"security":["95aa0bd3-1099-4210-a04d-4044d6d6483a","933f3577-fcbb-4964-9c06-f299eab749cc"],"path":"/chat/completions","baseUrlOptions":["https://geekai.co/api/v1","https://geekai.dev/api/v1"],"title":"对话完成接口","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","description":"对话模型","default":"gpt-5-mini","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"messages":{"type":"array","description":"消息列表","items":{"type":"object","required":["content","role"],"properties":{"content":{"oneOf":[{"type":"string","description":"文本格式消息内容","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","enum":["text"],"description":"内容类型","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"},"text":{"type":"string","description":"文本内容","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.0.text","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","required":["type","image_url"],"properties":{"type":{"type":"string","enum":["image_url"],"description":"内容类型","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"image_url":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"图片URL或Base64编码的图片数据","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"}},"description":"图片URL对象","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1.image_url","typeLabel":"object"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1","typeLabel":"object"},{"type":"object","required":["type","input_audio"],"properties":{"type":{"type":"string","enum":["input_audio"],"description":"内容类型","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.2.type","typeLabel":"enum\u003cstring>"},"input_audio":{"type":"object","required":["data","format"],"properties":{"data":{"type":"string","description":"Base64编码的音频数据","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.2.input_audio.data","typeLabel":"string"},"format":{"type":"string","description":"内容类型,目前仅支持 wav/mp3 格式","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.2.input_audio.format","typeLabel":"string"}},"description":"音频数据对象","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.2.input_audio","typeLabel":"object"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.2","typeLabel":"object"},{"type":"object","required":["type","video_url"],"properties":{"type":{"type":"string","enum":["video_url"],"description":"内容类型","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.3.type","typeLabel":"enum\u003cstring>"},"video_url":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"视频URL","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.3.video_url.url","typeLabel":"string"}},"description":"视频URL对象","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.3.video_url","typeLabel":"object"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.3","typeLabel":"object"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX]","typeLabel":"object"},"description":"多模态消息内容","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1","typeLabel":"object[]"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content","typeLabel":"string | object[]"},"role":{"type":"string","description":"消息角色","enum":["system","user","assistant"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"example":[{"content":"你是一个助手","role":"system"},{"content":"你好","role":"user"}],"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"enable_thinking":{"type":"boolean","description":"开启推理模式,仅支持切换思考模式的模型支持","default":false,"uniqueKey":"enable_thinking","typeLabel":"boolean"},"thinking":{"type":"object","description":"推理模式细节配置","properties":{"type":{"type":"string","description":"推理模式类型","enum":["enabled","disabled","adaptive"],"default":"adaptive","uniqueKey":"thinking.type","typeLabel":"enum\u003cstring>"},"include_thoughts":{"type":"boolean","description":"是否显示思考链内容,默认false","default":false,"uniqueKey":"thinking.include_thoughts","typeLabel":"boolean"},"budget_tokens":{"type":"integer","description":"推理模式token预算,新模型逐步废弃,改用reasoning_effort/thinking_level","default":16000,"uniqueKey":"thinking.budget_tokens","typeLabel":"integer"},"reasoning_effort":{"type":"string","description":"推理模式推理努力程度,适用于 OpenAI 和兼容 OpenAI 对话接口的其他推理模型","enum":["none","minimal","low","medium","high","xhigh","max"],"default":"medium","uniqueKey":"thinking.reasoning_effort","typeLabel":"enum\u003cstring>"},"thinking_level":{"type":"string","description":"推理模式思考层级,适用于 Gemini 3","enum":["minimal","low","medium","high"],"default":"high","uniqueKey":"thinking.thinking_level","typeLabel":"enum\u003cstring>"}},"uniqueKey":"thinking","typeLabel":"object"},"stream":{"type":"boolean","description":"是否返回流式响应,默认false","default":false,"uniqueKey":"stream","typeLabel":"boolean"},"background":{"type":"boolean","description":"是否开启后台任务模式,默认false,注意 stream 和 background 不能同时为 true","default":false,"uniqueKey":"background","typeLabel":"boolean"},"enable_search":{"type":"boolean","description":"是否启用联网搜索,默认false","default":false,"uniqueKey":"enable_search","typeLabel":"boolean"},"search_config":{"type":"object","description":"联网搜索配置明细,仅智谱清言和不支持内置搜索工具的模型适用","properties":{"engine":{"type":"string","description":"搜索引擎","enum":["glm/search-std","glm/search-pro","glm/search-pro-sogou","glm/search-pro-quark"],"default":"glm/search-std","uniqueKey":"search_config.engine","typeLabel":"enum\u003cstring>"},"prompt":{"type":"string","description":"定制搜索结果处理的提示语","uniqueKey":"search_config.prompt","typeLabel":"string"},"intent":{"type":"boolean","description":"启用搜索意图","default":false,"uniqueKey":"search_config.intent","typeLabel":"boolean"},"count":{"type":"integer","description":"搜索结果数量, 取值范围1-50","default":10,"uniqueKey":"search_config.count","typeLabel":"integer"},"domain_filter":{"type":"string","description":"搜索结果域名过滤白名单","uniqueKey":"search_config.domain_filter","typeLabel":"string"},"recency_filter":{"type":"string","description":"搜索结果时间过滤","enum":["noLimit","oneDay","oneWeek","oneMonth","oneYear"],"default":"noLimit","uniqueKey":"search_config.recency_filter","typeLabel":"enum\u003cstring>"},"content_size":{"type":"string","description":"搜索结果摘要长度","enum":["medium","high"],"default":"medium","uniqueKey":"search_config.content_size","typeLabel":"enum\u003cstring>"},"return_result":{"type":"boolean","description":"是否返回搜索结果","default":false,"uniqueKey":"search_config.return_result","typeLabel":"boolean"},"result_sequence":{"type":"string","description":"搜索结果在对话响应中的位置,主要用于流式响应,位于真正回答内容之前还是之后","enum":["before","after"],"default":"after","uniqueKey":"search_config.result_sequence","typeLabel":"enum\u003cstring>"},"require_search":{"type":"boolean","description":"是否强制要求必须有搜索结果才进行回答","default":false,"uniqueKey":"search_config.require_search","typeLabel":"boolean"},"deepable":{"type":"boolean","description":"是否开启深度搜索(目前未生效)","default":false,"uniqueKey":"search_config.deepable","typeLabel":"boolean"}},"uniqueKey":"search_config","typeLabel":"object"},"enable_url_context":{"type":"boolean","description":"是否启用 URL Context,默认false,仅部分 Gemini 模型生效","default":false,"uniqueKey":"enable_url_context","typeLabel":"boolean"},"temperature":{"type":"number","description":"温度参数,默认为代理模型默认值","uniqueKey":"temperature","typeLabel":"number"},"max_completion_tokens":{"type":"integer","description":"最大输出token数,默认设置为当前模型最大支持输出","example":4096,"uniqueKey":"max_completion_tokens","typeLabel":"integer"},"json_mode":{"type":"boolean","description":"是否设置响应格式为JSON对象,默认false","default":false,"uniqueKey":"json_mode","typeLabel":"boolean"},"response_format":{"oneOf":[{"type":"object","title":"Text","description":"指定响应输出格式,默认不指定为文本输出,如果设置该配置项会覆盖json_mode设置","required":["type"],"properties":{"type":{"type":"string","description":"正在定义的响应格式的类型。始终为 `text`。","enum":["text"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"response_format.oneOf.0.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"response_format.oneOf.0","typeLabel":"Text · object"},{"type":"object","title":"JSON object","description":"指定响应输出格式,默认不指定为文本输出,如果设置该配置项会覆盖json_mode设置","required":["type"],"properties":{"type":{"type":"string","description":"正在定义的响应格式的类型。始终为 `json_object`。","enum":["json_object"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"response_format.oneOf.1.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"response_format.oneOf.1","typeLabel":"JSON object · object"},{"type":"object","title":"JSON schema","description":"指定响应输出格式,默认不指定为文本输出,如果设置该配置项会覆盖json_mode设置","required":["type","json_schema"],"properties":{"type":{"type":"string","description":"正在定义的响应格式的类型。始终为 `json_schema`。","enum":["json_schema"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"response_format.oneOf.2.type","typeLabel":"enum\u003cstring>"},"json_schema":{"type":"object","title":"JSON schema","description":"结构化输出配置选项,包括 JSON Schema。\n","properties":{"name":{"type":"string","description":"响应格式的名称。必须是 a-z、A-Z、0-9,或包含下划线和破折号,且最大长度为 64。\n","isRequired":true,"uniqueKey":"response_format.oneOf.2.json_schema.name","typeLabel":"string"},"description":{"type":"string","description":"响应格式的描述,用于模型确定如何以该格式进行响应。\n","uniqueKey":"response_format.oneOf.2.json_schema.description","typeLabel":"string"},"schema":{"type":"object","title":"JSON schema","description":"响应格式的模式,描述为 JSON Schema 对象。\n了解有关如何构建 JSON Schema 的更多信息 [here](https://json-schema.org/)。\n","additionalProperties":true,"uniqueKey":"response_format.oneOf.2.json_schema.schema","typeLabel":"JSON schema · object"},"strict":{"oneOf":[{"type":"boolean","default":false,"description":"是否在生成输出时启用严格的模式遵循。\n如果设置为 true,模型将始终遵循 `schema` 字段中定义的确切模式。\n当 `strict` 为 `true` 时,仅支持 JSON Schema 的子集。\n要了解更多信息,请阅读 [结构化输出指南](/docs/guides/structured-outputs)。\n","uniqueKey":"response_format.oneOf.2.json_schema.strict.oneOf.0","typeLabel":"boolean"},{"type":"null","default":false,"description":"是否在生成输出时启用严格的模式遵循。\n如果设置为 true,模型将始终遵循 `schema` 字段中定义的确切模式。\n当 `strict` 为 `true` 时,仅支持 JSON Schema 的子集。\n要了解更多信息,请阅读 [结构化输出指南](/docs/guides/structured-outputs)。\n","uniqueKey":"response_format.oneOf.2.json_schema.strict.oneOf.1","typeLabel":"null"}],"uniqueKey":"response_format.oneOf.2.json_schema.strict","typeLabel":"boolean | null"}},"required":["name"],"isRequired":true,"uniqueKey":"response_format.oneOf.2.json_schema","typeLabel":"JSON schema · object"}},"uniqueKey":"response_format.oneOf.2","typeLabel":"JSON schema · object"}],"uniqueKey":"response_format","typeLabel":"Text · object | JSON object · object | JSON schema · object"},"modalities":{"type":"array","description":"输出的多模态类型列表","items":{"type":"string","enum":["text","image","audio","video"],"uniqueKey":"modalities.items.[INDEX]","typeLabel":"enum\u003cstring>"},"uniqueKey":"modalities","typeLabel":"enum\u003cstring>[]"},"audio":{"type":"object","description":"音频输出配置","properties":{"voice":{"type":"string","description":"音色","default":"alloy","uniqueKey":"audio.voice","typeLabel":"string"},"format":{"type":"string","description":"音频格式","default":"wav","uniqueKey":"audio.format","typeLabel":"string"}},"uniqueKey":"audio","typeLabel":"object"},"image":{"type":"object","description":"图像生成配置,仅 Gemini 3 Pro Image 适用","properties":{"aspect_ratio":{"type":"string","description":"图片宽高比","enum":["1:1","4:3","3:4","16:9","9:16"],"uniqueKey":"image.aspect_ratio","typeLabel":"enum\u003cstring>"},"image_size":{"type":"string","description":"图像分辨率","enum":["1K","2K","4K"],"default":"1K","uniqueKey":"image.image_size","typeLabel":"enum\u003cstring>"}},"uniqueKey":"image","typeLabel":"object"},"tools":{"type":"array","description":"可调用的工具函数列表","uniqueKey":"tools","typeLabel":"array"},"tool_choice":{"oneOf":[{"type":"string","title":"工具选择模式","description":"模型在生成响应时应如何选择使用哪个工具(或多个工具)","enum":["none","auto","required"],"uniqueKey":"tool_choice.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"object","title":"托管工具","description":"模型在生成响应时应如何选择使用哪个工具(或多个工具)","required":["type"],"properties":{"type":{"type":"string","description":"模型应使用的托管工具的类型。详细了解\n[内置工具](/docs/guides/tools)。\n\n允许的值为:\n- `file_search`\n- `web_search_preview`\n- `computer_use_preview`\n- `code_interpreter`\n- `mcp`\n- `image_generation`\n","enum":["file_search","web_search_preview","computer_use_preview","web_search_preview_2025_03_11","image_generation","code_interpreter","mcp"],"isRequired":true,"uniqueKey":"tool_choice.oneOf.1.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"tool_choice.oneOf.1","typeLabel":"托管工具 · object"},{"type":"object","title":"函数工具","description":"模型在生成响应时应如何选择使用哪个工具(或多个工具)","required":["type","name"],"properties":{"type":{"type":"string","enum":["function"],"description":"对于函数调用,类型始终为 `function`。","x-stainless-const":true,"isRequired":true,"uniqueKey":"tool_choice.oneOf.2.type","typeLabel":"enum\u003cstring>"},"name":{"type":"string","description":"要调用的函数的名称。","isRequired":true,"uniqueKey":"tool_choice.oneOf.2.name","typeLabel":"string"}},"uniqueKey":"tool_choice.oneOf.2","typeLabel":"函数工具 · object"}],"uniqueKey":"tool_choice","typeLabel":"enum\u003cstring> | 托管工具 · object | 函数工具 · object"},"tool_config":{"type":"object","description":"工具函数调用配置(兼容gemini)","properties":{"functionCallingConfig":{"type":"object","description":"函数调用配置","properties":{"mode":{"type":"string","description":"函数调用模式","enum":["AUTO","ANY","NONE","VALIDATED"],"default":"AUTO","uniqueKey":"tool_config.functionCallingConfig.mode","typeLabel":"enum\u003cstring>"},"allowedFunctionNames":{"type":"array","description":"允许调用的函数名称列表","items":{"type":"string","uniqueKey":"tool_config.functionCallingConfig.allowedFunctionNames.items.[INDEX]","typeLabel":"string"},"uniqueKey":"tool_config.functionCallingConfig.allowedFunctionNames","typeLabel":"string[]"}},"uniqueKey":"tool_config.functionCallingConfig","typeLabel":"object"}},"uniqueKey":"tool_config","typeLabel":"object"},"parallel_tool_calls":{"type":"boolean","description":"是否并发调用工具函数","default":true,"uniqueKey":"parallel_tool_calls","typeLabel":"boolean"},"image_generation":{"type":"boolean","description":"是否强制出图,仅支持对话画图的模型支持","default":false,"uniqueKey":"image_generation","typeLabel":"boolean"},"stop":{"type":"array","description":"停止生成的触发词列表","items":{"type":"string","uniqueKey":"stop.items.[INDEX]","typeLabel":"string"},"uniqueKey":"stop","typeLabel":"string[]"},"logprobs":{"type":"boolean","description":"是否返回token概率","default":false,"uniqueKey":"logprobs","typeLabel":"boolean"},"top_logprobs":{"type":"integer","description":"每个位置返回的最可能token数","example":2,"uniqueKey":"top_logprobs","typeLabel":"integer"},"frequency_penalty":{"type":"number","description":"频率惩罚系数","default":0,"uniqueKey":"frequency_penalty","typeLabel":"number"},"presence_penalty":{"type":"number","description":"存在惩罚系数","default":0,"uniqueKey":"presence_penalty","typeLabel":"number"},"top_p":{"type":"number","description":"核采样阈值","default":1,"uniqueKey":"top_p","typeLabel":"number"},"top_k":{"type":"integer","description":"最高概率采样数","default":1,"uniqueKey":"top_k","typeLabel":"integer"},"seed":{"type":"integer","description":"随机数种子","uniqueKey":"seed","typeLabel":"integer"},"n":{"type":"integer","description":"生成结果数量","default":1,"uniqueKey":"n","typeLabel":"integer"},"metadata":{"type":"object","description":"自定义元数据","uniqueKey":"metadata","typeLabel":"object"},"sess_id":{"type":"string","description":"第三方应用自行实现的会话ID","format":"uuid","uniqueKey":"sess_id","typeLabel":"string\u003cuuid>"},"retries":{"type":"integer","description":"自动重试次数,默认0","default":0,"uniqueKey":"retries","typeLabel":"integer"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"model":"gpt-5-mini","messages":[{"content":"你是一个助手","role":"system"},{"content":"你好","role":"user"}],"enable_thinking":false,"thinking":{"type":"adaptive","include_thoughts":false,"budget_tokens":16000,"reasoning_effort":"medium","thinking_level":"high"},"stream":false,"background":false,"enable_search":false,"search_config":{"engine":"glm/search-std","prompt":"\u003cstring>","intent":false,"count":10,"domain_filter":"\u003cstring>","recency_filter":"noLimit","content_size":"medium","return_result":false,"result_sequence":"after","require_search":false,"deepable":false},"enable_url_context":false,"temperature":123,"max_completion_tokens":4096,"json_mode":false,"response_format":{"type":"text"},"modalities":[],"audio":{"voice":"alloy","format":"wav"},"image":{"image_size":"1K"},"tools":"\u003carray>","tool_config":{"functionCallingConfig":{"mode":"AUTO","allowedFunctionNames":["\u003cstring>"]}},"parallel_tool_calls":true,"image_generation":false,"stop":["\u003cstring>"],"logprobs":false,"top_logprobs":2,"frequency_penalty":0,"presence_penalty":0,"top_p":1,"top_k":1,"seed":123,"n":1,"metadata":{},"sess_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","retries":0}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"8682aeef-461a-4eed-b6e2-0a5a764ee4a0":{"description":"成功响应","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"请求ID","uniqueKey":"id","typeLabel":"string"},"status":{"type":"string","description":"请求状态,只有后台模式才会返回","enum":["pending","running","succeed"],"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"created":{"type":"integer","description":"请求创建Unix时间戳","uniqueKey":"created","typeLabel":"integer"},"model":{"type":"string","description":"对话使用的模型","uniqueKey":"model","typeLabel":"string"},"object":{"type":"string","description":"响应对象类型","uniqueKey":"object","typeLabel":"string"},"choices":{"type":"array","description":"生成的对话列表","items":{"type":"object","properties":{"index":{"type":"integer","description":"对话索引","uniqueKey":"choices.items.[INDEX].index","typeLabel":"integer"},"message":{"type":"object","description":"生成的消息","properties":{"role":{"type":"string","enum":["assistant"],"description":"角色","uniqueKey":"choices.items.[INDEX].message.role","typeLabel":"enum\u003cstring>"},"content":{"type":"string","description":"响应内容","uniqueKey":"choices.items.[INDEX].message.content","typeLabel":"string"},"reasoning_content":{"type":"string","description":"推理内容","uniqueKey":"choices.items.[INDEX].message.reasoning_content","typeLabel":"string"},"image":{"type":"string","description":"图片URL/Base64数据","uniqueKey":"choices.items.[INDEX].message.image","typeLabel":"string"},"audio":{"type":"object","description":"音频数据","properties":{"id":{"type":"string","description":"音频唯一识别码","uniqueKey":"choices.items.[INDEX].message.audio.id","typeLabel":"string"},"data":{"type":"string","description":"Base64编码的音频数据","uniqueKey":"choices.items.[INDEX].message.audio.data","typeLabel":"string"},"expires_at":{"type":"integer","description":"过期Unix时间戳","uniqueKey":"choices.items.[INDEX].message.audio.expires_at","typeLabel":"integer"},"transcript":{"type":"string","description":"音频转录文本","uniqueKey":"choices.items.[INDEX].message.audio.transcript","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX].message.audio","typeLabel":"object"},"tool_calls":{"type":"array","description":"工具函数调用列表","items":{"type":"object","properties":{"id":{"type":"string","description":"工具ID","uniqueKey":"choices.items.[INDEX].message.tool_calls.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","enum":["function"],"description":"工具类型","uniqueKey":"choices.items.[INDEX].message.tool_calls.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"function":{"type":"object","description":"工具函数","properties":{"name":{"type":"string","description":"函数名称","uniqueKey":"choices.items.[INDEX].message.tool_calls.items.[INDEX].function.name","typeLabel":"string"},"arguments":{"type":"string","description":"函数参数","uniqueKey":"choices.items.[INDEX].message.tool_calls.items.[INDEX].function.arguments","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX].message.tool_calls.items.[INDEX].function","typeLabel":"object"}},"uniqueKey":"choices.items.[INDEX].message.tool_calls.items.[INDEX]","typeLabel":"object"},"uniqueKey":"choices.items.[INDEX].message.tool_calls","typeLabel":"object[]"}},"uniqueKey":"choices.items.[INDEX].message","typeLabel":"object"},"finish_reason":{"type":"string","enum":["stop","length","tool_calls","content_filter","stop_sequence","error"],"description":"结束原因","uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"enum\u003cstring>"},"logprobs":{"type":"object","description":"日志概率","properties":{"content":{"type":"array","description":"消息内容标记列表","items":{"type":"object","properties":{"token":{"type":"string","description":"令牌","uniqueKey":"choices.items.[INDEX].logprobs.content.items.[INDEX].token","typeLabel":"string"},"logprob":{"type":"number","description":"对数概率","uniqueKey":"choices.items.[INDEX].logprobs.content.items.[INDEX].logprob","typeLabel":"number"},"bytes":{"type":"array","description":"表示 UTF-8 字节编码的整数列表,代表该标记","items":{"type":"integer","uniqueKey":"choices.items.[INDEX].logprobs.content.items.[INDEX].bytes.items.[INDEX]","typeLabel":"integer"},"uniqueKey":"choices.items.[INDEX].logprobs.content.items.[INDEX].bytes","typeLabel":"integer[]"},"top_logprobs":{"type":"array","description":"最有可能的标记及其在此位置的对数概率列表","items":{"type":"object","properties":{"token":{"type":"string","description":"令牌","uniqueKey":"choices.items.[INDEX].logprobs.content.items.[INDEX].top_logprobs.items.[INDEX].token","typeLabel":"string"},"logprob":{"type":"number","description":"对数概率","uniqueKey":"choices.items.[INDEX].logprobs.content.items.[INDEX].top_logprobs.items.[INDEX].logprob","typeLabel":"number"},"bytes":{"type":"array","description":"表示 UTF-8 字节编码的整数列表,代表该标记","items":{"type":"integer","uniqueKey":"choices.items.[INDEX].logprobs.content.items.[INDEX].top_logprobs.items.[INDEX].bytes.items.[INDEX]","typeLabel":"integer"},"uniqueKey":"choices.items.[INDEX].logprobs.content.items.[INDEX].top_logprobs.items.[INDEX].bytes","typeLabel":"integer[]"}},"uniqueKey":"choices.items.[INDEX].logprobs.content.items.[INDEX].top_logprobs.items.[INDEX]","typeLabel":"object"},"uniqueKey":"choices.items.[INDEX].logprobs.content.items.[INDEX].top_logprobs","typeLabel":"object[]"}},"uniqueKey":"choices.items.[INDEX].logprobs.content.items.[INDEX]","typeLabel":"object"},"uniqueKey":"choices.items.[INDEX].logprobs.content","typeLabel":"object[]"}},"uniqueKey":"choices.items.[INDEX].logprobs","typeLabel":"object"}},"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"uniqueKey":"choices","typeLabel":"object[]"},"usage":{"type":"object","description":"tokens消耗统计","properties":{"prompt_tokens":{"type":"integer","description":"输入文本token数","uniqueKey":"usage.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","description":"生成文本token数","uniqueKey":"usage.completion_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","description":"总token数","uniqueKey":"usage.total_tokens","typeLabel":"integer"},"billed_units":{"type":"integer","description":"计费次数(搜索)","uniqueKey":"usage.billed_units","typeLabel":"integer"},"prompt_tokens_details":{"type":"object","description":"输入文本消耗明细","properties":{"text_tokens":{"type":"integer","description":"文本token数","uniqueKey":"usage.prompt_tokens_details.text_tokens","typeLabel":"integer"},"audio_tokens":{"type":"integer","description":"音频token数","uniqueKey":"usage.prompt_tokens_details.audio_tokens","typeLabel":"integer"},"cached_tokens":{"type":"integer","description":"缓存token数","uniqueKey":"usage.prompt_tokens_details.cached_tokens","typeLabel":"integer"},"image_tokens":{"type":"integer","description":"图片token数","uniqueKey":"usage.prompt_tokens_details.image_tokens","typeLabel":"integer"},"video_tokens":{"type":"integer","description":"视频token数","uniqueKey":"usage.prompt_tokens_details.video_tokens","typeLabel":"integer"},"citation_tokens":{"type":"integer","description":"引用token数","uniqueKey":"usage.prompt_tokens_details.citation_tokens","typeLabel":"integer"}},"uniqueKey":"usage.prompt_tokens_details","typeLabel":"object"},"completion_tokens_details":{"type":"object","description":"生成文本消耗明细","properties":{"text_tokens":{"type":"integer","description":"文本token数","uniqueKey":"usage.completion_tokens_details.text_tokens","typeLabel":"integer"},"audio_tokens":{"type":"integer","description":"音频token数","uniqueKey":"usage.completion_tokens_details.audio_tokens","typeLabel":"integer"},"reasoning_tokens":{"type":"integer","description":"推理token数","uniqueKey":"usage.completion_tokens_details.reasoning_tokens","typeLabel":"integer"},"accepted_prediction_tokens":{"type":"integer","description":"接受的预测token数","uniqueKey":"usage.completion_tokens_details.accepted_prediction_tokens","typeLabel":"integer"},"rejected_prediction_tokens":{"type":"integer","description":"拒绝的预测token数","uniqueKey":"usage.completion_tokens_details.rejected_prediction_tokens","typeLabel":"integer"}},"uniqueKey":"usage.completion_tokens_details","typeLabel":"object"}},"uniqueKey":"usage","typeLabel":"object"},"citations":{"type":"array","description":"引用的文献/链接列表","items":{"type":"string","uniqueKey":"citations.items.[INDEX]","typeLabel":"string"},"uniqueKey":"citations","typeLabel":"string[]"},"system_fingerprint":{"description":"系统指纹","type":"string","uniqueKey":"system_fingerprint","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","status":"pending","created":123,"model":"\u003cstring>","object":"\u003cstring>","choices":[{"index":123,"message":{"role":"assistant","content":"\u003cstring>","reasoning_content":"\u003cstring>","image":"\u003cstring>","audio":{"id":"\u003cstring>","data":"\u003cstring>","expires_at":123,"transcript":"\u003cstring>"},"tool_calls":[{"id":"\u003cstring>","type":"function","function":{"name":"\u003cstring>","arguments":"\u003cstring>"}}]},"finish_reason":"stop","logprobs":{"content":[{"token":"\u003cstring>","logprob":123,"bytes":[123],"top_logprobs":[{"token":"\u003cstring>","logprob":123,"bytes":[123]}]}]}}],"usage":{"prompt_tokens":123,"completion_tokens":123,"total_tokens":123,"billed_units":123,"prompt_tokens_details":{"text_tokens":123,"audio_tokens":123,"cached_tokens":123,"image_tokens":123,"video_tokens":123,"citation_tokens":123},"completion_tokens_details":{"text_tokens":123,"audio_tokens":123,"reasoning_tokens":123,"accepted_prediction_tokens":123,"rejected_prediction_tokens":123}},"citations":["\u003cstring>"],"system_fingerprint":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"f3a1cfab-d811-4f2b-8358-72a8dc6d9743":{"description":"参数验证错误","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","example":"validation_error","uniqueKey":"code","typeLabel":"string"},"message":{"type":"string","example":"参数验证失败","uniqueKey":"message","typeLabel":"string"},"details":{"type":"object","additionalProperties":{"type":"string","uniqueKey":"details.additionalProperties","typeLabel":"string"},"example":{"field":"错误描述"},"uniqueKey":"details","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"validation_error","message":"参数验证失败","details":{"field":"错误描述"}}}},"exampleType":"generated"}},"exampleType":"generated"},"32bd4d86-bd78-4d3b-a741-344ca77a8791":{"description":"未授权","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","example":"unauthorized","uniqueKey":"code","typeLabel":"string"},"message":{"type":"string","example":"Invalid API key or token","uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"unauthorized","message":"Invalid API key or token"}}},"exampleType":"generated"}},"exampleType":"generated"},"48f52648-57a4-4c52-b7c1-0e49d48ebf53":{"description":"标准错误响应","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"错误代码","example":"invalid_request","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"message":{"type":"string","description":"错误信息描述","example":"请求参数不合法","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"invalid_request","message":"请求参数不合法"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"95aa0bd3-1099-4210-a04d-4044d6d6483a":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"API认证token","scopes":[],"schemeName":"bearerAuth"}},"933f3577-fcbb-4964-9c06-f299eab749cc":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"GeekAI-API-Key","description":"API密钥认证","scopes":[],"schemeName":"apiKeyAuth"}}},"servers":{"4c6526f1-81af-4587-a055-b547f5a24663":{"url":"https://geekai.co/api/v1","description":"国内代理入口"},"26977d9e-6f12-4ba8-8c98-247e40469cde":{"url":"https://geekai.dev/api/v1","description":"海外代理入口"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"API认证token","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"API认证token","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"},{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"GeekAI-API-Key","description":"API密钥认证","scopes":[],"schemeName":"apiKeyAuth"},"schema":{"title":"GeekAI-API-Key","type":"string","description":"API密钥认证","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"apiKeyAuth","name":"GeekAI-API-Key"}],"title":"apiKeyAuth"}]},"originalFileLocation":"cn/api/openapi.yaml"},"subdomain":"geekai","siteName":"极客智坊","title":"Chat Completions - 极客智坊","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"cn":{"href":"/cn/docs/introduction","matchLevel":4},"en":{"href":"/en/api/chat","matchLevel":0}}},"lastModified":"2026-11-05T10:54:23.878Z","originalFileLocation":"en/api/chat.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"极客智坊\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/geekai/4IycdE7H9LjTJ-KO/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/geekai/4IycdE7H9LjTJ-KO/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/geekai/4IycdE7H9LjTJ-KO/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/geekai/4IycdE7H9LjTJ-KO/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/geekai/4IycdE7H9LjTJ-KO/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/geekai/4IycdE7H9LjTJ-KO/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/geekai/4IycdE7H9LjTJ-KO/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/geekai/4IycdE7H9LjTJ-KO/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/geekai/4IycdE7H9LjTJ-KO/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Chat Completions - 极客智坊\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"极客智坊\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.geekai.co/en/api/chat\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://geekai.mintlify.site/geekai-icon.webp\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Chat Completions - 极客智坊\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://geekai.mintlify.site/geekai-icon.webp\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/geekai/4IycdE7H9LjTJ-KO/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"极客智坊\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#16A34A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.geekai.co/en/api/chat\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/api/chat.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.geekai.co/#organization\",\"name\":\"极客智坊\",\"url\":\"https://docs.geekai.co\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/geekai/O3NwfoCr_3liylVV/logo/geekai-logo.png?fit=max\u0026auto=format\u0026n=O3NwfoCr_3liylVV\u0026q=85\u0026s=8edc923acd300ea2b9049b14795c8c7a\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.geekai.co#website\",\"name\":\"极客智坊\",\"url\":\"https://docs.geekai.co\",\"publisher\":{\"@id\":\"https://docs.geekai.co/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.geekai.co/en/api/chat#webpage\",\"url\":\"https://docs.geekai.co/en/api/chat\",\"name\":\"Chat Completions\",\"dateModified\":\"2026-11-05T10:54:23.878Z\",\"isPartOf\":{\"@id\":\"https://docs.geekai.co#website\"},\"breadcrumb\":{\"@id\":\"https://docs.geekai.co/en/api/chat#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.geekai.co/en/api/chat#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"极客智坊\",\"item\":\"https://docs.geekai.co\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Chat Completions\",\"item\":\"https://docs.geekai.co/en/api/chat\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.geekai.co/en/api/chat#apireference\",\"headline\":\"Chat Completions\",\"name\":\"Chat Completions\",\"url\":\"https://docs.geekai.co/en/api/chat\",\"mainEntityOfPage\":{\"@id\":\"https://docs.geekai.co/en/api/chat#webpage\"},\"image\":\"https://docs.geekai.co/geekai-icon.webp\",\"dateModified\":\"2026-11-05T10:54:23.878Z\",\"publisher\":{\"@id\":\"https://docs.geekai.co/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.geekai.co#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"极客智坊\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"极客智坊","nav":{"global":null,"languages":[{"language":"cn","pages":[{"title":"cn","href":"/cn/docs/introduction"}]},{"language":"en","tabs":[{"tab":"User Guides","pages":[{"title":"User Guides","href":"/en/docs/introduction"}]},{"tab":"Use Cases","pages":[{"title":"Use Cases","href":"/en/cases/botgem"}]},{"tab":"API Reference","groups":[{"group":"Chat","pages":[{"title":"Chat Completions","openapi":"openapi.yaml POST /chat/completions","sidebarTitle":"Chat","href":"/en/api/chat"},{"title":"Create Embedding","openapi":"openapi.yaml POST /embeddings","sidebarTitle":"Embedding","description":null,"href":"/en/api/embedding"},{"title":"Rerank","openapi":"openapi.yaml POST /rerank","sidebarTitle":"Rerank","href":"/en/api/rerank"}]},{"group":"Image","pages":[{"title":"Image Generation","openapi":"openapi.yaml POST /images/generations","sidebarTitle":"Image Generation","href":"/en/api/image"}]},{"group":"Audio","pages":[{"title":"Speech to Text","openapi":"openapi.yaml POST /audio/transcriptions","sidebarTitle":"Speech to Text","href":"/en/api/audio/speechtotext"},{"title":"Text to Speech","openapi":"openapi.yaml POST /audio/speech","sidebarTitle":"Text to Speech","href":"/en/api/audio/texttospeech"}]},{"group":"Video","pages":[{"title":"Create Task","openapi":"openapi.yaml POST /videos/generations","sidebarTitle":"Create","href":"/en/api/video/create"},{"title":"Get Result","openapi":"openapi.yaml GET /video/{task_id}/result","sidebarTitle":"Retrieval","href":"/en/api/video/retrieval"}]},{"group":"Models","pages":[{"title":"List Models","openapi":"openapi.yaml GET /models","sidebarTitle":"List","href":"/en/api/models"}]},{"group":"Agent","pages":[{"title":"Create Agent","openapi":"openapi.yaml POST /agent/create","sidebarTitle":"Create","href":"/en/api/agent/create"},{"title":"Update Agent","openapi":"openapi.yaml PUT /agent/{uuid}/update","sidebarTitle":"Update","href":"/en/api/agent/update"},{"title":"Agent Embedding","openapi":"openapi.yaml PATCH /agent/{uuid}/embed","sidebarTitle":"Embedding","href":"/en/api/agent/embedding"},{"title":"Get Agent Info","openapi":"openapi.yaml GET /agent/{uuid}","sidebarTitle":"Retrieval","href":"/en/api/agent/retrieval"},{"title":"Chat with Agent","openapi":"openapi.yaml POST /agent/chat","sidebarTitle":"Chat","href":"/en/api/agent/chat"}]},{"group":"File","pages":[{"title":"Upload File","openapi":"openapi.yaml POST /files","sidebarTitle":"Upload","href":"/en/api/file/upload"},{"title":"Extract Content","openapi":"openapi.yaml GET /file/{uuid}/content","sidebarTitle":"Extract","href":"/en/api/file/extract"}]},{"group":"OCR","pages":[{"title":"Business Card Recognition","openapi":"openapi.yaml POST /bizcard/recognize","sidebarTitle":"Business Card","href":"/en/api/ocr/cardrecognition"},{"title":"ID Card Recognition","openapi":"openapi.yaml POST /idcard/recognize","sidebarTitle":"ID Card","href":"/en/api/ocr/idcardrecognition"}]},{"group":"API KEY","pages":[{"title":"Create a New API Key","openapi":"openapi.yaml POST /api_keys","sidebarTitle":"Create","href":"/en/api/key/create"},{"title":"Get All API Keys","openapi":"openapi.yaml GET /api_keys","sidebarTitle":"List","href":"/en/api/key/list"},{"title":"Get API Key Information","openapi":"openapi.yaml GET /api_keys/{uuid}","sidebarTitle":"Get","href":"/en/api/key/get"},{"title":"Update API Key","openapi":"openapi.yaml PUT /api_keys/{uuid}","sidebarTitle":"Update","href":"/en/api/key/update"},{"title":"Toggle API Key Status","openapi":"openapi.yaml PATCH /api_keys/{uuid}/status","sidebarTitle":"Enable/Disable","href":"/en/api/key/toggle"},{"title":"Delete an API Key","openapi":"openapi.yaml DELETE /api_keys/{uuid}","sidebarTitle":"Delete","href":"/en/api/key/delete"}]}]}]}]},"basePath":"","title":"Chat Completions - 极客智坊","buildId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","deploymentId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CBsVopKK.js","utils-DZAk68jJ.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-D32AYZrP.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-D_A5_cny.js","snippetPresets-xNRfS9th.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BIB25-tq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CydJ4w4j.js","shallow-CYPBeQSG.js","getApiPlaygroundDisplay-A5xJVBOu.js","CodeSnippet-BVRTgi3m.js","CodeSnippets-DjD6BSlt.js","Page-Dr40SSJq.js","getPastedJson-D4V4JyrR.js","icon-uhcnG22T.js","MethodPill-CM-ZQdGH.js","DuplicateIcon-B_WnOiNf.js","createIcon-CJsb8utt.js","DynamicMarkdown-D-2HDKEp.js","SectionHeading-KP5xmMgQ.js","axios-vUo_bRtp.js","Markdown-D_k0dg6k.js","clsx-DK3K4Z1S.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-DE3EVdvd.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-fN9H9n9g.js"]}