Model to use for completion (e.g., gpt-4o, gpt-5.1, claude-sonnet-4-6, deepseek-r1). Append :reasoning-exclude to disable reasoning output for a single request.
Controls reasoning depth on supported models. One of none, minimal, low, medium, high, xhigh. Silently ignored for models that don’t support reasoning_effort.
reasoning.exclude (boolean) — strip reasoning from the response entirely.
reasoning.delta_field — "reasoning" or "reasoning_content"; overrides the streaming/non-streaming field name regardless of which endpoint variant was hit.
Some models emit a separate reasoning / thinking stream in addition to the final answer. Three base paths control how that stream is surfaced — all of them accept the same request shape and model names.
Base path
Behavior
Use when
POST /v1/chat/completions
Reasoning and answer are returned as separate fields (reasoning + content). Default.
Most OpenAI-compatible clients.
POST /v1legacy/chat/completions
Same as /v1/, but reasoning uses the legacy field name reasoning_content.
Clients that only parse reasoning_content (e.g. older DeepSeek SDKs).
POST /v1thinking/chat/completions
Reasoning and answer are merged into the normal content stream, wrapped in <think>...</think> tags.
Clients that ignore reasoning fields but should still display thoughts inline.
Per-request overrides (reasoning.delta_field, reasoning_delta_field, reasoning_content_compat) take precedence over the endpoint default. If a model does not emit reasoning, these fields are simply absent from the response.
When reasoning is delivered as a separate field, deltas are interleaved — reasoning chunks come first, followed by content chunks:
data: {"id":"chatcmpl-...","choices":[{"index":0,"delta":{"reasoning":"Let me think..."},"finish_reason":null}], ...}data: {"id":"chatcmpl-...","choices":[{"index":0,"delta":{"content":"The answer is 4."},"finish_reason":null}], ...}data: [DONE]
Against /v1legacy/chat/completions the same deltas use delta.reasoning_content instead of delta.reasoning.Against /v1thinking/chat/completions everything appears in delta.content:
data: {"choices":[{"delta":{"content":"<think>Let me think...</think>The answer is 4."}}]}
reasoning becomes reasoning_content on /v1legacy/. On /v1thinking/, the reasoning stays embedded inside content ("<think>...</think>The answer...") and no separate field is emitted.
Reasoning effort level. Silently ignored for models that do not support reasoning_effort, so clients can send a single shared request across providers.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Electron Hub API","colors":{"primary":"#8B5CF6","light":"#A855F7","dark":"#7C3AED"},"favicon":"https://mintcdn.com/electronhub/yFLLxumkQXKKJFGg/logo/electron.png?fit=max\u0026auto=format\u0026n=yFLLxumkQXKKJFGg\u0026q=85\u0026s=183ab7fb13d470a0655ab2426bf166f8","logo":{"light":"https://mintcdn.com/electronhub/GYN5h4bEUA-M-2dx/logo/electronhub-text.png?fit=max\u0026auto=format\u0026n=GYN5h4bEUA-M-2dx\u0026q=85\u0026s=84cb4ab70dde795f2feb23bbfa07a228","dark":"https://mintcdn.com/electronhub/GYN5h4bEUA-M-2dx/logo/electronhub-text.png?fit=max\u0026auto=format\u0026n=GYN5h4bEUA-M-2dx\u0026q=85\u0026s=84cb4ab70dde795f2feb23bbfa07a228"},"api":{"openapi":"api-reference/openapi.json","playground":{"display":"interactive"},"mdx":{"server":["https://api.electronhub.ai/v1"],"auth":{"method":"bearer","name":"Authorization"}}},"navbar":{"links":[{"label":"Playground","href":"https://app.electronhub.ai"},{"label":"Discord","href":"https://discord.com/invite/electronhub"}],"primary":{"type":"button","label":"Get API Key","href":"https://app.electronhub.ai"}},"footer":{"socials":{"discord":"https://discord.com/invite/electronhub","website":"https://electronhub.ai"}},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"electronhub","hasAudioNarration":false,"actualSubdomain":"electronhub","customDomains":["docs.electronhub.ai"],"gitSource":{"type":"github","owner":"snowby666","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae046b146007ec9db46b1a2","collectionId":"0e6ffbe9-d66a-4518-aff2-366a4cca873a","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae046b146007ec9db46b1a2"},"entitlements":{},"buildId":"6ae046b146007ec9db46b1a2","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"API Reference","count":24},{"language":"default","tag":"Billing","count":9},{"language":"default","tag":"Proxy Keys","count":8},{"language":"default","tag":"Getting Started","count":5},{"language":"default","tag":"Guides","count":5},{"language":"default","tag":"User","count":3},{"language":"default","tag":"Examples","count":3},{"language":"default","tag":"Audio","count":2},{"language":"default","tag":"Images","count":2},{"language":"default","tag":"Chat","count":1}]},"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":"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":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/chat/completions","slug":"/api-reference/chat/completions","pageMetadata":{"title":"Chat Completions","openapi":"POST /chat/completions","description":"Create a chat completion","href":"/api-reference/chat/completions"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Create a chat completion\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"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={code:`code`,em:`em`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,ParamField,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`create-chat-completion`,children:`Create Chat Completion`}),`\n`,_jsx(_components.p,{children:_jsx(_components.code,{children:`POST /v1/chat/completions`})}),`\n`,_jsx(Heading,{level:`3`,id:`request-body`,children:`Request Body`}),`\n`,_jsx(ParamField,{body:`model`,type:`string`,required:true,id:`param-model`,children:_jsxs(_components.p,{children:[`Model to use for completion (e.g., `,_jsx(_components.code,{children:`gpt-4o`}),`, `,_jsx(_components.code,{children:`gpt-5.1`}),`, `,_jsx(_components.code,{children:`claude-sonnet-4-6`}),`, `,_jsx(_components.code,{children:`deepseek-r1`}),`). Append `,_jsx(_components.code,{children:`:reasoning-exclude`}),` to disable reasoning output for a single request.`]})}),`\n`,_jsx(ParamField,{body:`messages`,type:`array`,required:true,id:`param-messages`,children:_jsx(_components.p,{children:`Array of message objects forming the conversation.`})}),`\n`,_jsx(ParamField,{body:`max_tokens`,type:`integer`,id:`param-max-tokens`,children:_jsx(_components.p,{children:`Maximum number of tokens to generate. Reasoning tokens are billed as output tokens and counted against this limit.`})}),`\n`,_jsx(ParamField,{body:`temperature`,type:`number`,id:`param-temperature`,children:_jsx(_components.p,{children:`Sampling temperature between 0 and 2.`})}),`\n`,_jsx(ParamField,{body:`stream`,type:`boolean`,id:`param-stream`,children:_jsx(_components.p,{children:`Enable streaming responses (SSE).`})}),`\n`,_jsx(ParamField,{body:`reasoning_effort`,type:`string`,id:`param-reasoning-effort`,children:_jsxs(_components.p,{children:[`Controls reasoning depth on supported models. One of `,_jsx(_components.code,{children:`none`}),`, `,_jsx(_components.code,{children:`minimal`}),`, `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, `,_jsx(_components.code,{children:`high`}),`, `,_jsx(_components.code,{children:`xhigh`}),`. Silently ignored for models that don’t support reasoning_effort.`]})}),`\n`,_jsxs(ParamField,{body:`reasoning`,type:`object`,id:`param-reasoning`,children:[_jsx(_components.p,{children:`Reasoning configuration object. Supports:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`reasoning.effort`}),` — same enum as `,_jsx(_components.code,{children:`reasoning_effort`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`reasoning.exclude`}),` (boolean) — strip reasoning from the response entirely.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`reasoning.delta_field`}),` — `,_jsx(_components.code,{children:`\"reasoning\"`}),` or `,_jsx(_components.code,{children:`\"reasoning_content\"`}),`; overrides the streaming/non-streaming field name regardless of which endpoint variant was hit.`]}),`\n`]})]}),`\n`,_jsx(ParamField,{body:`reasoning_delta_field`,type:`string`,id:`param-reasoning-delta-field`,children:_jsxs(_components.p,{children:[`Shorthand for `,_jsx(_components.code,{children:`reasoning.delta_field`}),`. Accepts `,_jsx(_components.code,{children:`\"reasoning\"`}),` or `,_jsx(_components.code,{children:`\"reasoning_content\"`}),`.`]})}),`\n`,_jsx(ParamField,{body:`reasoning_content_compat`,type:`boolean`,id:`param-reasoning-content-compat`,children:_jsxs(_components.p,{children:[`Shorthand: set to `,_jsx(_components.code,{children:`true`}),` to force the legacy `,_jsx(_components.code,{children:`reasoning_content`}),` field, equivalent to `,_jsx(_components.code,{children:`reasoning.delta_field = \"reasoning_content\"`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`endpoint-variants-reasoning-output`,children:`Endpoint Variants (Reasoning Output)`}),`\n`,_jsxs(_components.p,{children:[`Some models emit a separate reasoning / thinking stream in addition to the final answer. Three base paths control how that stream is surfaced — `,_jsx(_components.strong,{children:`all of them accept the same request shape and model names`}),`.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Base path`}),_jsx(_components.th,{children:`Behavior`}),_jsx(_components.th,{children:`Use when`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`POST /v1/chat/completions`})}),_jsxs(_components.td,{children:[`Reasoning and answer are returned as `,_jsx(_components.strong,{children:`separate fields`}),` (`,_jsx(_components.code,{children:`reasoning`}),` + `,_jsx(_components.code,{children:`content`}),`). Default.`]}),_jsx(_components.td,{children:`Most OpenAI-compatible clients.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`POST /v1legacy/chat/completions`})}),_jsxs(_components.td,{children:[`Same as `,_jsx(_components.code,{children:`/v1/`}),`, but reasoning uses the legacy field name `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`reasoning_content`})}),`.`]}),_jsxs(_components.td,{children:[`Clients that only parse `,_jsx(_components.code,{children:`reasoning_content`}),` (e.g. older DeepSeek SDKs).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`POST /v1thinking/chat/completions`})}),_jsxs(_components.td,{children:[`Reasoning and answer are `,_jsxs(_components.strong,{children:[`merged into the normal `,_jsx(_components.code,{children:`content`}),` stream`]}),`, wrapped in `,_jsx(_components.code,{children:`\u003cthink>...\u003c/think>`}),` tags.`]}),_jsx(_components.td,{children:`Clients that ignore reasoning fields but should still display thoughts inline.`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Per-request overrides (`,_jsx(_components.code,{children:`reasoning.delta_field`}),`, `,_jsx(_components.code,{children:`reasoning_delta_field`}),`, `,_jsx(_components.code,{children:`reasoning_content_compat`}),`) take precedence over the endpoint default. If a model does not emit reasoning, these fields are simply absent from the response.`]}),`\n`,_jsx(Heading,{level:`3`,id:`streaming-output-shape`,children:`Streaming output shape`}),`\n`,_jsx(_components.p,{children:`When reasoning is delivered as a separate field, deltas are interleaved — reasoning chunks come first, followed by content chunks:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"id\":\"chatcmpl-...\",\"choices\":[{\"index\":0,\"delta\":{\"reasoning\":\"Let me think...\"},\"finish_reason\":null}], ...}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"id\":\"chatcmpl-...\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"The answer is 4.\"},\"finish_reason\":null}], ...}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: [DONE]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Against `,_jsx(_components.code,{children:`/v1legacy/chat/completions`}),` the same deltas use `,_jsx(_components.code,{children:`delta.reasoning_content`}),` instead of `,_jsx(_components.code,{children:`delta.reasoning`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Against `,_jsx(_components.code,{children:`/v1thinking/chat/completions`}),` everything appears in `,_jsx(_components.code,{children:`delta.content`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"choices\":[{\"delta\":{\"content\":\"\u003cthink>Let me think...\u003c/think>The answer is 4.\"}}]}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`3`,id:`non-streaming-output-shape`,children:`Non-streaming output shape`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chatcmpl-abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chat.completion\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"choices\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"index\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The answer is 4.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"reasoning\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Let me think...\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"finish_reason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stop\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`reasoning`}),` becomes `,_jsx(_components.code,{children:`reasoning_content`}),` on `,_jsx(_components.code,{children:`/v1legacy/`}),`. On `,_jsx(_components.code,{children:`/v1thinking/`}),`, the reasoning stays embedded inside `,_jsx(_components.code,{children:`content`}),` (`,_jsx(_components.code,{children:`\"\u003cthink>...\u003c/think>The answer...\"`}),`) and no separate field is emitted.`]}),`\n`,_jsx(Heading,{level:`2`,id:`disabling-reasoning-output`,children:`Disabling Reasoning Output`}),`\n`,_jsx(_components.p,{children:`Reasoning can be hidden in three equivalent ways — the model still pays the cost for reasoning compute, but the tokens are stripped from the response:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Request body: `,_jsx(_components.code,{children:`{ \"reasoning\": { \"exclude\": true } }`})]}),`\n`,_jsxs(_components.li,{children:[`Model suffix: `,_jsx(_components.code,{children:`\"model\": \"deepseek-r1:reasoning-exclude\"`})]}),`\n`,_jsxs(_components.li,{children:[`Request body: `,_jsx(_components.code,{children:`{ \"reasoning_effort\": \"none\" }`}),` `,_jsx(_components.em,{children:`(only honored on OpenAI-shaped models — safely ignored elsewhere for API parity).`})]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`When excluded, neither the `,_jsx(_components.code,{children:`reasoning`}),` field nor `,_jsx(_components.code,{children:`\u003cthink>`}),` tags appear in the response, regardless of which endpoint variant was hit.`]}),`\n`,_jsx(Heading,{level:`3`,id:`example`,children:`Example`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,numberOfLines:`18`,language:`python`,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:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`18`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Default: reasoning + content in separate fields`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.electronhub.ai/v1/chat/completions'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Bearer YOUR_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'application/json'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'model'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'deepseek-r1'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'messages'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'role'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'user'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'content'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"What's 2 + 2?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'reasoning_effort'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'medium'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`data `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(data[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'choices'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'message'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'reasoning'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# thinking text`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(data[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'choices'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'message'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'content'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# answer`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node.js`,numberOfLines:`15`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` res`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'https://api.electronhub.ai/v1/chat/completions'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'POST'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `Bearer \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`ELECTRONHUB_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'application/json'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'deepseek-r1'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` messages:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"What's 2 + 2?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reasoning_effort:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'medium'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choices`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`reasoning`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choices`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`26`,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:`26`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Legacy field name (reasoning_content)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.electronhub.ai/v1legacy/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_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:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_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\": \"deepseek-r1\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [{\"role\": \"user\", \"content\": \"What is 2+2?\"}]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Merged (\u003cthink> inline)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.electronhub.ai/v1thinking/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_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:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_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\": \"deepseek-r1\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [{\"role\": \"user\", \"content\": \"What is 2+2?\"}]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Hide reasoning entirely`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.electronhub.ai/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:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_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:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_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\": \"deepseek-r1:reasoning-exclude\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [{\"role\": \"user\", \"content\": \"What is 2+2?\"}]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`streaming`,children:`Streaming`}),`\n`,_jsx(_components.p,{children:`Enable real-time responses with streaming:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,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:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.electronhub.ai/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:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_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:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_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-3.5-turbo\",`})}),`\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:` {\"role\": \"user\", \"content\": \"Tell me a story\"}`})}),`\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\": true`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`function-calling`,children:`Function Calling`}),`\n`,_jsx(_components.p,{children:`Use function calling for tool integration:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`30`,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:`30`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.electronhub.ai/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:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_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:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_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-4\",`})}),`\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:` {\"role\": \"user\", \"content\": \"What is the weather like in Boston?\"}`})}),`\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:` \"tools\": [`})}),`\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:` \"type\": \"function\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"function\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"get_current_weather\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\": \"Get the current weather in a given location\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"parameters\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type\": \"object\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"properties\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"location\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type\": \"string\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\": \"The city and state, e.g. San Francisco, CA\"`})}),`\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:` \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]}`})}),`\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:` \"required\": [\"location\"]`})}),`\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:` }`})}),`\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:` \"tool_choice\": \"auto\"`})}),`\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":"POST /chat/completions","description":"Create a chat completion","href":"/api-reference/chat/completions"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Create Chat Completion","slug":"create-chat-completion","depth":2,"children":[{"title":"Request Body","slug":"request-body","depth":3,"children":[]}]},{"title":"Endpoint Variants (Reasoning Output)","slug":"endpoint-variants-reasoning-output","depth":2,"children":[{"title":"Streaming output shape","slug":"streaming-output-shape","depth":3,"children":[]},{"title":"Non-streaming output shape","slug":"non-streaming-output-shape","depth":3,"children":[]}]},{"title":"Disabling Reasoning Output","slug":"disabling-reasoning-output","depth":2,"children":[{"title":"Example","slug":"example","depth":3,"children":[]}]},{"title":"Streaming","slug":"streaming","depth":2,"children":[]},{"title":"Function Calling","slug":"function-calling","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Create Chat Completion","description":"Create a chat completion","operationId":"createChatCompletion","requestBody":"953bc46f-7907-412c-8e20-e7fa3a8dd263","responses":{"200":"6e3cdc9d-e9b1-4003-88d1-4771ac4db48f"},"method":"post","type":"path","servers":["5c284dff-8de5-4e8f-8bdb-ad83edaedacc"],"security":["863ccd65-dbfd-46a2-a74a-731581cabcf5"],"path":"/chat/completions","baseUrlOptions":["https://api.electronhub.ai/v1"],"title":"Create Chat Completion","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":"Model to use for completion","example":"gpt-4o","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"messages":{"type":"array","description":"List of messages","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","description":"May be null in assistant deltas/responses when only reasoning is being emitted.","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"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"},"text":{"type":"string","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"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"image_url":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1.image_url.oneOf.0","typeLabel":"string"},{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1.image_url.oneOf.1.url","typeLabel":"string\u003curi>"},"detail":{"type":"string","enum":["low","high","auto"],"default":"auto","uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1.image_url.oneOf.1.detail","typeLabel":"enum\u003cstring>"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1.image_url.oneOf.1","typeLabel":"object"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1.image_url","typeLabel":"string | object"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1","typeLabel":"object"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX]","typeLabel":"object"},"description":"May be null in assistant deltas/responses when only reasoning is being emitted.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1","typeLabel":"object[]"},{"type":"null","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2","typeLabel":"null"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content","typeLabel":"string | object[] | null"},"reasoning":{"oneOf":[{"type":"string","description":"(Assistant only) The model's thinking/reasoning output, returned alongside `content` by `/v1/chat/completions`. Omitted when the model does not produce reasoning or when reasoning is excluded.","uniqueKey":"messages.items.[INDEX].reasoning.oneOf.0","typeLabel":"string"},{"type":"null","description":"(Assistant only) The model's thinking/reasoning output, returned alongside `content` by `/v1/chat/completions`. Omitted when the model does not produce reasoning or when reasoning is excluded.","uniqueKey":"messages.items.[INDEX].reasoning.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning","typeLabel":"string | null"},"reasoning_content":{"oneOf":[{"type":"string","description":"(Assistant only) Legacy field name for `reasoning`. Populated by `/v1legacy/chat/completions` or when `reasoning_content_compat=true` / `reasoning.delta_field=\"reasoning_content\"` is set.","uniqueKey":"messages.items.[INDEX].reasoning_content.oneOf.0","typeLabel":"string"},{"type":"null","description":"(Assistant only) Legacy field name for `reasoning`. Populated by `/v1legacy/chat/completions` or when `reasoning_content_compat=true` / `reasoning.delta_field=\"reasoning_content\"` is set.","uniqueKey":"messages.items.[INDEX].reasoning_content.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning_content","typeLabel":"string | null"},"name":{"type":"string","description":"Name of the message author","uniqueKey":"messages.items.[INDEX].name","typeLabel":"string"},"tool_calls":{"type":"array","items":{"type":"object","required":["id","type","function"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].tool_calls.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","enum":["function"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].tool_calls.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"function":{"type":"object","required":["name"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].tool_calls.items.[INDEX].function.name","typeLabel":"string"},"arguments":{"type":"string","uniqueKey":"messages.items.[INDEX].tool_calls.items.[INDEX].function.arguments","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].tool_calls.items.[INDEX].function","typeLabel":"object"}},"uniqueKey":"messages.items.[INDEX].tool_calls.items.[INDEX]","typeLabel":"object"},"uniqueKey":"messages.items.[INDEX].tool_calls","typeLabel":"object[]"}},"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"stream":{"type":"boolean","default":false,"description":"Enable streaming","uniqueKey":"stream","typeLabel":"boolean"},"max_tokens":{"type":"integer","description":"Maximum tokens to generate","uniqueKey":"max_tokens","typeLabel":"integer"},"temperature":{"type":"number","minimum":0,"maximum":2,"default":1,"description":"Sampling temperature","uniqueKey":"temperature","typeLabel":"number"},"top_p":{"type":"number","minimum":0,"maximum":1,"default":1,"description":"Nucleus sampling","uniqueKey":"top_p","typeLabel":"number"},"top_k":{"type":"integer","description":"Top-k sampling","uniqueKey":"top_k","typeLabel":"integer"},"frequency_penalty":{"type":"number","minimum":-2,"maximum":2,"default":0,"uniqueKey":"frequency_penalty","typeLabel":"number"},"presence_penalty":{"type":"number","minimum":-2,"maximum":2,"default":0,"uniqueKey":"presence_penalty","typeLabel":"number"},"tools":{"type":"array","description":"List of tools","items":{"type":"object","required":["type","function"],"properties":{"type":{"type":"string","enum":["function"],"isRequired":true,"uniqueKey":"tools.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"function":{"type":"object","required":["name"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"tools.items.[INDEX].function.name","typeLabel":"string"},"description":{"type":"string","uniqueKey":"tools.items.[INDEX].function.description","typeLabel":"string"},"parameters":{"type":"object","uniqueKey":"tools.items.[INDEX].function.parameters","typeLabel":"object"}},"isRequired":true,"uniqueKey":"tools.items.[INDEX].function","typeLabel":"object"}},"uniqueKey":"tools.items.[INDEX]","typeLabel":"object"},"uniqueKey":"tools","typeLabel":"object[]"},"tool_choice":{"oneOf":[{"type":"string","enum":["none","auto"],"uniqueKey":"tool_choice.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"object","required":["type","function"],"properties":{"type":{"type":"string","enum":["function"],"isRequired":true,"uniqueKey":"tool_choice.oneOf.1.type","typeLabel":"enum\u003cstring>"},"function":{"type":"object","required":["name"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"tool_choice.oneOf.1.function.name","typeLabel":"string"}},"isRequired":true,"uniqueKey":"tool_choice.oneOf.1.function","typeLabel":"object"}},"uniqueKey":"tool_choice.oneOf.1","typeLabel":"object"}],"uniqueKey":"tool_choice","typeLabel":"enum\u003cstring> | object"},"web_search":{"type":"boolean","default":false,"description":"Enable web search","uniqueKey":"web_search","typeLabel":"boolean"},"thinking":{"oneOf":[{"type":"object","required":["type","budget_tokens"],"properties":{"type":{"type":"string","enum":["enabled"],"isRequired":true,"uniqueKey":"thinking.oneOf.0.type","typeLabel":"enum\u003cstring>"},"budget_tokens":{"type":"integer","description":"Token budget for thinking","isRequired":true,"uniqueKey":"thinking.oneOf.0.budget_tokens","typeLabel":"integer"},"display":{"type":"string","enum":["summarized","omitted"],"uniqueKey":"thinking.oneOf.0.display","typeLabel":"enum\u003cstring>"}},"uniqueKey":"thinking.oneOf.0","typeLabel":"object"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["adaptive","disabled"],"isRequired":true,"uniqueKey":"thinking.oneOf.1.type","typeLabel":"enum\u003cstring>"},"display":{"type":"string","enum":["summarized","omitted"],"uniqueKey":"thinking.oneOf.1.display","typeLabel":"enum\u003cstring>"}},"uniqueKey":"thinking.oneOf.1","typeLabel":"object"}],"uniqueKey":"thinking","typeLabel":"object"},"reasoning_effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh"],"description":"Reasoning effort level. Silently ignored for models that do not support reasoning_effort, so clients can send a single shared request across providers.","uniqueKey":"reasoning_effort","typeLabel":"enum\u003cstring>"},"reasoning":{"type":"object","description":"Reasoning configuration. Per-request override for reasoning output behavior.","properties":{"effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh"],"description":"Same enum as `reasoning_effort`.","uniqueKey":"reasoning.effort","typeLabel":"enum\u003cstring>"},"exclude":{"type":"boolean","description":"If true, strip the reasoning stream from the response entirely. The model still computes (and is billed for) reasoning tokens.","uniqueKey":"reasoning.exclude","typeLabel":"boolean"},"delta_field":{"type":"string","enum":["reasoning","reasoning_content"],"description":"Override the streaming/non-streaming field name regardless of which endpoint variant was hit.","uniqueKey":"reasoning.delta_field","typeLabel":"enum\u003cstring>"}},"uniqueKey":"reasoning","typeLabel":"object"},"reasoning_delta_field":{"type":"string","enum":["reasoning","reasoning_content"],"description":"Shorthand for `reasoning.delta_field`.","uniqueKey":"reasoning_delta_field","typeLabel":"enum\u003cstring>"},"reasoning_content_compat":{"type":"boolean","description":"Shorthand: set to `true` to force the legacy `reasoning_content` field, equivalent to `reasoning.delta_field = \"reasoning_content\"`.","uniqueKey":"reasoning_content_compat","typeLabel":"boolean"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"model":"gpt-4o","messages":[{"content":"\u003cstring>","reasoning":"\u003cstring>","reasoning_content":"\u003cstring>","name":"\u003cstring>","tool_calls":[{"id":"\u003cstring>","type":"function","function":{"name":"\u003cstring>","arguments":"\u003cstring>"}}]}],"stream":false,"max_tokens":123,"temperature":1,"top_p":1,"top_k":123,"frequency_penalty":0,"presence_penalty":0,"tools":[{"type":"function","function":{"name":"\u003cstring>","description":"\u003cstring>","parameters":{}}}],"web_search":false,"thinking":{"type":"enabled","budget_tokens":123},"reasoning":{"exclude":true},"reasoning_content_compat":true}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"6e3cdc9d-e9b1-4003-88d1-4771ac4db48f":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["id","object","created","model","choices"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"object":{"type":"string","example":"chat.completion","isRequired":true,"uniqueKey":"object","typeLabel":"string"},"created":{"type":"integer","isRequired":true,"uniqueKey":"created","typeLabel":"integer"},"model":{"type":"string","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"choices":{"type":"array","items":{"type":"object","required":["index","message"],"properties":{"index":{"type":"integer","isRequired":true,"uniqueKey":"choices.items.[INDEX].index","typeLabel":"integer"},"message":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","description":"May be null in assistant deltas/responses when only reasoning is being emitted.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","enum":["text"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content.oneOf.1.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"},"text":{"type":"string","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content.oneOf.1.items.[INDEX].oneOf.0.text","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX].message.content.oneOf.1.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","required":["type","image_url"],"properties":{"type":{"type":"string","enum":["image_url"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content.oneOf.1.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"image_url":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content.oneOf.1.items.[INDEX].oneOf.1.image_url.oneOf.0","typeLabel":"string"},{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content.oneOf.1.items.[INDEX].oneOf.1.image_url.oneOf.1.url","typeLabel":"string\u003curi>"},"detail":{"type":"string","enum":["low","high","auto"],"default":"auto","uniqueKey":"choices.items.[INDEX].message.content.oneOf.1.items.[INDEX].oneOf.1.image_url.oneOf.1.detail","typeLabel":"enum\u003cstring>"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content.oneOf.1.items.[INDEX].oneOf.1.image_url.oneOf.1","typeLabel":"object"}],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content.oneOf.1.items.[INDEX].oneOf.1.image_url","typeLabel":"string | object"}},"uniqueKey":"choices.items.[INDEX].message.content.oneOf.1.items.[INDEX].oneOf.1","typeLabel":"object"}],"uniqueKey":"choices.items.[INDEX].message.content.oneOf.1.items.[INDEX]","typeLabel":"object"},"description":"May be null in assistant deltas/responses when only reasoning is being emitted.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content.oneOf.1","typeLabel":"object[]"},{"type":"null","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content.oneOf.2","typeLabel":"null"}],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content","typeLabel":"string | object[] | null"},"reasoning":{"oneOf":[{"type":"string","description":"(Assistant only) The model's thinking/reasoning output, returned alongside `content` by `/v1/chat/completions`. Omitted when the model does not produce reasoning or when reasoning is excluded.","uniqueKey":"choices.items.[INDEX].message.reasoning.oneOf.0","typeLabel":"string"},{"type":"null","description":"(Assistant only) The model's thinking/reasoning output, returned alongside `content` by `/v1/chat/completions`. Omitted when the model does not produce reasoning or when reasoning is excluded.","uniqueKey":"choices.items.[INDEX].message.reasoning.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.reasoning","typeLabel":"string | null"},"reasoning_content":{"oneOf":[{"type":"string","description":"(Assistant only) Legacy field name for `reasoning`. Populated by `/v1legacy/chat/completions` or when `reasoning_content_compat=true` / `reasoning.delta_field=\"reasoning_content\"` is set.","uniqueKey":"choices.items.[INDEX].message.reasoning_content.oneOf.0","typeLabel":"string"},{"type":"null","description":"(Assistant only) Legacy field name for `reasoning`. Populated by `/v1legacy/chat/completions` or when `reasoning_content_compat=true` / `reasoning.delta_field=\"reasoning_content\"` is set.","uniqueKey":"choices.items.[INDEX].message.reasoning_content.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.reasoning_content","typeLabel":"string | null"},"name":{"type":"string","description":"Name of the message author","uniqueKey":"choices.items.[INDEX].message.name","typeLabel":"string"},"tool_calls":{"type":"array","items":{"type":"object","required":["id","type","function"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","enum":["function"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"function":{"type":"object","required":["name"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.items.[INDEX].function.name","typeLabel":"string"},"arguments":{"type":"string","uniqueKey":"choices.items.[INDEX].message.tool_calls.items.[INDEX].function.arguments","typeLabel":"string"}},"isRequired":true,"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[]"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message","typeLabel":"object"},"finish_reason":{"type":"string","enum":["stop","length","content_filter","tool_calls","function_call"],"uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"enum\u003cstring>"}},"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"choices","typeLabel":"object[]"},"usage":{"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"prompt_tokens":{"type":"integer","isRequired":true,"uniqueKey":"usage.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","isRequired":true,"uniqueKey":"usage.completion_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","isRequired":true,"uniqueKey":"usage.total_tokens","typeLabel":"integer"}},"uniqueKey":"usage","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","object":"chat.completion","created":123,"model":"\u003cstring>","choices":[{"index":123,"message":{"role":"system","content":"\u003cstring>","reasoning":"\u003cstring>","reasoning_content":"\u003cstring>","name":"\u003cstring>","tool_calls":[{"id":"\u003cstring>","type":"function","function":{"name":"\u003cstring>","arguments":"\u003cstring>"}}]},"finish_reason":"stop"}],"usage":{"prompt_tokens":123,"completion_tokens":123,"total_tokens":123}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"863ccd65-dbfd-46a2-a74a-731581cabcf5":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Enter your API key (starts with 'ek-')","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"5c284dff-8de5-4e8f-8bdb-ad83edaedacc":{"url":"https://api.electronhub.ai/v1","description":"Production API v1"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Enter your API key (starts with 'ek-')","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Enter your API key (starts with 'ek-')","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"electronhub","siteName":"Electron Hub API","title":"Chat Completions - Electron Hub API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-30T18:32:54.417Z","originalFileLocation":"api-reference/chat/completions.mdx"},"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=\"description\" content=\"Create a chat completion\">\u003cmeta data-mint-head name=\"application-name\" content=\"Electron Hub API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/electronhub/loIKWMWRhd1rlk7z/_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/electronhub/loIKWMWRhd1rlk7z/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/electronhub/loIKWMWRhd1rlk7z/_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/electronhub/loIKWMWRhd1rlk7z/_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/electronhub/loIKWMWRhd1rlk7z/_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/electronhub/loIKWMWRhd1rlk7z/_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/electronhub/loIKWMWRhd1rlk7z/_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/electronhub/loIKWMWRhd1rlk7z/_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/electronhub/loIKWMWRhd1rlk7z/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Chat Completions - Electron Hub API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create a chat completion\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Electron Hub API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.electronhub.ai/api-reference/chat/completions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://electronhub.mintlify.app/_mintlify/api/og/v2?division=Chat\u0026amp;title=Chat+Completions\u0026amp;description=Create+a+chat+completion\u0026amp;theme=3184d595bdbed6241042467b\u0026amp;signature=739e8127fc2e4c6d8d9d02cea3de2b40b124b8acd6c9379a7079e7b576835412\">\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 - Electron Hub API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create a chat completion\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://electronhub.mintlify.app/_mintlify/api/og/v2?division=Chat\u0026amp;title=Chat+Completions\u0026amp;description=Create+a+chat+completion\u0026amp;theme=3184d595bdbed6241042467b\u0026amp;signature=739e8127fc2e4c6d8d9d02cea3de2b40b124b8acd6c9379a7079e7b576835412\">\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/electronhub/loIKWMWRhd1rlk7z/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Electron Hub API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#8B5CF6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.electronhub.ai/api-reference/chat/completions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/chat/completions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.electronhub.ai/#organization\",\"name\":\"Electron Hub API\",\"url\":\"https://docs.electronhub.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/electronhub/GYN5h4bEUA-M-2dx/logo/electronhub-text.png?fit=max\u0026auto=format\u0026n=GYN5h4bEUA-M-2dx\u0026q=85\u0026s=84cb4ab70dde795f2feb23bbfa07a228\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.electronhub.ai#website\",\"name\":\"Electron Hub API\",\"url\":\"https://docs.electronhub.ai\",\"publisher\":{\"@id\":\"https://docs.electronhub.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.electronhub.ai/api-reference/chat/completions#webpage\",\"url\":\"https://docs.electronhub.ai/api-reference/chat/completions\",\"name\":\"Chat Completions\",\"description\":\"Create a chat completion\",\"dateModified\":\"2026-07-30T18:32:54.417Z\",\"isPartOf\":{\"@id\":\"https://docs.electronhub.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.electronhub.ai/api-reference/chat/completions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.electronhub.ai/api-reference/chat/completions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.electronhub.ai/api-reference/models\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Chat Completions\",\"item\":\"https://docs.electronhub.ai/api-reference/chat/completions\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.electronhub.ai/api-reference/chat/completions#apireference\",\"headline\":\"Chat Completions\",\"name\":\"Chat Completions\",\"description\":\"Create a chat completion\",\"url\":\"https://docs.electronhub.ai/api-reference/chat/completions\",\"mainEntityOfPage\":{\"@id\":\"https://docs.electronhub.ai/api-reference/chat/completions#webpage\"},\"dateModified\":\"2026-07-30T18:32:54.417Z\",\"publisher\":{\"@id\":\"https://docs.electronhub.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.electronhub.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Electron Hub API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Electron Hub API","nav":{"global":null,"groups":[{"group":"Getting Started","pages":[{"title":"Introduction","icon":"flag","href":"/getting-started/introduction"},{"title":"Quickstart","icon":"bolt","href":"/getting-started/quickstart"},{"title":"Authentication","icon":"shield","href":"/getting-started/authentication"},{"title":"Rate Limits","icon":"gauge","href":"/getting-started/rate-limits"},{"title":"Error Handling","icon":"triangle-exclamation","href":"/getting-started/errors"}],"icon":"rocket"},{"group":"API Reference","pages":[{"group":"Models","icon":"brain","pages":[{"title":"List Models","openapi":"GET /models","description":"List all available models","href":"/api-reference/models"}]},{"group":"Chat","icon":"message","pages":[{"title":"Chat Completions","openapi":"POST /chat/completions","href":"/api-reference/chat/completions"}]},{"title":"Messages API","openapi":"POST /messages","description":"Create a message with the Anthropic Messages format","href":"/api-reference/messages"},{"title":"Responses API","openapi":"POST /responses","href":"/api-reference/responses"},{"group":"Images","icon":"image","pages":[{"title":"Image Generations","openapi":"POST /images/generations","href":"/api-reference/images/generations"},{"title":"Image Edits","openapi":"POST /images/edits","href":"/api-reference/images/edits"}]},{"group":"Videos","icon":"video","pages":[{"title":"Video Generations","openapi":"POST /videos/generations","href":"/api-reference/videos/generations"}]},{"group":"Audio","icon":"volume-high","pages":[{"title":"Text-to-Speech","openapi":"POST /audio/speech","href":"/api-reference/audio/speech"},{"title":"Speech-to-Text","openapi":"POST /audio/transcriptions","href":"/api-reference/audio/transcriptions"}]},{"title":"Moderations","openapi":"POST /moderations","href":"/api-reference/moderations"},{"title":"Decisions","openapi":"POST /systemone","href":"/api-reference/systemone"},{"title":"Embeddings","openapi":"POST /embeddings","href":"/api-reference/embeddings"},{"group":"User","icon":"user","pages":[{"title":"Get Usage","openapi":"GET /user/me","href":"/api-reference/usage"},{"title":"Get Model Breakdown","openapi":"GET /user/models","href":"/api-reference/user-models"},{"title":"Get User Logs","openapi":"GET /user/logs","href":"/api-reference/user-logs"}]},{"group":"Proxy Keys","icon":"key","pages":[{"title":"List Proxy Keys","api":"GET https://api.electronhub.ai/v1/auth/proxy","openapi":"GET /auth/proxy","href":"/api-reference/proxy-keys"},{"title":"Lookup Proxy Key","api":"POST https://api.electronhub.ai/v1/auth/proxy/lookup","openapi":"POST /auth/proxy/lookup","href":"/api-reference/proxy-lookup"},{"title":"Create Proxy Key","api":"POST https://api.electronhub.ai/v1/auth/proxy/create","openapi":"POST /auth/proxy/create","href":"/api-reference/proxy-create"},{"title":"Update Proxy Key","api":"POST https://api.electronhub.ai/v1/auth/proxy/update","openapi":"POST /auth/proxy/update","href":"/api-reference/proxy-update"},{"title":"Toggle Proxy Key Status","api":"POST https://api.electronhub.ai/v1/auth/proxy/toggle","openapi":"POST /auth/proxy/toggle","href":"/api-reference/proxy-toggle"},{"title":"Delete Proxy Key","api":"POST https://api.electronhub.ai/v1/auth/proxy/remove","openapi":"POST /auth/proxy/remove","href":"/api-reference/proxy-delete"},{"title":"Delete All Proxy Keys","api":"DELETE https://api.electronhub.ai/v1/auth/proxy/delete","openapi":"DELETE /auth/proxy/delete","href":"/api-reference/proxy-delete-all"},{"title":"Validate Proxy Key Access","api":"POST https://api.electronhub.ai/v1/auth/proxy/validate","openapi":"POST /auth/proxy/validate","href":"/api-reference/proxy-validate"}]},{"title":"Regenerate API Key","api":"GET https://api.electronhub.ai/v1/auth/key/regen","openapi":"GET /auth/key/regen","href":"/api-reference/regenerate-key"}],"icon":"code"},{"group":"Guides","pages":[{"title":"Best Practices","icon":"star","href":"/guides/best-practices"},{"title":"OpenAI SDKs","icon":"code","href":"/guides/openai-sdks"},{"title":"Anthropic SDKs","icon":"robot","href":"/guides/anthropic-sdks"},{"title":"Prompt Caching","icon":"zap","href":"/guides/prompt-caching"},{"title":"In-chat Image Generation","icon":"image","href":"/guides/in-chat-image-generation"}],"icon":"book-open"},{"group":"Examples","pages":[{"title":"Chat Examples","icon":"message","href":"/examples/chat-examples"},{"title":"Image Examples","icon":"image","href":"/examples/image-examples"},{"title":"Embedding Examples","icon":"vector-square","href":"/examples/embedding-examples"}],"icon":"play"},{"group":"Billing","pages":[{"title":"Billing \u0026 Credits Overview","icon":"grid","href":"/billing/overview"},{"title":"Subscriptions","icon":"repeat","href":"/billing/subscriptions"},{"title":"Coding Plan (DevPass)","icon":"terminal","href":"/billing/coding-plan"},{"title":"Pay-as-You-Go","icon":"wallet","href":"/billing/pay-as-you-go"},{"title":"Understanding Credits","icon":"coins","href":"/billing/credits"},{"title":"Model Types \u0026 Access","icon":"brain","href":"/billing/model-access"},{"title":"Advanced Billing Topics","icon":"sliders","href":"/billing/advanced"},{"title":"Billing Troubleshooting","icon":"wrench","href":"/billing/troubleshooting"},{"title":"Privacy \u0026 Security","icon":"shield-check","href":"/billing/privacy-security"}],"icon":"credit-card"}]},"basePath":"","title":"Chat Completions - Electron Hub API","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CS552b7R.js","utils-DDTCYAF2.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-De8ttokP.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-DrwRDvAh.js","snippetPresets-DtAN0nWx.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-D5rWArI6.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-O2i12wsz.js","shallow-DV8xABTt.js","getApiPlaygroundDisplay-DBZ0B5Jx.js","CodeSnippet-BVi0tPUX.js","CodeSnippets-CqASbIwY.js","Page-m07pfKpT.js","getPastedJson-DG9vsMS8.js","icon-CXzRSCr8.js","MethodPill-BdKVtEuX.js","DuplicateIcon-CZlmBrJI.js","createIcon-biFEUKPL.js","DynamicMarkdown-B54_zNBF.js","SectionHeading-DwwHK3Pt.js","axios-vUo_bRtp.js","Markdown-DfhCTwyA.js","clsx-xpJZXxdP.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-BTZUMDnx.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-DqdKa2R4.js"]}