curl https://compute.prentis.ai/v1/messages \
-H "x-api-key: $PRENTIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash",
"system": "You are a concise assistant.",
"messages": [
{"role": "user", "content": "Summarise the CAP theorem in two sentences."}
],
"max_tokens": 200,
"temperature": 0.7
}'
import os
import anthropic
# The SDK appends /v1/messages itself, so it takes the origin.
client = anthropic.Anthropic(base_url="https://compute.prentis.ai", api_key=os.environ["PRENTIS_API_KEY"])
msg = client.messages.create(
model="deepseek-v4.1-flash",
system="You are a concise assistant.",
messages=[{"role": "user", "content": "Summarise the CAP theorem in two sentences."}],
max_tokens=200,
)
print(msg.content[0].text)
import Anthropic from "@anthropic-ai/sdk";
// The SDK appends /v1/messages itself, so it takes the origin.
const client = new Anthropic({
baseURL: "https://compute.prentis.ai",
apiKey: process.env.PRENTIS_API_KEY,
});
const msg = await client.messages.create({
model: "deepseek-v4.1-flash",
system: "You are a concise assistant.",
messages: [{ role: "user", content: "Summarise the CAP theorem in two sentences." }],
max_tokens: 200,
});
console.log(msg.content[0]?.type === "text" ? msg.content[0].text : "");
{
"id": "msg_01K5S8QW6ATE",
"type": "message",
"role": "assistant",
"model": "deepseek-v4.1-flash",
"content": [
{
"type": "text",
"text": "A distributed store can hold at most two of consistency, availability and partition tolerance at once. Because partitions do happen in practice, the real choice is between answering with stale data and not answering at all."
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 28,
"output_tokens": 47,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0
}
}
Anthropic-compatible Messages endpoint. Anthropic SDKs and Claude Code work by changing base_url alone, and x-api-key is accepted alongside Authorization: Bearer. Pass a Prentis model name — there is no claude-* aliasing.
POST
/
messages
cURL
curl https://compute.prentis.ai/v1/messages \
-H "x-api-key: $PRENTIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash",
"system": "You are a concise assistant.",
"messages": [
{"role": "user", "content": "Summarise the CAP theorem in two sentences."}
],
"max_tokens": 200,
"temperature": 0.7
}'
import os
import anthropic
# The SDK appends /v1/messages itself, so it takes the origin.
client = anthropic.Anthropic(base_url="https://compute.prentis.ai", api_key=os.environ["PRENTIS_API_KEY"])
msg = client.messages.create(
model="deepseek-v4.1-flash",
system="You are a concise assistant.",
messages=[{"role": "user", "content": "Summarise the CAP theorem in two sentences."}],
max_tokens=200,
)
print(msg.content[0].text)
import Anthropic from "@anthropic-ai/sdk";
// The SDK appends /v1/messages itself, so it takes the origin.
const client = new Anthropic({
baseURL: "https://compute.prentis.ai",
apiKey: process.env.PRENTIS_API_KEY,
});
const msg = await client.messages.create({
model: "deepseek-v4.1-flash",
system: "You are a concise assistant.",
messages: [{ role: "user", content: "Summarise the CAP theorem in two sentences." }],
max_tokens: 200,
});
console.log(msg.content[0]?.type === "text" ? msg.content[0].text : "");
{
"id": "msg_01K5S8QW6ATE",
"type": "message",
"role": "assistant",
"model": "deepseek-v4.1-flash",
"content": [
{
"type": "text",
"text": "A distributed store can hold at most two of consistency, availability and partition tolerance at once. Because partitions do happen in practice, the real choice is between answering with stale data and not answering at all."
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 28,
"output_tokens": 47,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0
}
}
Model names stay ours. There is no claude-* aliasing — pass a model from
GET /models. See
Models and resource names.max_tokens is optional. Anthropic’s API requires it; here, omitting it falls back to
the model’s own default rather than failing the call.
Only used with model auto or auto-open: send the same value on every turn of one conversation and the platform keeps it on the same model where it can. Takes precedence over prompt_cache_key; without either, the conversation is recognised by how it began.
Which model answers the call. A bare slug for platform models (deepseek-v4.1-flash), or a full resource name for something your account owns (accounts/{account}/models/{model}, or a deployment). Never an upstream vendor's own name. auto (Prentis One) asks the platform to choose the model for each call; auto-open (Prentis One Open) chooses among open-weight models only, and on hard questions has three of them answer and keeps the best answer. auto:[,...] or auto-open:[,...] limits the choice to the models you list. auto-open sets each model's reasoning effort itself and ignores reasoning_effort, reasoning and thinking. Both are rolling out gradually; see Prentis One.
The conversation so far, oldest first. Only user and assistant turns -- the system prompt travels in its own system field. Content is a string, or a list of text / image / tool_use / tool_result blocks.
Ceiling on how many tokens may be generated. Anthropic's own API requires this; here it is optional and falls back to the model's default rather than failing the call.
Return the answer as server-sent events as it is generated, instead of one response at the end. The last data event carries the usage numbers either way.
Not supported. Sending it returns INVALID_REQUEST.
Response
OK. With stream: true the same call answers text/event-stream instead, as Anthropic's named events: message_start, the content block events, message_delta carrying the final usage, and message_stop, which ends the stream. There is no [DONE] line.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Prentis","description":"One inference API. An OpenAI client and an Anthropic client reach the same models.","colors":{"primary":"#c23f20","light":"#ff8560","dark":"#ff6a45"},"favicon":"https://mintcdn.com/prentis-ai/N5ENIat7Mkyl6KAd/favicon.svg?fit=max\u0026auto=format\u0026n=N5ENIat7Mkyl6KAd\u0026q=85\u0026s=b900f7aa935aac89600b2c81d72832a0","background":{"color":{"light":"#f7f7f8","dark":"#0b0b0d"}},"navbar":{"links":[{"href":"https://compute.prentis.ai","label":"Console"}],"primary":{"type":"button","label":"Get an API key","href":"https://compute.prentis.ai"}},"footer":{"socials":{}},"fonts":{"heading":{"family":"Archivo","weight":600},"body":{"family":"Archivo","weight":400}},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"prentis-ai","hasAudioNarration":false,"actualSubdomain":"prentis-ai","customDomains":["docs.compute.prentis.ai"],"gitSource":{"type":"github","owner":"prentisai","repo":"maas","deployBranch":"main","contentDirectory":"maas-platform/docs-site","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6af42e06ec28eb92a90a0ace","clientVersion":"0.0.4111","searchFilterCounts":[{"language":"default","tag":"API reference","count":27},{"language":"default","tag":"Documentation","count":20},{"language":"default","tag":"Fine-tuning","count":12},{"language":"default","tag":"Datasets","count":7},{"language":"default","tag":"Guides","count":7},{"language":"default","tag":"Platform","count":6},{"language":"default","tag":"Inference","count":5},{"language":"default","tag":"Get started","count":4},{"language":"default","tag":"Models","count":2},{"language":"default","tag":"Reference","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"/* latin-ext */\n@font-face {\n font-family: 'DM Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/dmmono/v16/aFTU7PB1QTsUX8KYthSQBLyM.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'DM Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/dmmono/v16/aFTU7PB1QTsUX8KYthqQBA.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* latin-ext */\n@font-face {\n font-family: 'DM Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/dmmono/v16/aFTR7PB1QTsUX8KYvumzEY2tbZX9.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'DM Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/dmmono/v16/aFTR7PB1QTsUX8KYvumzEYOtbQ.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\ncode,pre,kbd,samp,.font-mono,[class*=\"language-\"]{font-family:\"DM Mono\", ui-monospace, SFMono-Regular, Menlo, monospace!important}.nav-logo{display:inline-flex;align-items:center;gap:0.5rem;font-weight:600!important;letter-spacing:-0.03em}.nav-logo::before{content:\"\";flex:none;width:1.75rem;height:1.75rem;background:url(\"/logo/light.svg\") center / contain no-repeat}html.dark .nav-logo::before{background-image:url(\"/logo/dark.svg\")}"}],"page":{"pagePath":"api-reference/messages","slug":"/api-reference/messages","pageMetadata":{"title":"Messages","openapi":"openapi/prentis.openapi.yaml POST /messages","description":"Anthropic-compatible Messages endpoint. Anthropic SDKs and Claude Code work by changing base_url alone, and x-api-key is accepted alongside Authorization: Bearer. Pass a Prentis model name -- there is no claude-* aliasing.","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: \"Anthropic-compatible Messages endpoint. Anthropic SDKs and Claude Code work by changing base_url alone, and x-api-key is accepted alongside Authorization: Bearer. Pass a Prentis model name — there is no claude-* aliasing.\"\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`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Anthropic’s wire format, served by the same models as everything else here. Anthropic SDKs\nand Claude Code work by changing `,_jsx(_components.code,{children:`base_url`}),` alone.`]}),`\n`,_jsx(Heading,{level:`2`,id:`two-differences-from-anthropic’s-own-api`,children:`Two differences from Anthropic’s own API`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Model names stay ours.`}),` There is no `,_jsx(_components.code,{children:`claude-*`}),` aliasing — pass a model from\n`,_jsx(_components.a,{href:`/api-reference/list-models`,children:_jsx(_components.code,{children:`GET /models`})}),`. See\n`,_jsx(_components.a,{href:`/models-and-resource-names`,children:`Models and resource names`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`max_tokens`}),` is optional.`]}),` Anthropic’s API requires it; here, omitting it falls back to\nthe model’s own default rather than failing the call.`]}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsx(_components.p,{children:`Both headers work, and they name the same key:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`x-api-key:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $PRENTIS_API_KEY`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# or`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Authorization:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Bearer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $PRENTIS_API_KEY`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The SDKs append `,_jsx(_components.code,{children:`/v1/messages`}),` themselves, so construct them with the origin:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,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:`4`,children:[_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:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://compute.prentis.ai\"`}),_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:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"PRENTIS_API_KEY\"`}),_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`]})})})]})}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","openapi":"openapi/prentis.openapi.yaml POST /messages","description":"Anthropic-compatible Messages endpoint. Anthropic SDKs and Claude Code work by changing base_url alone, and x-api-key is accepted alongside Authorization: Bearer. Pass a Prentis model name -- there is no claude-* aliasing.","href":"/api-reference/messages"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Two differences from Anthropic’s own API","slug":"two-differences-from-anthropic’s-own-api","depth":2,"children":[]},{"title":"Authentication","slug":"authentication","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["messages"],"operationId":"createMessage","summary":"Create a message","parameters":["48fcd36c-e159-48e7-8479-5e4aa3f5de15"],"requestBody":"9e1e782b-6539-4a6e-b503-7b2155b49def","responses":{"200":"f79a42e5-225b-4e4d-9530-9e6b4b01f424","4XX":"e9228131-08d9-469f-809f-b7723cfc8fc6","5XX":"eaeca04a-fd50-4908-a07b-01c715596ff4"},"description":"Anthropic-compatible Messages endpoint. Anthropic SDKs and Claude Code work by changing base_url alone, and x-api-key is accepted alongside Authorization: Bearer. Pass a Prentis model name -- there is no claude-* aliasing.","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl https://compute.prentis.ai/v1/messages \\\n -H \"x-api-key: $PRENTIS_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"deepseek-v4.1-flash\",\n \"system\": \"You are a concise assistant.\",\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Summarise the CAP theorem in two sentences.\"}\n ],\n \"max_tokens\": 200,\n \"temperature\": 0.7\n }'"},{"lang":"python","label":"Python","source":"import os\nimport anthropic\n\n# The SDK appends /v1/messages itself, so it takes the origin.\nclient = anthropic.Anthropic(base_url=\"https://compute.prentis.ai\", api_key=os.environ[\"PRENTIS_API_KEY\"])\n\nmsg = client.messages.create(\n model=\"deepseek-v4.1-flash\",\n system=\"You are a concise assistant.\",\n messages=[{\"role\": \"user\", \"content\": \"Summarise the CAP theorem in two sentences.\"}],\n max_tokens=200,\n)\nprint(msg.content[0].text)"},{"lang":"typescript","label":"TypeScript","source":"import Anthropic from \"@anthropic-ai/sdk\";\n\n// The SDK appends /v1/messages itself, so it takes the origin.\nconst client = new Anthropic({\n baseURL: \"https://compute.prentis.ai\",\n apiKey: process.env.PRENTIS_API_KEY,\n});\n\nconst msg = await client.messages.create({\n model: \"deepseek-v4.1-flash\",\n system: \"You are a concise assistant.\",\n messages: [{ role: \"user\", content: \"Summarise the CAP theorem in two sentences.\" }],\n max_tokens: 200,\n});\nconsole.log(msg.content[0]?.type === \"text\" ? msg.content[0].text : \"\");"}],"method":"post","type":"path","servers":["a3022ce8-f932-4252-8316-d669cc78c26f"],"security":["ec9bf384-669f-490d-b83a-1407651fbe50"],"path":"/messages","baseUrlOptions":["https://compute.prentis.ai/v1"],"title":"Create a message","codeSamples":[{"label":"cURL","lang":"curl","source":"curl https://compute.prentis.ai/v1/messages \\\n -H \"x-api-key: $PRENTIS_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"deepseek-v4.1-flash\",\n \"system\": \"You are a concise assistant.\",\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Summarise the CAP theorem in two sentences.\"}\n ],\n \"max_tokens\": 200,\n \"temperature\": 0.7\n }'"},{"label":"Python","lang":"python","source":"import os\nimport anthropic\n\n# The SDK appends /v1/messages itself, so it takes the origin.\nclient = anthropic.Anthropic(base_url=\"https://compute.prentis.ai\", api_key=os.environ[\"PRENTIS_API_KEY\"])\n\nmsg = client.messages.create(\n model=\"deepseek-v4.1-flash\",\n system=\"You are a concise assistant.\",\n messages=[{\"role\": \"user\", \"content\": \"Summarise the CAP theorem in two sentences.\"}],\n max_tokens=200,\n)\nprint(msg.content[0].text)"},{"label":"TypeScript","lang":"typescript","source":"import Anthropic from \"@anthropic-ai/sdk\";\n\n// The SDK appends /v1/messages itself, so it takes the origin.\nconst client = new Anthropic({\n baseURL: \"https://compute.prentis.ai\",\n apiKey: process.env.PRENTIS_API_KEY,\n});\n\nconst msg = await client.messages.create({\n model: \"deepseek-v4.1-flash\",\n system: \"You are a concise assistant.\",\n messages: [{ role: \"user\", content: \"Summarise the CAP theorem in two sentences.\" }],\n max_tokens: 200,\n});\nconsole.log(msg.content[0]?.type === \"text\" ? msg.content[0].text : \"\");"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{"48fcd36c-e159-48e7-8479-5e4aa3f5de15":{"name":"x-session-affinity","in":"header","required":false,"schema":{"type":"string","maxLength":256,"isRequired":false,"description":"Only used with model auto or auto-open: send the same value on every turn of one conversation and the platform keeps it on the same model where it can. Takes precedence over prompt_cache_key; without either, the conversation is recognised by how it began.","uniqueKey":"","typeLabel":"string"},"description":"Only used with model auto or auto-open: send the same value on every turn of one conversation and the platform keeps it on the same model where it can. Takes precedence over prompt_cache_key; without either, the conversation is recognised by how it began."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","description":"Which model answers the call. A bare slug for platform models (deepseek-v4.1-flash), or a full resource name for something your account owns (accounts/{account}/models/{model}, or a deployment). Never an upstream vendor's own name. auto (Prentis One) asks the platform to choose the model for each call; auto-open (Prentis One Open) chooses among open-weight models only, and on hard questions has three of them answer and keeps the best answer. auto:\u003cmodel>[,\u003cmodel>...] or auto-open:\u003cmodel>[,\u003cmodel>...] limits the choice to the models you list. auto-open sets each model's reasoning effort itself and ignores reasoning_effort, reasoning and thinking. Both are rolling out gradually; see Prentis One.","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"messages":{"type":"array","minItems":1,"items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant"],"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":{"type":"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":"The conversation so far, oldest first. Only user and assistant turns -- the system prompt travels in its own system field. Content is a string, or a list of text / image / tool_use / tool_result blocks.","isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"system":{"oneOf":[{"type":"string","description":"Instructions that sit outside the conversation. Counted as input tokens like any other prompt text.","uniqueKey":"system.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"object","uniqueKey":"system.oneOf.1.items.[INDEX]","typeLabel":"object"},"description":"Instructions that sit outside the conversation. Counted as input tokens like any other prompt text.","uniqueKey":"system.oneOf.1","typeLabel":"object[]"}],"uniqueKey":"system","typeLabel":"string | object[]"},"max_tokens":{"type":"integer","minimum":1,"description":"Ceiling on how many tokens may be generated. Anthropic's own API requires this; here it is optional and falls back to the model's default rather than failing the call.","uniqueKey":"max_tokens","typeLabel":"integer"},"stream":{"type":"boolean","default":false,"description":"Return the answer as server-sent events as it is generated, instead of one response at the end. The last data event carries the usage numbers either way.","uniqueKey":"stream","typeLabel":"boolean"},"stop_sequences":{"type":"array","items":{"type":"string","uniqueKey":"stop_sequences.items.[INDEX]","typeLabel":"string"},"maxItems":4,"description":"Up to 4 strings that end generation as soon as the model produces one. The matched string is not included in the output.","uniqueKey":"stop_sequences","typeLabel":"string[]"},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"How much randomness to allow when picking each token. Lower is more repeatable, higher is more varied.","uniqueKey":"temperature","typeLabel":"number"},"top_p":{"type":"number","minimum":0,"maximum":1,"description":"Nucleus sampling: only consider the most likely tokens up to this share of the probability mass. Tune this or temperature, not both.","uniqueKey":"top_p","typeLabel":"number"},"top_k":{"type":"integer","description":"Accepted so Anthropic clients do not break, then dropped: it is not passed to the model.","uniqueKey":"top_k","typeLabel":"integer"},"tools":{"type":"array","items":{"type":"object","uniqueKey":"tools.items.[INDEX]","typeLabel":"object"},"description":"Tool definitions in Anthropic's shape ({name, description, input_schema}). Server-side built-in tools are rejected by name.","uniqueKey":"tools","typeLabel":"object[]"},"tool_choice":{"type":"object","description":"Whether the model may, must, or must not call a tool: auto, any, none, or one named tool.","uniqueKey":"tool_choice","typeLabel":"object"},"metadata":{"type":"object","properties":{"user_id":{"type":"string","uniqueKey":"metadata.user_id","typeLabel":"string"}},"description":"Free-form metadata about the call. metadata.user_id is the equivalent of the user field on the OpenAI-shaped endpoints.","uniqueKey":"metadata","typeLabel":"object"},"thinking":{"type":"object","description":"Extended thinking configuration. Ignored with model auto-open, which sets each model's reasoning itself.","uniqueKey":"thinking","typeLabel":"object"},"output_config":{"type":"object","description":"Vendor-specific output configuration.\n\n**Not supported.** Sending it returns `INVALID_REQUEST`.","uniqueKey":"output_config","typeLabel":"object"},"raw_output":{"type":"object","description":"Vendor-specific raw output configuration.\n\n**Not supported.** Sending it returns `INVALID_REQUEST`.","uniqueKey":"raw_output","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"model":"\u003cstring>","messages":[{"content":"\u003cstring>"}],"system":"\u003cstring>","max_tokens":2,"stream":false,"stop_sequences":["\u003cstring>"],"temperature":1,"top_p":0.5,"top_k":123,"tools":[{}],"tool_choice":{},"metadata":{"user_id":"\u003cstring>"},"thinking":{},"output_config":{},"raw_output":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"f79a42e5-225b-4e4d-9530-9e6b4b01f424":{"headers":{"x-request-id":{"schema":{"type":"string"},"required":true,"description":"On every response, successes and errors alike. It is the handle that reaches the whole path your request took -- quote it when you ask us anything about a call."},"x-ratelimit-limit-requests":{"schema":{"type":"integer","minimum":0}},"x-ratelimit-remaining-requests":{"schema":{"type":"integer","minimum":0}},"x-ratelimit-limit-tokens":{"schema":{"type":"integer","minimum":0}},"x-ratelimit-remaining-tokens":{"schema":{"type":"integer","minimum":0}},"x-provider-class":{"schema":{"type":"string","enum":["primary","fallback"]},"description":"primary or fallback: whether your call was served by the first choice or a standby. It never names who served it."},"x-router-trace-id":{"schema":{"type":"string"},"description":"Only when you called model auto or auto-open: the id of the choice the platform made for this call. Quote it together with x-request-id when you ask us why a call went where it did."},"x-config-version":{"schema":{"type":"string"},"description":"Which version of the routing configuration was in effect for this call. Useful only when comparing two calls that behaved differently."}},"content":{"application/json":{"schema":{"type":"object","required":["id","type","role","model","content","usage"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"type":{"type":"string","const":"message","isRequired":true,"uniqueKey":"type","typeLabel":"string"},"role":{"type":"string","const":"assistant","isRequired":true,"uniqueKey":"role","typeLabel":"string"},"model":{"type":"string","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"content":{"type":"array","items":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["text","tool_use"],"isRequired":true,"uniqueKey":"content.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"text":{"type":"string","uniqueKey":"content.items.[INDEX].text","typeLabel":"string"},"id":{"type":"string","uniqueKey":"content.items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","uniqueKey":"content.items.[INDEX].name","typeLabel":"string"},"input":{"type":"object","uniqueKey":"content.items.[INDEX].input","typeLabel":"object"}},"uniqueKey":"content.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"content","typeLabel":"object[]"},"usage":{"type":"object","required":["input_tokens","output_tokens"],"properties":{"input_tokens":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"usage.input_tokens","typeLabel":"integer"},"output_tokens":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"usage.output_tokens","typeLabel":"integer"},"cache_read_input_tokens":{"type":"integer","minimum":0,"uniqueKey":"usage.cache_read_input_tokens","typeLabel":"integer"},"cache_creation_input_tokens":{"type":"integer","minimum":0,"uniqueKey":"usage.cache_creation_input_tokens","typeLabel":"integer"}},"isRequired":true,"uniqueKey":"usage","typeLabel":"object"},"stop_reason":{"oneOf":[{"type":"string","enum":["end_turn","max_tokens","stop_sequence","tool_use","refusal",null],"uniqueKey":"stop_reason.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["end_turn","max_tokens","stop_sequence","tool_use","refusal",null],"uniqueKey":"stop_reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"stop_reason","typeLabel":"enum\u003cstring> | null"},"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"},"example":{"id":"msg_01K5S8QW6ATE","type":"message","role":"assistant","model":"deepseek-v4.1-flash","content":[{"type":"text","text":"A distributed store can hold at most two of consistency, availability and partition tolerance at once. Because partitions do happen in practice, the real choice is between answering with stale data and not answering at all."}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":28,"output_tokens":47,"cache_read_input_tokens":0,"cache_creation_input_tokens":0}},"examples":{"Example":{"title":"Example","value":{"id":"msg_01K5S8QW6ATE","type":"message","role":"assistant","model":"deepseek-v4.1-flash","content":[{"type":"text","text":"A distributed store can hold at most two of consistency, availability and partition tolerance at once. Because partitions do happen in practice, the real choice is between answering with stale data and not answering at all."}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":28,"output_tokens":47,"cache_read_input_tokens":0,"cache_creation_input_tokens":0}}}},"exampleType":"examples"},"text/event-stream":{"schema":{"type":"string","uniqueKey":"","typeLabel":"string"},"example":"event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01K5S8QW6ATE\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4.1-flash\",\"content\":[],\"usage\":{\"input_tokens\":28,\"output_tokens\":0}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"A distributed store\"}}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":47}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}","examples":{"Example":{"title":"Example","value":"event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01K5S8QW6ATE\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4.1-flash\",\"content\":[],\"usage\":{\"input_tokens\":28,\"output_tokens\":0}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"A distributed store\"}}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":47}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}"}},"exampleType":"examples"}},"description":"OK. With `stream: true` the same call answers `text/event-stream` instead, as Anthropic's named events: `message_start`, the content block events, `message_delta` carrying the final `usage`, and `message_stop`, which ends the stream. There is no `[DONE]` line.","exampleType":"examples"},"e9228131-08d9-469f-809f-b7723cfc8fc6":{"headers":{"x-request-id":{"schema":{"type":"string"},"required":true,"description":"On every response, successes and errors alike. It is the handle that reaches the whole path your request took -- quote it when you ask us anything about a call."},"Retry-After":{"schema":{"type":"integer","minimum":0},"description":"How many seconds to wait before retrying, on the responses that set it."}},"content":{"application/json":{"schema":{"type":"object","required":["type","error"],"properties":{"type":{"type":"string","const":"error","isRequired":true,"uniqueKey":"type","typeLabel":"string"},"error":{"type":"object","required":["type","message"],"properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","not_found_error","request_too_large","rate_limit_error","api_error","overloaded_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"code":{"type":"string","uniqueKey":"code","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"param.oneOf.1","typeLabel":"null"}],"uniqueKey":"param","typeLabel":"string | null"},"request_id":{"type":"string","uniqueKey":"request_id","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"error","error":{"type":"invalid_request_error","message":"\u003cstring>"},"code":"\u003cstring>","param":"\u003cstring>","request_id":"\u003cstring>"}}},"exampleType":"generated"}},"description":"OK.","exampleType":"generated"},"eaeca04a-fd50-4908-a07b-01c715596ff4":{"headers":{"x-request-id":{"schema":{"type":"string"},"required":true,"description":"On every response, successes and errors alike. It is the handle that reaches the whole path your request took -- quote it when you ask us anything about a call."}},"content":{"application/json":{"schema":{"type":"object","required":["type","error"],"properties":{"type":{"type":"string","const":"error","isRequired":true,"uniqueKey":"type","typeLabel":"string"},"error":{"type":"object","required":["type","message"],"properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","not_found_error","request_too_large","rate_limit_error","api_error","overloaded_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"code":{"type":"string","uniqueKey":"code","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"param.oneOf.1","typeLabel":"null"}],"uniqueKey":"param","typeLabel":"string | null"},"request_id":{"type":"string","uniqueKey":"request_id","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"error","error":{"type":"invalid_request_error","message":"\u003cstring>"},"code":"\u003cstring>","param":"\u003cstring>","request_id":"\u003cstring>"}}},"exampleType":"generated"}},"description":"OK.","exampleType":"generated"}},"security":{"ec9bf384-669f-490d-b83a-1407651fbe50":{"bearerAuth":{"type":"http","scheme":"bearer","description":"`Authorization: Bearer \u003cyour API key>`. On `/v1/messages`, the Anthropic-style `x-api-key: \u003cyour API key>` header is accepted instead.","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"a3022ce8-f932-4252-8316-d669cc78c26f":{"url":"https://compute.prentis.ai/v1","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"`Authorization: Bearer \u003cyour API key>`. On `/v1/messages`, the Anthropic-style `x-api-key: \u003cyour API key>` header is accepted instead.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"`Authorization: Bearer \u003cyour API key>`. On `/v1/messages`, the Anthropic-style `x-api-key: \u003cyour API key>` header is accepted instead.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"openapi/prentis.openapi.yaml"},"subdomain":"prentis-ai","siteName":"Prentis","title":"Messages - Prentis","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-22T06:01:51.492Z","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=\"Anthropic-compatible Messages endpoint. Anthropic SDKs and Claude Code work by changing base_url alone, and x-api-key is accepted alongside Authorization: Bearer. Pass a Prentis model name -- there is no claude-* aliasing.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Prentis\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/prentis-ai/Z7SKdd5Lmipoo44k/_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/prentis-ai/Z7SKdd5Lmipoo44k/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/prentis-ai/Z7SKdd5Lmipoo44k/_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/prentis-ai/Z7SKdd5Lmipoo44k/_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/prentis-ai/Z7SKdd5Lmipoo44k/_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/prentis-ai/Z7SKdd5Lmipoo44k/_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/prentis-ai/Z7SKdd5Lmipoo44k/_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/prentis-ai/Z7SKdd5Lmipoo44k/_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/prentis-ai/Z7SKdd5Lmipoo44k/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Messages - Prentis\">\u003cmeta data-mint-head property=\"og:description\" content=\"Anthropic-compatible Messages endpoint. Anthropic SDKs and Claude Code work by changing base_url alone, and x-api-key is accepted alongside Authorization: Bearer. Pass a Prentis model name -- there is no claude-* aliasing.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Prentis\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.compute.prentis.ai/api-reference/messages\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://prentis-ai.mintlify.site/_mintlify/api/og/v2?division=Inference\u0026amp;title=Messages\u0026amp;description=Anthropic-compatible+Messages+endpoint.+Anthropic+SDKs+and+Claude+Code+work+by+changing+base_url+alone%2C+and+x-api-key+is+accepted+alongside+Authorization%3A+Beare\u0026amp;theme=8d4bc0888e4ddbbd2b1e51c1\u0026amp;signature=fc3ec91c55325dbee9d0eca38bfb0ddf777a5955bb8b4404c51516ee7c1624ff\">\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 - Prentis\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Anthropic-compatible Messages endpoint. Anthropic SDKs and Claude Code work by changing base_url alone, and x-api-key is accepted alongside Authorization: Bearer. Pass a Prentis model name -- there is no claude-* aliasing.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://prentis-ai.mintlify.site/_mintlify/api/og/v2?division=Inference\u0026amp;title=Messages\u0026amp;description=Anthropic-compatible+Messages+endpoint.+Anthropic+SDKs+and+Claude+Code+work+by+changing+base_url+alone%2C+and+x-api-key+is+accepted+alongside+Authorization%3A+Beare\u0026amp;theme=8d4bc0888e4ddbbd2b1e51c1\u0026amp;signature=fc3ec91c55325dbee9d0eca38bfb0ddf777a5955bb8b4404c51516ee7c1624ff\">\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/prentis-ai/Z7SKdd5Lmipoo44k/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Prentis\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#c23f20\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.compute.prentis.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.compute.prentis.ai/#organization\",\"name\":\"Prentis\",\"url\":\"https://docs.compute.prentis.ai\"},{\"@type\":\"WebSite\",\"@id\":\"https://docs.compute.prentis.ai#website\",\"name\":\"Prentis\",\"url\":\"https://docs.compute.prentis.ai\",\"publisher\":{\"@id\":\"https://docs.compute.prentis.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.compute.prentis.ai/api-reference/messages#webpage\",\"url\":\"https://docs.compute.prentis.ai/api-reference/messages\",\"name\":\"Messages\",\"description\":\"Anthropic-compatible Messages endpoint. Anthropic SDKs and Claude Code work by changing base_url alone, and x-api-key is accepted alongside Authorization: Bearer. Pass a Prentis model name -- there is no claude-* aliasing.\",\"dateModified\":\"2026-09-22T06:01:51.492Z\",\"isPartOf\":{\"@id\":\"https://docs.compute.prentis.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.compute.prentis.ai/api-reference/messages#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.compute.prentis.ai/api-reference/messages#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Inference\",\"item\":\"https://docs.compute.prentis.ai/api-reference/chat-completions\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Messages\",\"item\":\"https://docs.compute.prentis.ai/api-reference/messages\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.compute.prentis.ai/api-reference/messages#apireference\",\"headline\":\"Messages\",\"name\":\"Messages\",\"description\":\"Anthropic-compatible Messages endpoint. Anthropic SDKs and Claude Code work by changing base_url alone, and x-api-key is accepted alongside Authorization: Bearer. Pass a Prentis model name -- there is no claude-* aliasing.\",\"url\":\"https://docs.compute.prentis.ai/api-reference/messages\",\"mainEntityOfPage\":{\"@id\":\"https://docs.compute.prentis.ai/api-reference/messages#webpage\"},\"dateModified\":\"2026-09-22T06:01:51.492Z\",\"publisher\":{\"@id\":\"https://docs.compute.prentis.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.compute.prentis.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Prentis\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Prentis\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/messages.md","siteName":"Prentis","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API reference","groups":[{"group":"Overview","pages":[{"title":"API reference","href":"/api-reference/introduction"}]},{"group":"Inference","pages":[{"title":"Chat completions","openapi":"openapi/prentis.openapi.yaml POST /chat/completions","href":"/api-reference/chat-completions"},{"title":"Completions","openapi":"openapi/prentis.openapi.yaml POST /completions","description":"Legacy text completion, for prompts that are not a conversation. Only models that declare the text-completion capability accept it; the rest return MODEL_CAPABILITY_UNSUPPORTED.","href":"/api-reference/completions"},{"title":"Messages","openapi":"openapi/prentis.openapi.yaml POST /messages","href":"/api-reference/messages"},{"title":"Responses","openapi":"openapi/prentis.openapi.yaml POST /responses","description":"OpenAI Responses-compatible endpoint, stateless. Codex and other Responses clients work by changing base_url alone. Every call must send store false and carry the full conversation in input: nothing is kept to continue from, so previous_response_id and retrieving a response later are not offered.","href":"/api-reference/responses"},{"title":"Audio transcriptions","openapi":"openapi/prentis.openapi.yaml POST /audio/transcriptions","href":"/api-reference/audio-transcriptions"}]},{"group":"Models","pages":[{"title":"List models","openapi":"openapi/prentis.openapi.yaml GET /models","href":"/api-reference/list-models"},{"title":"Get model","openapi":"openapi/prentis.openapi.yaml GET /models/{model}","href":"/api-reference/get-model"}]},{"group":"Fine-tuning","pages":[{"title":"Create a supervised fine-tuning job","openapi":"openapi/prentis-training.openapi.yaml POST /accounts/{account}/supervisedFineTuningJobs","href":"/api-reference/create-supervised-fine-tuning-job"},{"title":"Estimate a supervised fine-tuning job","openapi":"openapi/prentis-training.openapi.yaml POST /accounts/{account}/supervisedFineTuningJobs:estimateCost","href":"/api-reference/estimate-supervised-fine-tuning-job-cost"},{"title":"List supervised fine-tuning jobs","openapi":"openapi/prentis-training.openapi.yaml GET /accounts/{account}/supervisedFineTuningJobs","href":"/api-reference/list-supervised-fine-tuning-jobs"},{"title":"Get a supervised fine-tuning job","openapi":"openapi/prentis-training.openapi.yaml GET /accounts/{account}/supervisedFineTuningJobs/{job}","href":"/api-reference/get-supervised-fine-tuning-job"},{"title":"Get a job's training curve","openapi":"openapi/prentis-training.openapi.yaml GET /accounts/{account}/supervisedFineTuningJobs/{job}/metrics","href":"/api-reference/get-supervised-fine-tuning-job-metrics"},{"title":"Cancel a supervised fine-tuning job","openapi":"openapi/prentis-training.openapi.yaml POST /accounts/{account}/supervisedFineTuningJobs/{job}:cancel","href":"/api-reference/cancel-supervised-fine-tuning-job"},{"title":"Create a preference (DPO) job","openapi":"openapi/prentis-training.openapi.yaml POST /accounts/{account}/dpoJobs","href":"/api-reference/create-dpo-job"},{"title":"Estimate a preference (DPO) job","openapi":"openapi/prentis-training.openapi.yaml POST /accounts/{account}/dpoJobs:estimateCost","href":"/api-reference/estimate-dpo-job-cost"},{"title":"List preference (DPO) jobs","openapi":"openapi/prentis-training.openapi.yaml GET /accounts/{account}/dpoJobs","href":"/api-reference/list-dpo-jobs"},{"title":"Get a preference (DPO) job","openapi":"openapi/prentis-training.openapi.yaml GET /accounts/{account}/dpoJobs/{job}","href":"/api-reference/get-dpo-job"},{"title":"Get a preference job's training curve","openapi":"openapi/prentis-training.openapi.yaml GET /accounts/{account}/dpoJobs/{job}/metrics","href":"/api-reference/get-dpo-job-metrics"},{"title":"Cancel a preference (DPO) job","openapi":"openapi/prentis-training.openapi.yaml POST /accounts/{account}/dpoJobs/{job}:cancel","href":"/api-reference/cancel-dpo-job"}]},{"group":"Datasets","pages":[{"title":"Create a dataset","openapi":"openapi/prentis-training.openapi.yaml POST /accounts/{account}/datasets","href":"/api-reference/create-dataset"},{"title":"Get an upload URL","openapi":"openapi/prentis-training.openapi.yaml POST /accounts/{account}/datasets/{dataset}:getUploadEndpoint","href":"/api-reference/get-dataset-upload-endpoint"},{"title":"Validate an upload","openapi":"openapi/prentis-training.openapi.yaml POST /accounts/{account}/datasets/{dataset}:validateUpload","href":"/api-reference/validate-dataset-upload"},{"title":"Get a dataset","openapi":"openapi/prentis-training.openapi.yaml GET /accounts/{account}/datasets/{dataset}","href":"/api-reference/get-dataset"},{"title":"List datasets","openapi":"openapi/prentis-training.openapi.yaml GET /accounts/{account}/datasets","href":"/api-reference/list-datasets"},{"title":"List dataset versions","openapi":"openapi/prentis-training.openapi.yaml GET /accounts/{account}/datasets/{dataset}/versions","href":"/api-reference/list-dataset-versions"},{"title":"Delete a dataset","openapi":"openapi/prentis-training.openapi.yaml DELETE /accounts/{account}/datasets/{dataset}","href":"/api-reference/delete-dataset"}]}]}]},"basePath":"","title":"Messages - Prentis","buildId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","deploymentId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CybtLBIt.js","utils-BMLj2fvV.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-B6In562Y.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Dr8Mfhp9.js","snippetPresets-2rmQvMVl.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-WMqJYdZj.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CJ-MlPHu.js","shallow-dY3TMRCk.js","getApiPlaygroundDisplay-v-1B2bKm.js","CodeSnippet-BDhiTB7U.js","CodeSnippets-D9hnzQcS.js","Page-C4GwDT3_.js","getPastedJson-Th2V45jI.js","icon-BQXch1W9.js","MethodPill-BCqUneP3.js","DuplicateIcon-Q_-bhurZ.js","createIcon-DUjLHRqp.js","DynamicMarkdown-B-f2cqXQ.js","SectionHeading-Da5NsV4v.js","axios-vUo_bRtp.js","Markdown-D13FWkIM.js","clsx-D3Isdib3.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-C-XZBk9h.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink--qIqmmVG.js"]}