Creates a model response using the Anthropic Messages API request and response format. Like all
inference endpoints, requests are served through the attested TEE gateway and return an
x-receipt-id header for verification.
Routing constraints for this request, applied together. zdr restricts routing to providers that
do not retain content; aci_verified restricts it to an upstream verified inside the TEE;
aci_session_ids pins it to specific attested channels.
{"provider": {"aci_verified": true}}
If no provider satisfies the constraints the request fails before the prompt is sent, and failover
retries stay inside the allowed set. Field reference:
Chat completions. See
Attested routing and
Zero data retention.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"RedPill AI","colors":{"primary":"#c96442","light":"#d97757","dark":"#b0512f"},"logo":{"light":"https://mintcdn.com/phala-47f19b07/5vRaVvmX8pi5Nukr/logo/light.svg?fit=max\u0026auto=format\u0026n=5vRaVvmX8pi5Nukr\u0026q=85\u0026s=03f8dbe12d0f593a956cccba7b18115f","dark":"https://mintcdn.com/phala-47f19b07/5vRaVvmX8pi5Nukr/logo/dark.svg?fit=max\u0026auto=format\u0026n=5vRaVvmX8pi5Nukr\u0026q=85\u0026s=dd49c6b52615b7312317e2fc353ac289"},"favicon":"https://mintcdn.com/phala-47f19b07/jUpTfTWRxXYc1F5K/favicon.svg?fit=max\u0026auto=format\u0026n=jUpTfTWRxXYc1F5K\u0026q=85\u0026s=1ac7304fa03ccc515bee40d9694e75e2","api":{"mdx":{"auth":{"method":"bearer"},"server":"https://api.redpill.ai/v1"}},"navbar":{"links":[{"href":"https://www.redpill.ai/dashboard","label":"Dashboard"}],"primary":{"type":"button","label":"Start building","href":"https://redpill.ai/start-building"}},"footer":{"socials":{"twitter":"https://twitter.com/redpill_ai","github":"https://github.com/redpill-ai","discord":"https://discord.gg/P2ukR4Z5ps"}},"fonts":{"heading":{"family":"Poppins","weight":600},"body":{"family":"Inter","weight":400}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"metadata":{"timestamp":false},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Community","icon":"discord","href":"https://discord.gg/P2ukR4Z5ps"},{"anchor":"GitHub","icon":"github","href":"https://github.com/redpill-ai"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"phala-47f19b07","hasAudioNarration":false,"actualSubdomain":"phala-47f19b07","customDomains":["docs.redpill.ai"],"gitSource":{"type":"github","owner":"redpill-ai","repo":"redpill-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6aeadca45adfacbbaf537b77","collectionId":"9eb481cb-d39b-4c33-96ba-258251700e65","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aeadca45adfacbbaf537b77"},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{},"buildId":"6aeaec39197840cd827e97ba","clientVersion":"0.0.4054","searchFilterCounts":[{"language":"default","tag":"Documentation","count":49},{"language":"default","tag":"API Reference","count":11},{"language":"default","tag":"Use in agents","count":9},{"language":"default","tag":"Endpoints","count":8},{"language":"default","tag":"Build with the API","count":8},{"language":"default","tag":"Get started","count":7},{"language":"default","tag":"Features","count":7},{"language":"default","tag":"How it works","count":6},{"language":"default","tag":"Verify and control","count":6},{"language":"default","tag":"Providers and trust","count":4}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","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},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"styles.css","content":"h1,h2,h3,h4,h5,h6{font-family:\"Poppins\",sans-serif}"}],"page":{"pagePath":"api-reference/messages","slug":"/api-reference/messages","pageMetadata":{"title":"Messages","description":"Create a message using the Anthropic Messages format.","api":"POST /messages","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 using 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`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Heading,ParamField}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Creates a model response using the Anthropic Messages API request and response format. Like all\ninference endpoints, requests are served through the attested TEE gateway and return an\n`,_jsx(_components.code,{children:`x-receipt-id`}),` header for `,_jsx(_components.a,{href:`/guides/verify-a-response`,children:`verification`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,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:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.redpill.ai/v1/messages`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request body`}),`\n`,_jsx(ParamField,{body:`model`,type:`string`,required:true,id:`param-model`,children:_jsxs(_components.p,{children:[`Model id, for example `,_jsx(_components.code,{children:`anthropic/claude-haiku-4.5`}),`.`]})}),`\n`,_jsx(ParamField,{body:`max_tokens`,type:`integer`,required:true,id:`param-max-tokens`,children:_jsx(_components.p,{children:`Maximum number of tokens to generate.`})}),`\n`,_jsx(ParamField,{body:`messages`,type:`array`,required:true,id:`param-messages`,children:_jsxs(_components.p,{children:[`Conversation turns. Each item has a `,_jsx(_components.code,{children:`role`}),` (`,_jsx(_components.code,{children:`user`}),` or `,_jsx(_components.code,{children:`assistant`}),`) and `,_jsx(_components.code,{children:`content`}),` (a string or an\narray of content blocks).`]})}),`\n`,_jsx(ParamField,{body:`system`,type:`string`,id:`param-system`,children:_jsx(_components.p,{children:`A system prompt, sent as a top-level field rather than a message.`})}),`\n`,_jsx(ParamField,{body:`temperature`,type:`number`,id:`param-temperature`,children:_jsx(_components.p,{children:`Sampling temperature.`})}),`\n`,_jsx(ParamField,{body:`stream`,type:`boolean`,id:`param-stream`,children:_jsx(_components.p,{children:`Stream the response as server-sent events.`})}),`\n`,_jsxs(ParamField,{body:`provider`,type:`object`,id:`param-provider`,children:[_jsxs(_components.p,{children:[`Routing constraints for this request, applied together. `,_jsx(_components.code,{children:`zdr`}),` restricts routing to providers that\ndo not retain content; `,_jsx(_components.code,{children:`aci_verified`}),` restricts it to an upstream verified inside the TEE;\n`,_jsx(_components.code,{children:`aci_session_ids`}),` pins it to specific attested channels.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,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:`1`,children:[_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:`\"provider\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"aci_verified\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}}`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`If no provider satisfies the constraints the request fails before the prompt is sent, and failover\nretries stay inside the allowed set. Field reference:\n`,_jsx(_components.a,{href:`/api-reference/chat-completions#body-provider`,children:`Chat completions`}),`. See\n`,_jsx(_components.a,{href:`/guides/attested-routing`,children:`Attested routing`}),` and\n`,_jsx(_components.a,{href:`/guides/zero-data-retention`,children:`Zero data retention`}),`.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`example`,children:`Example`}),`\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.redpill.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 `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$REDPILL_AI_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_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\": \"anthropic/claude-haiku-4.5\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max_tokens\": 100,`})}),`\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\": \"Say hello in 3 words.\"}`})}),`\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`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,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:`12`,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_01ABC...\"`}),_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:`\"anthropic/claude-haiku-4.5\"`}),_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:`\"Hello, howdy, hi!\"`}),_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:`: { `}),_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:`14`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`8`}),_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:[`Read assistant text from `,_jsx(_components.code,{children:`content[].text`}),` on blocks with `,_jsx(_components.code,{children:`type: \"text\"`}),`. `,_jsx(_components.code,{children:`stop_reason`}),` is one of\n`,_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(Heading,{level:`2`,id:`related`,children:`Related`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Chat Completions`,icon:`comments`,href:`/api-reference/chat-completions`}),_jsx(Card,{title:`Responses`,icon:`arrow-right-arrow-left`,href:`/api-reference/responses`})]})]})}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","description":"Create a message using the Anthropic Messages format.","api":"POST /messages","href":"/api-reference/messages"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Request body","slug":"request-body","depth":2,"children":[]},{"title":"Example","slug":"example","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Related","slug":"related","depth":2,"children":[]}],"codeExamples":{},"endpoint":{"title":"Messages","path":"/messages","servers":[{"url":"https://api.redpill.ai/v1"}],"method":"post","request":{"security":[{"title":"Bearer Auth","parameters":{"header":{"Authorization":{"type":"http","scheme":"bearer","description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token."}},"query":{},"cookie":{}}}],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"model":[{"type":"string","description":"Model id, for example `anthropic/claude-haiku-4.5` .","required":true}],"max_tokens":[{"type":"integer","description":"Maximum number of tokens to generate.","required":true}],"messages":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"Conversation turns. Each item has a `role` ( `user` or `assistant` ) and `content` (a string or an array of content blocks).","required":true}],"system":[{"type":"string","description":"A system prompt, sent as a top-level field rather than a message."}],"temperature":[{"type":"number","description":"Sampling temperature."}],"stream":[{"type":"boolean","description":"Stream the response as server-sent events."}],"provider":[{"type":"object","properties":{},"description":"Routing constraints for this request, applied together. `zdr` restricts routing to providers that do not retain content; `aci_verified` restricts it to an upstream verified inside the TEE; `aci_session_ids` pins it to specific attested channels. If no provider satisfies the constraints the request fails before the prompt is sent, and failover retries stay inside the allowed set. Field reference: Chat completions . See Attested routing and Zero data retention ."}]}}],"examples":{"example":{"value":{"model":"\u003cstring>","max_tokens":123,"messages":[{}],"system":"\u003cstring>","temperature":123,"stream":true,"provider":{}}}}}}},"response":{},"deprecated":false}},"jsLinks":[],"subdomain":"phala-47f19b07","siteName":"RedPill AI","title":"Messages - RedPill AI","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-19T23:51:43.076Z","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 using the Anthropic Messages format.\">\u003cmeta data-mint-head name=\"application-name\" content=\"RedPill AI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/phala-47f19b07/Y9aC6lrEn-iBCXi1/_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/phala-47f19b07/Y9aC6lrEn-iBCXi1/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/phala-47f19b07/Y9aC6lrEn-iBCXi1/_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/phala-47f19b07/Y9aC6lrEn-iBCXi1/_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/phala-47f19b07/Y9aC6lrEn-iBCXi1/_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/phala-47f19b07/Y9aC6lrEn-iBCXi1/_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/phala-47f19b07/Y9aC6lrEn-iBCXi1/_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/phala-47f19b07/Y9aC6lrEn-iBCXi1/_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/phala-47f19b07/Y9aC6lrEn-iBCXi1/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Messages - RedPill AI\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create a message using the Anthropic Messages format.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"RedPill AI\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.redpill.ai/api-reference/messages\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://phala-47f19b07.mintlify.app/_mintlify/api/og/v2?division=Endpoints\u0026amp;title=Messages\u0026amp;description=Create+a+message+using+the+Anthropic+Messages+format.\u0026amp;theme=42df2522bd3507e897bd01fe\u0026amp;signature=e8e0f1bbe280754d4745345ee759143543b23705f896ec208e0b14053bd59ff0\">\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 - RedPill AI\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create a message using the Anthropic Messages format.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://phala-47f19b07.mintlify.app/_mintlify/api/og/v2?division=Endpoints\u0026amp;title=Messages\u0026amp;description=Create+a+message+using+the+Anthropic+Messages+format.\u0026amp;theme=42df2522bd3507e897bd01fe\u0026amp;signature=e8e0f1bbe280754d4745345ee759143543b23705f896ec208e0b14053bd59ff0\">\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/phala-47f19b07/Y9aC6lrEn-iBCXi1/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"RedPill AI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#c96442\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.redpill.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.redpill.ai/#organization\",\"name\":\"RedPill AI\",\"url\":\"https://docs.redpill.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/phala-47f19b07/5vRaVvmX8pi5Nukr/logo/light.svg?fit=max\u0026auto=format\u0026n=5vRaVvmX8pi5Nukr\u0026q=85\u0026s=03f8dbe12d0f593a956cccba7b18115f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.redpill.ai#website\",\"name\":\"RedPill AI\",\"url\":\"https://docs.redpill.ai\",\"publisher\":{\"@id\":\"https://docs.redpill.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.redpill.ai/api-reference/messages#webpage\",\"url\":\"https://docs.redpill.ai/api-reference/messages\",\"name\":\"Messages\",\"description\":\"Create a message using the Anthropic Messages format.\",\"dateModified\":\"2026-09-19T23:51:43.076Z\",\"isPartOf\":{\"@id\":\"https://docs.redpill.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.redpill.ai/api-reference/messages#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.redpill.ai/api-reference/messages#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.redpill.ai/api-reference/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Messages\",\"item\":\"https://docs.redpill.ai/api-reference/messages\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.redpill.ai/api-reference/messages#apireference\",\"headline\":\"Messages\",\"name\":\"Messages\",\"description\":\"Create a message using the Anthropic Messages format.\",\"url\":\"https://docs.redpill.ai/api-reference/messages\",\"mainEntityOfPage\":{\"@id\":\"https://docs.redpill.ai/api-reference/messages#webpage\"},\"dateModified\":\"2026-09-19T23:51:43.076Z\",\"publisher\":{\"@id\":\"https://docs.redpill.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.redpill.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"RedPill AI\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"RedPill AI","nav":{"global":{"anchors":[{"anchor":"Community","icon":"discord","href":"https://discord.gg/P2ukR4Z5ps"},{"anchor":"GitHub","icon":"github","href":"https://github.com/redpill-ai"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/get-started/introduction"}]},{"tab":"API Reference","groups":[{"group":"Endpoints","pages":[{"title":"Overview","href":"/api-reference/overview"},{"title":"Chat completions","api":"POST /chat/completions","href":"/api-reference/chat-completions"},{"title":"Responses","description":"Create a model response using the Responses API format.","api":"POST /responses","href":"/api-reference/responses"},{"title":"Messages","api":"POST /messages","href":"/api-reference/messages"},{"title":"Embeddings","description":"Create text embeddings.","api":"POST /embeddings","href":"/api-reference/embeddings"},{"title":"System One","api":"POST /systemone","href":"/api-reference/systemone"},{"title":"Models","api":"GET /models","href":"/api-reference/models"},{"title":"Completions (legacy)","api":"POST /completions","href":"/api-reference/completions"}]},{"group":"Verification","pages":[{"title":"Attestation report","api":"GET https://tee.redpill.ai/v1/aci/attestation","href":"/api-reference/attestation"},{"title":"Receipt","api":"GET https://tee.redpill.ai/v1/aci/receipts/{id}","href":"/api-reference/receipts"},{"title":"Session","api":"GET https://tee.redpill.ai/v1/aci/sessions/{session_id}","href":"/api-reference/sessions"}]}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Messages - RedPill AI","buildId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","deploymentId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-C8RPHPxo.js","utils-0BK-9q6z.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DfjzsUJT.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B4v9psJ4.js","snippetPresets-CpTQv-Ez.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-BNP-Fvr0.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BSgu6h1D.js","shallow-Biv1i9Gs.js","getApiPlaygroundDisplay-BoGOXhtF.js","CodeSnippet-DvQoT18_.js","CodeSnippets-Dnpa15xT.js","Page-Buji1S4J.js","getPastedJson-xAIyhUFE.js","icon-S6FBih11.js","MethodPill-SaYeUZyk.js","DuplicateIcon-Cs-p3v2Q.js","createIcon-DjCFEoHq.js","DynamicMarkdown-BcnBltEQ.js","SectionHeading-BUBl0eEF.js","axios-vUo_bRtp.js"]}