Send a structured conversation to a model and receive an assistant message. Models trained for alternating turns expect user and assistant messages; a top-level system field sets standing instructions.
Standing system prompt for the whole conversation.
string: plain text
array: list of { "type": "text", "text": "...", "cache_control"?: { "type": "ephemeral", "ttl"?: "5m" \| "1h" } } blocks
Keep the array shape when using prompt caching breakpoints. Do not put the initial system prompt as messages[0].role = "system"; use this field instead.
{"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/messages","slug":"/api-reference/messages","pageMetadata":{"title":"Messages API","openapi":"POST /messages","description":"Create a message with the Anthropic Messages format","href":"/api-reference/messages"},"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 message with the Anthropic Messages format\"\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={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,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:[_jsxs(_components.p,{children:[`Send a structured conversation to a model and receive an assistant message. Models trained for alternating turns expect `,_jsx(_components.code,{children:`user`}),` and `,_jsx(_components.code,{children:`assistant`}),` messages; a top-level `,_jsx(_components.code,{children:`system`}),` field sets standing instructions.`]}),`\n`,_jsx(Heading,{level:`2`,id:`create-a-message`,children:`Create a message`}),`\n`,_jsx(_components.p,{children:_jsx(_components.code,{children:`POST /v1/messages`})}),`\n`,_jsx(Heading,{level:`3`,id:`headers`,children:`Headers`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Header`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Authorization`})}),_jsx(_components.td,{children:`Yes*`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Bearer \u003capi_key>`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`x-api-key`})}),_jsx(_components.td,{children:`Yes*`}),_jsxs(_components.td,{children:[`Alternative to `,_jsx(_components.code,{children:`Authorization`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Content-Type`})}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`application/json`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`anthropic-version`})}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[`Accepted when present (for example `,_jsx(_components.code,{children:`2023-06-01`}),`)`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`*Provide one of `,_jsx(_components.code,{children:`Authorization`}),` or `,_jsx(_components.code,{children:`x-api-key`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`body-parameters`,children:`Body parameters`}),`\n`,_jsx(ParamField,{body:`model`,type:`string`,required:true,id:`param-model`,children:_jsxs(_components.p,{children:[`Model ID. Examples: `,_jsx(_components.code,{children:`claude-sonnet-4-5-20250929`}),`, `,_jsx(_components.code,{children:`glm-5.3:dev`}),`.`]})}),`\n`,_jsxs(ParamField,{body:`messages`,type:`array`,required:true,id:`param-messages`,children:[_jsxs(_components.p,{children:[`Input turns. Each item has `,_jsx(_components.code,{children:`role`}),` and `,_jsx(_components.code,{children:`content`}),`.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`role`}),`: `,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`assistant`}),`, or `,_jsx(_components.code,{children:`system`}),` (mid-conversation system instruction; cannot be the first entry)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`content`}),`: string, or an array of content blocks (see below)`]}),`\n`]}),_jsxs(_components.p,{children:[`Consecutive same-role turns may be merged by the model. If the last message is `,_jsx(_components.code,{children:`assistant`}),`, generation continues from that partial reply.`]})]}),`\n`,_jsx(ParamField,{body:`max_tokens`,type:`integer`,id:`param-max-tokens`,children:_jsx(_components.p,{children:`Maximum number of tokens to generate before stopping. Required by many Anthropic clients; omit only when the client supplies a default.`})}),`\n`,_jsxs(ParamField,{body:`system`,type:`string | array`,id:`param-system`,children:[_jsx(_components.p,{children:`Standing system prompt for the whole conversation.`}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`string: plain text`}),`\n`,_jsxs(_components.li,{children:[`array: list of `,_jsx(_components.code,{children:`{ \"type\": \"text\", \"text\": \"...\", \"cache_control\"?: { \"type\": \"ephemeral\", \"ttl\"?: \"5m\" \\\\| \"1h\" } }`}),` blocks`]}),`\n`]}),_jsxs(_components.p,{children:[`Keep the array shape when using prompt caching breakpoints. Do not put the initial system prompt as `,_jsx(_components.code,{children:`messages[0].role = \"system\"`}),`; use this field instead.`]})]}),`\n`,_jsxs(ParamField,{body:`thinking`,type:`object`,id:`param-thinking`,children:[_jsx(_components.p,{children:`Extended thinking configuration.`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`type`})}),_jsx(_components.th,{children:`Fields`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`enabled`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`budget_tokens`}),` (required), optional `,_jsx(_components.code,{children:`display`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`adaptive`})}),_jsxs(_components.td,{children:[`optional `,_jsx(_components.code,{children:`budget_tokens`}),`, optional `,_jsx(_components.code,{children:`display`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`disabled`})}),_jsx(_components.td,{children:`none`})]})]})]}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`display`}),` is `,_jsx(_components.code,{children:`\"summarized\"`}),` or `,_jsx(_components.code,{children:`\"omitted\"`}),`. When thinking is enabled, assistant `,_jsx(_components.code,{children:`content`}),` may include `,_jsx(_components.code,{children:`thinking`}),` blocks (with `,_jsx(_components.code,{children:`signature`}),`) before `,_jsx(_components.code,{children:`text`}),` / `,_jsx(_components.code,{children:`tool_use`}),`.`]})]}),`\n`,_jsxs(ParamField,{body:`tools`,type:`array`,id:`param-tools`,children:[_jsx(_components.p,{children:`Tools the model may call. Each custom tool:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`name`}),` (string, required)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`description`}),` (string)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`input_schema`}),` (JSON Schema object)`]}),`\n`,_jsxs(_components.li,{children:[`optional: `,_jsx(_components.code,{children:`cache_control`}),`, `,_jsx(_components.code,{children:`strict`}),`, `,_jsx(_components.code,{children:`defer_loading`}),`, `,_jsx(_components.code,{children:`eager_input_streaming`}),`, `,_jsx(_components.code,{children:`allowed_callers`}),`, `,_jsx(_components.code,{children:`input_examples`})]}),`\n`]}),_jsxs(_components.p,{children:[`Anthropic built-in tools may set `,_jsx(_components.code,{children:`type`}),` (for example `,_jsx(_components.code,{children:`bash_20250124`}),`) and omit `,_jsx(_components.code,{children:`input_schema`}),`.`]})]}),`\n`,_jsxs(ParamField,{body:`tool_choice`,type:`object`,id:`param-tool-choice`,children:[_jsx(_components.p,{children:`How the model should use tools:`}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`{ \"type\": \"auto\" }`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`{ \"type\": \"any\" }`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`{ \"type\": \"tool\", \"name\": \"\u003ctool_name>\" }`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`{ \"type\": \"none\" }`})}),`\n`]})]}),`\n`,_jsx(ParamField,{body:`temperature`,type:`number`,id:`param-temperature`,children:_jsx(_components.p,{children:`Sampling temperature. Range depends on the upstream model (commonly 0 to 1).`})}),`\n`,_jsx(ParamField,{body:`top_p`,type:`number`,id:`param-top-p`,children:_jsxs(_components.p,{children:[`Nucleus sampling. `,_jsx(_components.code,{children:`0`}),` is ignored.`]})}),`\n`,_jsx(ParamField,{body:`top_k`,type:`integer`,id:`param-top-k`,children:_jsxs(_components.p,{children:[`Top-k sampling. `,_jsx(_components.code,{children:`0`}),` is ignored.`]})}),`\n`,_jsx(ParamField,{body:`stop_sequences`,type:`array`,id:`param-stop-sequences`,children:_jsx(_components.p,{children:`Custom strings that stop generation when emitted.`})}),`\n`,_jsx(ParamField,{body:`stream`,type:`boolean`,id:`param-stream`,children:_jsxs(_components.p,{children:[`If `,_jsx(_components.code,{children:`true`}),`, respond with server-sent events. Default `,_jsx(_components.code,{children:`false`}),`.`]})}),`\n`,_jsx(ParamField,{body:`metadata`,type:`object`,id:`param-metadata`,children:_jsxs(_components.p,{children:[`Optional `,_jsx(_components.code,{children:`{ \"user_id\": string }`}),` for abuse tracking. Opaque ID only; do not put PII.`]})}),`\n`,_jsx(ParamField,{body:`betas`,type:`array`,id:`param-betas`,children:_jsx(_components.p,{children:`Anthropic beta feature flags. Accepted and forwarded when relevant.`})}),`\n`,_jsxs(ParamField,{body:`context_management`,type:`object`,id:`param-context-management`,children:[_jsx(_components.p,{children:`Server-side context edits, for example:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`5`,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:`5`,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:` \"edits\"`}),_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:` { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"clear_thinking_20251015\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"keep\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"all\"`}),_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`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),`\n`,_jsx(ParamField,{body:`output_config`,type:`object`,id:`param-output-config`,children:_jsxs(_components.p,{children:[`Output controls such as `,_jsx(_components.code,{children:`{ \"effort\": \"low\" | \"medium\" | \"high\" }`}),`.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`content-blocks`,children:`Content blocks`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`content`}),` may be a string (shorthand for one `,_jsx(_components.code,{children:`text`}),` block) or an array of blocks.`]}),`\n`,_jsx(Heading,{level:`4`,id:`user-/-mid-conversation-system`,children:`User / mid-conversation system`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`type`})}),_jsx(_components.th,{children:`Fields`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`text`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`text`}),`, optional `,_jsx(_components.code,{children:`cache_control`})]}),_jsx(_components.td,{children:`Primary text`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`image`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`source`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`source.type`}),`: `,_jsx(_components.code,{children:`base64`}),` (`,_jsx(_components.code,{children:`media_type`}),`, `,_jsx(_components.code,{children:`data`}),`) or `,_jsx(_components.code,{children:`url`}),` (`,_jsx(_components.code,{children:`url`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`document`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`source`}),`, optional `,_jsx(_components.code,{children:`title`}),`, `,_jsx(_components.code,{children:`context`})]}),_jsx(_components.td,{children:`PDF / text document input`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tool_result`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`tool_use_id`}),`, `,_jsx(_components.code,{children:`content`}),`, optional `,_jsx(_components.code,{children:`is_error`}),`, `,_jsx(_components.code,{children:`cache_control`})]}),_jsxs(_components.td,{children:[`Reply to a prior `,_jsx(_components.code,{children:`tool_use`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`mid_conv_system`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`content`}),` (text blocks)`]}),_jsx(_components.td,{children:`Structured mid-conversation system payload`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`tool_addition`}),` / `,_jsx(_components.code,{children:`tool_removal`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`tool`})}),_jsx(_components.td,{children:`Mid-conversation tool availability changes`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Server tool result types (for example `,_jsx(_components.code,{children:`web_search_tool_result`}),`) are accepted as passthrough blocks.`]}),`\n`,_jsx(Heading,{level:`4`,id:`assistant`,children:`Assistant`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`type`})}),_jsx(_components.th,{children:`Fields`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`text`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`text`}),`, optional `,_jsx(_components.code,{children:`cache_control`})]}),_jsx(_components.td,{children:`Visible reply`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tool_use`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`id`}),`, `,_jsx(_components.code,{children:`name`}),`, `,_jsx(_components.code,{children:`input`}),`, optional `,_jsx(_components.code,{children:`cache_control`})]}),_jsx(_components.td,{children:`Client tool call`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`server_tool_use`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`id`}),`, `,_jsx(_components.code,{children:`name`}),`, `,_jsx(_components.code,{children:`input`})]}),_jsx(_components.td,{children:`Server-executed tool call`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`thinking`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`thinking`}),`, `,_jsx(_components.code,{children:`signature`})]}),_jsx(_components.td,{children:`Prior-turn reasoning; echo unchanged on the next request`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`redacted_thinking`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`data`})}),_jsx(_components.td,{children:`Encrypted thinking; echo unchanged`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`On multi-turn requests, include the full previous assistant `,_jsx(_components.code,{children:`content`}),` array (including thinking blocks) so reasoning continuity is preserved.`]}),`\n`,_jsx(Heading,{level:`3`,id:`response`,children:`Response`}),`\n`,_jsx(_components.p,{children:`Non-streaming responses are Anthropic message objects:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,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:`15`,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:`\"msg_...\"`}),_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:` \"type\"`}),_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:`,`})]}),`\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:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"claude-sonnet-4-5-20250929\"`}),_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:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"text\"`}),_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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"stop_reason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"end_turn\"`}),_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:` \"stop_sequence\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_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:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"input_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10`}),_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:` \"output_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`20`})]}),`\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`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`stop_reason`}),` is typically `,_jsx(_components.code,{children:`end_turn`}),`, `,_jsx(_components.code,{children:`max_tokens`}),`, `,_jsx(_components.code,{children:`stop_sequence`}),`, or `,_jsx(_components.code,{children:`tool_use`}),`.`]}),`\n`,_jsx(_components.p,{children:`Errors use Anthropic’s envelope:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,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:`7`,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:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"error\"`}),_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:` \"error\"`}),_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:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"invalid_request_error\"`}),_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:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"...\"`})]}),`\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`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`example`,children:`Example`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,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/messages`}),_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\": \"claude-sonnet-4-5-20250929\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max_tokens\": 1024,`})}),`\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\": \"Hello\"}`})}),`\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(CodeBlock,{filename:`Python`,numberOfLines:`13`,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:`13`,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:` anthropic`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` anthropic.Anthropic(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"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:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.electronhub.ai/v1\"`}),_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`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`message `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.messages.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"claude-sonnet-4-5-20250929\"`}),_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:` max_tokens`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1024`}),_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:` messages`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_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:`\"Hello\"`}),_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:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(message.content)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node.js`,numberOfLines:`14`,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:`14`,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\":`#9CDCFE`},children:` Anthropic`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@anthropic-ai/sdk\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\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:` client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Anthropic`}),_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:` apiKey:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` baseURL:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.electronhub.ai/v1\"`}),_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`,_jsx(_components.span,{className:`line`}),`\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:` message`}),_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:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_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:` \"claude-sonnet-4-5-20250929\"`}),_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:` max_tokens:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1024`}),_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:` \"Hello\"`}),_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`,_jsx(_components.span,{className:`line`}),`\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:`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`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`count-tokens`,children:`Count tokens`}),`\n`,_jsx(_components.p,{children:_jsx(_components.code,{children:`POST /v1/messages/count_tokens`})}),`\n`,_jsx(_components.p,{children:`Estimate input tokens for a Messages request without running inference.`}),`\n`,_jsx(Heading,{level:`3`,id:`body`,children:`Body`}),`\n`,_jsxs(_components.p,{children:[`Same shape as `,_jsx(_components.a,{href:`#create-a-message`,children:`Create a message`}),`: at least `,_jsx(_components.code,{children:`model`}),` and `,_jsx(_components.code,{children:`messages`}),`. `,_jsx(_components.code,{children:`system`}),`, `,_jsx(_components.code,{children:`tools`}),`, and related fields are included in the estimate when present.`]}),`\n`,_jsx(Heading,{level:`3`,id:`response-2`,children:`Response`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,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:` \"input_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1234`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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":"Messages API","openapi":"POST /messages","description":"Create a message with the Anthropic Messages format","href":"/api-reference/messages"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Create a message","slug":"create-a-message","depth":2,"children":[{"title":"Headers","slug":"headers","depth":3,"children":[]},{"title":"Body parameters","slug":"body-parameters","depth":3,"children":[]},{"title":"Content blocks","slug":"content-blocks","depth":3,"children":[]},{"title":"User / mid-conversation system","slug":"user-/-mid-conversation-system","depth":4,"children":[]},{"title":"Assistant","slug":"assistant","depth":4,"children":[]},{"title":"Response","slug":"response","depth":3,"children":[]},{"title":"Example","slug":"example","depth":3,"children":[]}]},{"title":"Count tokens","slug":"count-tokens","depth":2,"children":[{"title":"Body","slug":"body","depth":3,"children":[]},{"title":"Response","slug":"response-2","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Create Message","description":"Create a message with the Anthropic Messages format","operationId":"createMessage","requestBody":"8b7cd141-81f7-4111-9605-3e3b7740c083","responses":{"200":"6f574254-b189-40c7-98eb-708936ce5698"},"method":"post","type":"path","servers":["5c284dff-8de5-4e8f-8bdb-ad83edaedacc"],"security":["863ccd65-dbfd-46a2-a74a-731581cabcf5"],"path":"/messages","baseUrlOptions":["https://api.electronhub.ai/v1"],"title":"Create Message","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","example":"claude-sonnet-4-5-20250929","description":"Model ID","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant","system"],"description":"Turn role. Mid-conversation system turns are accepted.","isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","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","source"],"properties":{"type":{"type":"string","enum":["image"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"source":{"type":"object","required":["type","media_type","data"],"properties":{"type":{"type":"string","enum":["base64"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1.source.type","typeLabel":"enum\u003cstring>"},"media_type":{"type":"string","example":"image/jpeg","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1.source.media_type","typeLabel":"string"},"data":{"type":"string","description":"Base64 encoded image data","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1.source.data","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1.source","typeLabel":"object"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.1","typeLabel":"object"},{"type":"object","required":["type","id","name","input"],"properties":{"type":{"type":"string","enum":["tool_use"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.2.type","typeLabel":"enum\u003cstring>"},"id":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.2.id","typeLabel":"string"},"name":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.2.name","typeLabel":"string"},"input":{"type":"object","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.2.input","typeLabel":"object"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.2","typeLabel":"object"},{"type":"object","required":["type","tool_use_id"],"properties":{"type":{"type":"string","enum":["tool_result"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.3.type","typeLabel":"enum\u003cstring>"},"tool_use_id":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.3.tool_use_id","typeLabel":"string"},"content":{"oneOf":[{"type":"string","uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.3.content.oneOf.0","typeLabel":"string"},{}],"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.3.content","typeLabel":"string"},"is_error":{"type":"boolean","default":false,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.3.is_error","typeLabel":"boolean"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.3","typeLabel":"object"},{"type":"object","required":["type","thinking"],"properties":{"type":{"type":"string","enum":["thinking"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.4.type","typeLabel":"enum\u003cstring>"},"thinking":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.4.thinking","typeLabel":"string"},"signature":{"type":"string","uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.4.signature","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.4","typeLabel":"object"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["redacted_thinking"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.5.type","typeLabel":"enum\u003cstring>"},"data":{"type":"string","uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.5.data","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].oneOf.5","typeLabel":"object"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1","typeLabel":"object[]"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content","typeLabel":"string | object[]"}},"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"description":"Conversation turns","isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"max_tokens":{"type":"integer","description":"Maximum tokens to generate","uniqueKey":"max_tokens","typeLabel":"integer"},"temperature":{"type":"number","minimum":0,"maximum":1,"uniqueKey":"temperature","typeLabel":"number"},"top_p":{"type":"number","uniqueKey":"top_p","typeLabel":"number"},"top_k":{"type":"integer","uniqueKey":"top_k","typeLabel":"integer"},"stream":{"type":"boolean","default":false,"uniqueKey":"stream","typeLabel":"boolean"},"system":{"oneOf":[{"type":"string","description":"Top-level system prompt","uniqueKey":"system.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text"],"uniqueKey":"system.oneOf.1.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"text":{"type":"string","uniqueKey":"system.oneOf.1.items.[INDEX].text","typeLabel":"string"},"cache_control":{"type":"object","uniqueKey":"system.oneOf.1.items.[INDEX].cache_control","typeLabel":"object"}},"uniqueKey":"system.oneOf.1.items.[INDEX]","typeLabel":"object"},"description":"Top-level system prompt","uniqueKey":"system.oneOf.1","typeLabel":"object[]"}],"uniqueKey":"system","typeLabel":"string | object[]"},"tools":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"tools.items.[INDEX].name","typeLabel":"string"},"description":{"type":"string","uniqueKey":"tools.items.[INDEX].description","typeLabel":"string"},"input_schema":{"type":"object","uniqueKey":"tools.items.[INDEX].input_schema","typeLabel":"object"},"type":{"type":"string","description":"Built-in Anthropic tool type when applicable","uniqueKey":"tools.items.[INDEX].type","typeLabel":"string"},"strict":{"type":"boolean","uniqueKey":"tools.items.[INDEX].strict","typeLabel":"boolean"},"defer_loading":{"type":"boolean","uniqueKey":"tools.items.[INDEX].defer_loading","typeLabel":"boolean"},"eager_input_streaming":{"type":"boolean","uniqueKey":"tools.items.[INDEX].eager_input_streaming","typeLabel":"boolean"}},"uniqueKey":"tools.items.[INDEX]","typeLabel":"object"},"uniqueKey":"tools","typeLabel":"object[]"},"tool_choice":{"oneOf":[{"type":"string","enum":["auto","any","none"],"uniqueKey":"tool_choice.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["auto","any","none","tool"],"isRequired":true,"uniqueKey":"tool_choice.oneOf.1.type","typeLabel":"enum\u003cstring>"},"name":{"type":"string","description":"Required when type is tool","uniqueKey":"tool_choice.oneOf.1.name","typeLabel":"string"}},"uniqueKey":"tool_choice.oneOf.1","typeLabel":"object"}],"uniqueKey":"tool_choice","typeLabel":"enum\u003cstring> | object"},"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":"Ignored for models that do not support reasoning_effort","uniqueKey":"reasoning_effort","typeLabel":"enum\u003cstring>"},"betas":{"type":"array","items":{"type":"string","uniqueKey":"betas.items.[INDEX]","typeLabel":"string"},"uniqueKey":"betas","typeLabel":"string[]"},"context_management":{"type":"object","uniqueKey":"context_management","typeLabel":"object"},"output_config":{"type":"object","uniqueKey":"output_config","typeLabel":"object"},"metadata":{"type":"object","uniqueKey":"metadata","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"model":"claude-sonnet-4-5-20250929","messages":[{"content":"\u003cstring>"}],"max_tokens":123,"temperature":0.5,"top_p":123,"top_k":123,"stream":false,"system":"\u003cstring>","tools":[{"name":"\u003cstring>","description":"\u003cstring>","input_schema":{},"type":"\u003cstring>","strict":true,"defer_loading":true,"eager_input_streaming":true}],"thinking":{"type":"enabled","budget_tokens":123},"betas":["\u003cstring>"],"context_management":{},"output_config":{},"metadata":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"6f574254-b189-40c7-98eb-708936ce5698":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["id","type","role","content","model","stop_reason","usage"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"type":{"type":"string","enum":["message"],"isRequired":true,"uniqueKey":"type","typeLabel":"enum\u003cstring>"},"role":{"type":"string","enum":["assistant"],"isRequired":true,"uniqueKey":"role","typeLabel":"enum\u003cstring>"},"content":{"type":"array","items":{"oneOf":[{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","enum":["text"],"isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"},"text":{"type":"string","isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.0.text","typeLabel":"string"}},"uniqueKey":"content.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","required":["type","source"],"properties":{"type":{"type":"string","enum":["image"],"isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"source":{"type":"object","required":["type","media_type","data"],"properties":{"type":{"type":"string","enum":["base64"],"isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.1.source.type","typeLabel":"enum\u003cstring>"},"media_type":{"type":"string","example":"image/jpeg","isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.1.source.media_type","typeLabel":"string"},"data":{"type":"string","description":"Base64 encoded image data","isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.1.source.data","typeLabel":"string"}},"isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.1.source","typeLabel":"object"}},"uniqueKey":"content.items.[INDEX].oneOf.1","typeLabel":"object"},{"type":"object","required":["type","id","name","input"],"properties":{"type":{"type":"string","enum":["tool_use"],"isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.2.type","typeLabel":"enum\u003cstring>"},"id":{"type":"string","isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.2.id","typeLabel":"string"},"name":{"type":"string","isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.2.name","typeLabel":"string"},"input":{"type":"object","isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.2.input","typeLabel":"object"}},"uniqueKey":"content.items.[INDEX].oneOf.2","typeLabel":"object"},{"type":"object","required":["type","tool_use_id"],"properties":{"type":{"type":"string","enum":["tool_result"],"isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.3.type","typeLabel":"enum\u003cstring>"},"tool_use_id":{"type":"string","isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.3.tool_use_id","typeLabel":"string"},"content":{"oneOf":[{"type":"string","uniqueKey":"content.items.[INDEX].oneOf.3.content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"oneOf":[{}],"uniqueKey":"content.items.[INDEX].oneOf.3.content.oneOf.1.items.[INDEX]","typeLabel":"any"},"uniqueKey":"content.items.[INDEX].oneOf.3.content.oneOf.1","typeLabel":"any[]"}],"uniqueKey":"content.items.[INDEX].oneOf.3.content","typeLabel":"string | any[]"},"is_error":{"type":"boolean","default":false,"uniqueKey":"content.items.[INDEX].oneOf.3.is_error","typeLabel":"boolean"}},"uniqueKey":"content.items.[INDEX].oneOf.3","typeLabel":"object"},{"type":"object","required":["type","thinking"],"properties":{"type":{"type":"string","enum":["thinking"],"isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.4.type","typeLabel":"enum\u003cstring>"},"thinking":{"type":"string","isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.4.thinking","typeLabel":"string"},"signature":{"type":"string","uniqueKey":"content.items.[INDEX].oneOf.4.signature","typeLabel":"string"}},"uniqueKey":"content.items.[INDEX].oneOf.4","typeLabel":"object"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["redacted_thinking"],"isRequired":true,"uniqueKey":"content.items.[INDEX].oneOf.5.type","typeLabel":"enum\u003cstring>"},"data":{"type":"string","uniqueKey":"content.items.[INDEX].oneOf.5.data","typeLabel":"string"}},"uniqueKey":"content.items.[INDEX].oneOf.5","typeLabel":"object"}],"uniqueKey":"content.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"content","typeLabel":"object[]"},"model":{"type":"string","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"stop_reason":{"oneOf":[{"type":"string","enum":["end_turn","max_tokens","stop_sequence","tool_use"],"isRequired":true,"uniqueKey":"stop_reason.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["end_turn","max_tokens","stop_sequence","tool_use"],"isRequired":true,"uniqueKey":"stop_reason.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"stop_reason","typeLabel":"enum\u003cstring> | null"},"usage":{"type":"object","required":["input_tokens","output_tokens"],"properties":{"input_tokens":{"type":"integer","isRequired":true,"uniqueKey":"usage.input_tokens","typeLabel":"integer"},"output_tokens":{"type":"integer","isRequired":true,"uniqueKey":"usage.output_tokens","typeLabel":"integer"}},"isRequired":true,"uniqueKey":"usage","typeLabel":"object"},"stop_sequence":{"oneOf":[{"type":"string","uniqueKey":"stop_sequence.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"stop_sequence.oneOf.1","typeLabel":"null"}],"uniqueKey":"stop_sequence","typeLabel":"string | null"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","type":"message","role":"assistant","content":[{"type":"text","text":"\u003cstring>"}],"model":"\u003cstring>","stop_reason":"end_turn","usage":{"input_tokens":123,"output_tokens":123},"stop_sequence":"\u003cstring>"}}},"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":"Messages API - Electron Hub API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-05T02:01:37.769Z","originalFileLocation":"api-reference/messages.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 message with the Anthropic Messages format\">\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=\"Messages API - Electron Hub API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create a message with the Anthropic Messages format\">\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/messages\">\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=API+Reference\u0026amp;title=Messages+API\u0026amp;description=Create+a+message+with+the+Anthropic+Messages+format\u0026amp;theme=3184d595bdbed6241042467b\u0026amp;signature=182b7ce027ca144320f6402f7e8b47fef36c1291cd2e79b23329c09ba083595b\">\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=\"Messages API - Electron Hub API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create a message with the Anthropic Messages format\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://electronhub.mintlify.app/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Messages+API\u0026amp;description=Create+a+message+with+the+Anthropic+Messages+format\u0026amp;theme=3184d595bdbed6241042467b\u0026amp;signature=182b7ce027ca144320f6402f7e8b47fef36c1291cd2e79b23329c09ba083595b\">\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/messages\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/messages.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/messages#webpage\",\"url\":\"https://docs.electronhub.ai/api-reference/messages\",\"name\":\"Messages API\",\"description\":\"Create a message with the Anthropic Messages format\",\"dateModified\":\"2026-09-05T02:01:37.769Z\",\"isPartOf\":{\"@id\":\"https://docs.electronhub.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.electronhub.ai/api-reference/messages#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.electronhub.ai/api-reference/messages#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.electronhub.ai/api-reference/models\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Messages API\",\"item\":\"https://docs.electronhub.ai/api-reference/messages\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.electronhub.ai/api-reference/messages#apireference\",\"headline\":\"Messages API\",\"name\":\"Messages API\",\"description\":\"Create a message with the Anthropic Messages format\",\"url\":\"https://docs.electronhub.ai/api-reference/messages\",\"mainEntityOfPage\":{\"@id\":\"https://docs.electronhub.ai/api-reference/messages#webpage\"},\"dateModified\":\"2026-09-05T02:01:37.769Z\",\"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","href":"/api-reference/models"}]},{"group":"Chat","icon":"message","pages":[{"title":"Chat Completions","openapi":"POST /chat/completions","description":"Create a chat completion","href":"/api-reference/chat/completions"}]},{"title":"Messages API","openapi":"POST /messages","href":"/api-reference/messages"},{"title":"Responses API","openapi":"POST /responses","description":"Create a model response with the OpenAI Responses format","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":"Messages API - 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"]}