{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
Open Models
Messages
Send an Anthropic-compatible Messages request to a Relace-hosted model.
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."
}
}
Anthropic-compatible endpoint for open-weights models hosted on Relace infrastructure. You can also use this by pointing any Anthropic SDK at https://models.relace.ai with your Relace API key. The same models, pricing, and servers back Chat Completions; pick whichever dialect your client already speaks.
Models
Model
model ID
Context
Input
Output
Cached Input
DeepSeek V4 Flash 0423
deepseek-ai/DeepSeek-V4-Flash-0423
1M
$0.0277 / M
$1.28 / M
$0.0277 / M
DeepSeek V4 Flash 0731
deepseek-ai/DeepSeek-V4-Flash-0731
1M
$0.07 / M
$0.14 / M
$0.014 / M
DeepSeek V4 Pro 0423 (Preview)
deepseek-ai/DeepSeek-V4-Pro
1M
$0.45 / M
$3.00 / M
$0.09 / M
DeepSeek V4 Pro 0813
deepseek-ai/DeepSeek-V4-Pro-0813
1M
$0.50 / M
$2.00 / M
$0.05 / M
DeepSeek V4.1 Flash
deepseek-ai/DeepSeek-V4.1-Flash
1M
$0.20 / M
$0.60 / M
$0.008 / M
DeepSeek V4.1 Flash 1017
deepseek-ai/DeepSeek-V4.1-Flash-1017
1M
$0.20 / M
$0.60 / M
$0.008 / M
GLM 5.2
z-ai/glm-5.2
1M
$0.40 / M
$4.00 / M
$0.08 / M
GLM 5.3
z-ai/glm-5.3
1M
$0.75 / M
$2.40 / M
$0.075 / M
GLM 5.3 Flash
z-ai/glm-5.3-flash
1M
$0.075 / M
$0.50 / M
$0.0075 / M
Kimi K3
moonshotai/kimi-k3
1M
$2.00 / M
$14.00 / M
$0.30 / M
Prices are subject to change. The List Models endpoint (GET /v1/models) returns the current per-token price of every hosted model — read it from your own systems to track changes rather than relying on this table.
The key goes in either header, as your client prefers:
x-api-key: <key> — what the Anthropic SDKs send.
Authorization: Bearer <key> — the same header as every other Relace endpoint.
anthropic-version is accepted and ignored.
Prompt Caching
Prompt caching is automatic and needs no cache_control markers; any you send are accepted and ignored. Cache hits are billed at the Cached Input rate and reported in usage.cache_read_input_tokens, with usage.input_tokens counting only the uncached remainder. cache_creation_input_tokens is always 0: writing to the cache is free.To keep a multi-turn session on its cache, set metadata.user_id to a stable value per session; it plays the role prompt_cache_key does on Chat Completions. See Prompt Caching and Session Affinity.
Extended Thinking
thinking: {"type": "enabled"} or "adaptive" turns a model’s reasoning on and "disabled" turns it off; budget_tokens is accepted but the models do not enforce a budget. Reasoning comes back as thinking content blocks (and thinking_delta events when streaming) with an empty signature. Reasoning tokens count toward max_tokens.
Differences from Anthropic
The request and response shapes follow the Anthropic Messages API, with these exceptions:
Content: text, image (base64 or URL), tool_use, tool_result, and thinking blocks are supported. document blocks, Files API references, and search results return 400.
Tools: client tools with an input_schema are supported, including disable_parallel_tool_use. tool_choice of any or a named tool is honored by models that support forced tool choice and served as auto by the rest. Anthropic’s server tools (web search, code execution, computer use, etc.) are ignored.
Structured output: output_config.format is accepted and ignored by the models above; none constrain output to a schema. output_config.effort maps onto the model’s reasoning effort levels where it has them.
stop_sequence: reported when the model identifies the matched sequence; otherwise stop_reason is end_turn.
Not served: /v1/messages/count_tokens, the Batches API, and the Files API.
Authorizations
apiKeyAuthbearerAuth
x-api-key
string
header
required
Relace API key in the x-api-key header, as the Anthropic SDKs send it. Accepted on /v1/messages only.
Body
application/json
Anthropic-compatible Messages request
Anthropic-compatible request. cache_control markers and other Anthropic-only fields are accepted and ignored. Supported sampling parameters vary slightly by model.
model
string
required
ID of the hosted model to use, e.g. deepseek-ai/DeepSeek-V4.1-Flash, deepseek-ai/DeepSeek-V4-Flash-0731 or moonshotai/kimi-k3.
max_tokens
integer
required
Maximum number of tokens to generate. Reasoning tokens count toward this limit, so set a generous budget.
messages
object[]
required
The conversation so far, as Anthropic-format message objects with role (user or assistant) and content (a string, or an array of text, image, tool_use, tool_result, and thinking blocks).
system
any
System prompt, as a string or an array of text blocks.
stream
boolean
If true, the response is sent as server-sent events in the Anthropic streaming format. Token usage is reported in the message_delta event.
temperature
number
Sampling temperature. Higher values make output more random.
top_p
number
Nucleus sampling: only tokens within the top top_p probability mass are considered.
top_k
integer
Only the top_k most likely tokens are considered at each step.
stop_sequences
string[]
Up to 4 sequences at which generation stops.
tools
object[]
Anthropic-format tool definitions with name, description, and input_schema. Server tools are ignored.
tool_choice
object
Controls tool use: {"type": "auto"}, {"type": "any"}, {"type": "tool", "name": ...}, or {"type": "none"}. any and a named tool require a model with forced tool choice; others are served as auto. Set disable_parallel_tool_use to limit the model to one call per turn.
thinking
object
{"type": "enabled"} or {"type": "adaptive"} turns reasoning on; {"type": "disabled"} turns it off. budget_tokens is accepted but not enforced.
output_config
object
effort (low to max) maps onto the model's reasoning effort levels where it has them. format is accepted and ignored.
metadata
object
Show child attributes
Response
Message generated
id
string
Unique identifier for the message, prefixed msg_
type
string
Always message
role
string
Always assistant
model
string
The model that served the request
content
object[]
The generated content blocks, in order: thinking (when reasoning is on), text, and tool_use (with the call's id, name, and parsed input)
stop_reason
string
Why generation stopped: end_turn, max_tokens, stop_sequence, or tool_use
stop_sequence
string | null
The matched stop sequence when stop_reason is stop_sequence; otherwise null
usage
object
Token usage information for the request
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Relace","colors":{"primary":"#0066FF","light":"#4D94FF","dark":"#0047B3"},"logo":{"light":"https://mintcdn.com/relace/db9WpuNCcZDHVmZO/logo/light.svg?fit=max\u0026auto=format\u0026n=db9WpuNCcZDHVmZO\u0026q=85\u0026s=8fb6212c3f7e36d063d878a98d7cff90","dark":"https://mintcdn.com/relace/db9WpuNCcZDHVmZO/logo/dark.svg?fit=max\u0026auto=format\u0026n=db9WpuNCcZDHVmZO\u0026q=85\u0026s=978d07312f6ac13f58c22aaa151579ea","href":"https://relace.ai"},"favicon":"https://mintcdn.com/relace/s7F5Z9LGe0g03FCB/favicon.svg?fit=max\u0026auto=format\u0026n=s7F5Z9LGe0g03FCB\u0026q=85\u0026s=b1aef1a2a6e6df815b78fc4d767560ef","navbar":{"links":[{"href":"mailto:info@relace.ai","label":"Support"}],"primary":{"type":"button","label":"Playground","href":"https://app.relace.ai"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/relace-ai"}},"integrations":{"posthog":{"apiKey":"phc_guqCHgvq8r5z5YETZZ5q6394qFrzl7M7W516jUCklUq","sessionRecording":true}},"contextual":{"options":["copy"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"relace","hasAudioNarration":false,"actualSubdomain":"relace","customDomains":["docs.relace.ai"],"gitSource":{"type":"github","owner":"squack-io","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af36054be16eed08391ff47","clientVersion":"0.0.4377","searchFilterCounts":[{"language":"default","tag":"API Reference","count":8},{"language":"default","tag":"Documentation","count":8},{"language":"default","tag":"Model Guides","count":5},{"language":"default","tag":"Open Models","count":4},{"language":"default","tag":"Relace Models","count":3},{"language":"default","tag":"Instant Apply","count":3},{"language":"default","tag":"General","count":2},{"language":"default","tag":"Agents","count":2},{"language":"default","tag":"Fast Agentic Search","count":2},{"language":"default","tag":"Guides","count":2}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"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":"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":"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":"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":"turbopuffer-dual-write","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":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/open-models/messages","slug":"/api-reference/open-models/messages","pageMetadata":{"title":"Messages","openapi":"POST /v1/messages","description":"Send an Anthropic-compatible Messages request to a Relace-hosted model.","href":"/api-reference/open-models/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: \"Send an Anthropic-compatible Messages request to a Relace-hosted model.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Note,Table}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Anthropic-compatible endpoint for open-weights models hosted on Relace infrastructure. You can also use this by pointing any Anthropic SDK at `,_jsx(_components.code,{children:`https://models.relace.ai`}),` with your Relace API key. The same models, pricing, and servers back `,_jsx(_components.a,{href:`/api-reference/open-models/chat-completions`,children:`Chat Completions`}),`; pick whichever dialect your client already speaks.`]}),`\n`,_jsx(Heading,{level:`2`,id:`models`,children:`Models`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Model`}),_jsxs(_components.th,{children:[_jsx(_components.code,{children:`model`}),` ID`]}),_jsx(_components.th,{children:`Context`}),_jsx(_components.th,{children:`Input`}),_jsx(_components.th,{children:`Output`}),_jsx(_components.th,{children:`Cached Input`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`DeepSeek V4 Flash 0423`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`deepseek-ai/DeepSeek-V4-Flash-0423`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.0277 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$1.28 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.0277 / M`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`DeepSeek V4 Flash 0731`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`deepseek-ai/DeepSeek-V4-Flash-0731`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.07 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.14 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.014 / M`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`DeepSeek V4 Pro 0423 (Preview)`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`deepseek-ai/DeepSeek-V4-Pro`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.45 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$3.00 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.09 / M`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`DeepSeek V4 Pro 0813`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`deepseek-ai/DeepSeek-V4-Pro-0813`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.50 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$2.00 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.05 / M`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`DeepSeek V4.1 Flash`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`deepseek-ai/DeepSeek-V4.1-Flash`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.20 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.60 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.008 / M`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`DeepSeek V4.1 Flash 1017`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`deepseek-ai/DeepSeek-V4.1-Flash-1017`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.20 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.60 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.008 / M`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`GLM 5.2`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`z-ai/glm-5.2`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.40 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$4.00 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.08 / M`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`GLM 5.3`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`z-ai/glm-5.3`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.75 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$2.40 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.075 / M`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`GLM 5.3 Flash`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`z-ai/glm-5.3-flash`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.075 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.50 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.0075 / M`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Kimi K3`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`moonshotai/kimi-k3`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$2.00 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$14.00 / M`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$0.30 / M`})]})]})]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Prices are subject to change. The `,_jsx(_components.a,{href:`/api-reference/open-models/list-models`,children:`List Models`}),` endpoint (`,_jsx(_components.code,{children:`GET /v1/models`}),`) returns the current per-token price of every hosted model — read it from your own systems to track changes rather than relying on this table.`]})}),`\n`,_jsxs(_components.p,{children:[`See the `,_jsx(_components.a,{href:`/docs/open-models/quickstart#anthropic-compatible-api`,children:`Open Models guide`}),` for SDK examples and streaming.`]}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsx(_components.p,{children:`The key goes in either header, as your client prefers:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`x-api-key: \u003ckey>`}),` — what the Anthropic SDKs send.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Authorization: Bearer \u003ckey>`}),` — the same header as every other Relace endpoint.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`anthropic-version`}),` is accepted and ignored.`]}),`\n`,_jsx(Heading,{level:`2`,id:`prompt-caching`,children:`Prompt Caching`}),`\n`,_jsxs(_components.p,{children:[`Prompt caching is automatic and needs no `,_jsx(_components.code,{children:`cache_control`}),` markers; any you send are accepted and ignored. Cache hits are billed at the Cached Input rate and reported in `,_jsx(_components.code,{children:`usage.cache_read_input_tokens`}),`, with `,_jsx(_components.code,{children:`usage.input_tokens`}),` counting only the uncached remainder. `,_jsx(_components.code,{children:`cache_creation_input_tokens`}),` is always `,_jsx(_components.code,{children:`0`}),`: writing to the cache is free.`]}),`\n`,_jsxs(_components.p,{children:[`To keep a multi-turn session on its cache, set `,_jsx(_components.code,{children:`metadata.user_id`}),` to a stable value per session; it plays the role `,_jsx(_components.code,{children:`prompt_cache_key`}),` does on Chat Completions. See `,_jsx(_components.a,{href:`/docs/open-models/quickstart#prompt-caching-and-session-affinity`,children:`Prompt Caching and Session Affinity`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`extended-thinking`,children:`Extended Thinking`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`thinking: {\"type\": \"enabled\"}`}),` or `,_jsx(_components.code,{children:`\"adaptive\"`}),` turns a model’s reasoning on and `,_jsx(_components.code,{children:`\"disabled\"`}),` turns it off; `,_jsx(_components.code,{children:`budget_tokens`}),` is accepted but the models do not enforce a budget. Reasoning comes back as `,_jsx(_components.code,{children:`thinking`}),` content blocks (and `,_jsx(_components.code,{children:`thinking_delta`}),` events when streaming) with an empty `,_jsx(_components.code,{children:`signature`}),`. Reasoning tokens count toward `,_jsx(_components.code,{children:`max_tokens`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`differences-from-anthropic`,children:`Differences from Anthropic`}),`\n`,_jsxs(_components.p,{children:[`The request and response shapes follow the `,_jsx(_components.a,{href:`https://docs.anthropic.com/en/api/messages`,children:`Anthropic Messages API`}),`, with these exceptions:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Content`}),`: `,_jsx(_components.code,{children:`text`}),`, `,_jsx(_components.code,{children:`image`}),` (base64 or URL), `,_jsx(_components.code,{children:`tool_use`}),`, `,_jsx(_components.code,{children:`tool_result`}),`, and `,_jsx(_components.code,{children:`thinking`}),` blocks are supported. `,_jsx(_components.code,{children:`document`}),` blocks, Files API references, and search results return `,_jsx(_components.code,{children:`400`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Tools`}),`: client tools with an `,_jsx(_components.code,{children:`input_schema`}),` are supported, including `,_jsx(_components.code,{children:`disable_parallel_tool_use`}),`. `,_jsx(_components.code,{children:`tool_choice`}),` of `,_jsx(_components.code,{children:`any`}),` or a named tool is honored by models that support forced tool choice and served as `,_jsx(_components.code,{children:`auto`}),` by the rest. Anthropic’s server tools (web search, code execution, computer use, etc.) are ignored.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Structured output`}),`: `,_jsx(_components.code,{children:`output_config.format`}),` is accepted and ignored by the models above; none constrain output to a schema. `,_jsx(_components.code,{children:`output_config.effort`}),` maps onto the model’s reasoning effort levels where it has them.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`stop_sequence`})}),`: reported when the model identifies the matched sequence; otherwise `,_jsx(_components.code,{children:`stop_reason`}),` is `,_jsx(_components.code,{children:`end_turn`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Not served`}),`: `,_jsx(_components.code,{children:`/v1/messages/count_tokens`}),`, the Batches API, and the Files API.`]}),`\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":"POST /v1/messages","description":"Send an Anthropic-compatible Messages request to a Relace-hosted model.","href":"/api-reference/open-models/messages"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Models","slug":"models","depth":2,"children":[]},{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"Prompt Caching","slug":"prompt-caching","depth":2,"children":[]},{"title":"Extended Thinking","slug":"extended-thinking","depth":2,"children":[]},{"title":"Differences from Anthropic","slug":"differences-from-anthropic","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"description":"Send an Anthropic-compatible Messages request to a Relace-hosted model.","servers":["2e495e1b-c753-46bc-bcd8-e1d7aa4f7004"],"security":["7ececd43-fe68-4a3f-bbbe-e55d0626f0f9","d62c1e69-ecf6-4d0e-bd5a-b3894874623c"],"requestBody":"dfb4a0fd-0013-4521-a2e3-720d766957be","responses":{"200":"d8b8bf5d-798d-406e-a571-a96d40e47c11","400":"ed1b180c-69b3-45e8-b6dc-f70fce9443d7","401":"d5662f03-fb43-4d78-9f78-a7f9e37babbb","402":"bfda51bf-eb9e-4cba-b6f5-5b094c4a7922","404":"b373d2f4-e327-4484-b5ab-b8fde93631db","429":"098380c1-3fbd-4bcd-af8b-a495f00f2271","500":"b636a1f4-49bd-4bb0-959f-0e73687e9d52","502":"47b8f6bf-3b9c-4862-b244-9e33a657b5d8","503":"8fad5d7f-2c26-4b03-af57-cc0b0da333a4","504":"180d01fc-3421-4eaa-a3ce-4cddfbe2e8fd"},"method":"post","type":"path","path":"/v1/messages","baseUrlOptions":["https://models.relace.ai"],"title":"","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"description":"Anthropic-compatible Messages request","required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","max_tokens","messages"],"properties":{"model":{"type":"string","description":"ID of the hosted model to use, e.g. `deepseek-ai/DeepSeek-V4.1-Flash`, `deepseek-ai/DeepSeek-V4-Flash-0731` or `moonshotai/kimi-k3`.","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"max_tokens":{"type":"integer","description":"Maximum number of tokens to generate. Reasoning tokens count toward this limit, so set a generous budget.","isRequired":true,"uniqueKey":"max_tokens","typeLabel":"integer"},"messages":{"type":"array","items":{"type":"object","uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"description":"The conversation so far, as Anthropic-format message objects with `role` (`user` or `assistant`) and `content` (a string, or an array of `text`, `image`, `tool_use`, `tool_result`, and `thinking` blocks).","isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"system":{"description":"System prompt, as a string or an array of `text` blocks.","uniqueKey":"system","typeLabel":"any"},"stream":{"type":"boolean","description":"If true, the response is sent as server-sent events in the Anthropic streaming format. Token usage is reported in the `message_delta` event.","uniqueKey":"stream","typeLabel":"boolean"},"temperature":{"type":"number","description":"Sampling temperature. Higher values make output more random.","uniqueKey":"temperature","typeLabel":"number"},"top_p":{"type":"number","description":"Nucleus sampling: only tokens within the top `top_p` probability mass are considered.","uniqueKey":"top_p","typeLabel":"number"},"top_k":{"type":"integer","description":"Only the `top_k` most likely tokens are considered at each step.","uniqueKey":"top_k","typeLabel":"integer"},"stop_sequences":{"type":"array","items":{"type":"string","uniqueKey":"stop_sequences.items.[INDEX]","typeLabel":"string"},"description":"Up to 4 sequences at which generation stops.","uniqueKey":"stop_sequences","typeLabel":"string[]"},"tools":{"type":"array","items":{"type":"object","uniqueKey":"tools.items.[INDEX]","typeLabel":"object"},"description":"Anthropic-format tool definitions with `name`, `description`, and `input_schema`. Server tools are ignored.","uniqueKey":"tools","typeLabel":"object[]"},"tool_choice":{"type":"object","description":"Controls tool use: `{\"type\": \"auto\"}`, `{\"type\": \"any\"}`, `{\"type\": \"tool\", \"name\": ...}`, or `{\"type\": \"none\"}`. `any` and a named tool require a model with forced tool choice; others are served as `auto`. Set `disable_parallel_tool_use` to limit the model to one call per turn.","uniqueKey":"tool_choice","typeLabel":"object"},"thinking":{"type":"object","description":"`{\"type\": \"enabled\"}` or `{\"type\": \"adaptive\"}` turns reasoning on; `{\"type\": \"disabled\"}` turns it off. `budget_tokens` is accepted but not enforced.","uniqueKey":"thinking","typeLabel":"object"},"output_config":{"type":"object","description":"`effort` (`low` to `max`) maps onto the model's reasoning effort levels where it has them. `format` is accepted and ignored.","uniqueKey":"output_config","typeLabel":"object"},"metadata":{"type":"object","properties":{"user_id":{"type":"string","maxLength":512,"description":"Cache affinity key. Requests with the same value are served by the same server, improving cache hit rates for multi-turn sessions. Use a stable value per conversation or session.","uniqueKey":"metadata.user_id","typeLabel":"string"}},"uniqueKey":"metadata","typeLabel":"object"}},"additionalProperties":true,"description":"Anthropic-compatible request. `cache_control` markers and other Anthropic-only fields are accepted and ignored. Supported sampling parameters vary slightly by model.","uniqueKey":"","typeLabel":"object"},"example":{"model":"deepseek-ai/DeepSeek-V4-Flash-0731","max_tokens":1024,"messages":[{"role":"user","content":"Write a binary search in Python."}],"stream":false},"examples":{"Example":{"title":"Example","value":{"model":"deepseek-ai/DeepSeek-V4-Flash-0731","max_tokens":1024,"messages":[{"role":"user","content":"Write a binary search in Python."}],"stream":false}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"d8b8bf5d-798d-406e-a571-a96d40e47c11":{"description":"Message generated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the message, prefixed `msg_`","uniqueKey":"id","typeLabel":"string"},"type":{"type":"string","description":"Always `message`","uniqueKey":"type","typeLabel":"string"},"role":{"type":"string","description":"Always `assistant`","uniqueKey":"role","typeLabel":"string"},"model":{"type":"string","description":"The model that served the request","uniqueKey":"model","typeLabel":"string"},"content":{"type":"array","items":{"type":"object","uniqueKey":"content.items.[INDEX]","typeLabel":"object"},"description":"The generated content blocks, in order: `thinking` (when reasoning is on), `text`, and `tool_use` (with the call's `id`, `name`, and parsed `input`)","uniqueKey":"content","typeLabel":"object[]"},"stop_reason":{"type":"string","description":"Why generation stopped: `end_turn`, `max_tokens`, `stop_sequence`, or `tool_use`","uniqueKey":"stop_reason","typeLabel":"string"},"stop_sequence":{"oneOf":[{"type":"string","description":"The matched stop sequence when `stop_reason` is `stop_sequence`; otherwise null","uniqueKey":"stop_sequence.oneOf.0","typeLabel":"string"},{"type":"null","description":"The matched stop sequence when `stop_reason` is `stop_sequence`; otherwise null","uniqueKey":"stop_sequence.oneOf.1","typeLabel":"null"}],"uniqueKey":"stop_sequence","typeLabel":"string | null"},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer","description":"Prompt tokens not served from cache","uniqueKey":"usage.input_tokens","typeLabel":"integer"},"cache_read_input_tokens":{"type":"integer","description":"Prompt tokens served from cache, billed at the Cached Input rate","uniqueKey":"usage.cache_read_input_tokens","typeLabel":"integer"},"cache_creation_input_tokens":{"type":"integer","description":"Always 0; writing to the cache is free","uniqueKey":"usage.cache_creation_input_tokens","typeLabel":"integer"},"output_tokens":{"type":"integer","description":"Tokens generated, including reasoning","uniqueKey":"usage.output_tokens","typeLabel":"integer"}},"description":"Token usage information for the request","uniqueKey":"usage","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","type":"\u003cstring>","role":"\u003cstring>","model":"\u003cstring>","content":[{}],"stop_reason":"\u003cstring>","stop_sequence":"\u003cstring>","usage":{"input_tokens":123,"cache_read_input_tokens":123,"cache_creation_input_tokens":123,"output_tokens":123}}}},"exampleType":"generated"},"text/event-stream":{"schema":{"type":"string","description":"Stream of Anthropic Messages events: `message_start`, then `content_block_start` / `content_block_delta` / `content_block_stop` per content block, then `message_delta` with the stop reason and token usage, then `message_stop`.","uniqueKey":"","typeLabel":"string"},"examples":{"Example":{"title":"Example","value":"\u003cstring>"}},"exampleType":"generated"}},"exampleType":"generated"},"ed1b180c-69b3-45e8-b6dc-f70fce9443d7":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Always `error`","example":"error","uniqueKey":"type","typeLabel":"string"},"error":{"type":"object","properties":{"type":{"type":"string","description":"Anthropic error type","enum":["invalid_request_error","authentication_error","billing_error","permission_error","not_found_error","request_too_large","rate_limit_error","api_error","overloaded_error","timeout_error"],"example":"rate_limit_error","uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Error message","example":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits.","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"error","error":{"type":"rate_limit_error","message":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."}}}},"exampleType":"generated"}},"exampleType":"generated"},"d5662f03-fb43-4d78-9f78-a7f9e37babbb":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Always `error`","example":"error","uniqueKey":"type","typeLabel":"string"},"error":{"type":"object","properties":{"type":{"type":"string","description":"Anthropic error type","enum":["invalid_request_error","authentication_error","billing_error","permission_error","not_found_error","request_too_large","rate_limit_error","api_error","overloaded_error","timeout_error"],"example":"rate_limit_error","uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Error message","example":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits.","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"error","error":{"type":"rate_limit_error","message":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."}}}},"exampleType":"generated"}},"exampleType":"generated"},"bfda51bf-eb9e-4cba-b6f5-5b094c4a7922":{"description":"Out of credits, or no payment method on the account","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Always `error`","example":"error","uniqueKey":"type","typeLabel":"string"},"error":{"type":"object","properties":{"type":{"type":"string","description":"Anthropic error type","enum":["invalid_request_error","authentication_error","billing_error","permission_error","not_found_error","request_too_large","rate_limit_error","api_error","overloaded_error","timeout_error"],"example":"rate_limit_error","uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Error message","example":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits.","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"error","error":{"type":"rate_limit_error","message":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."}}}},"exampleType":"generated"}},"exampleType":"generated"},"b373d2f4-e327-4484-b5ab-b8fde93631db":{"description":"Route not found","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Always `error`","example":"error","uniqueKey":"type","typeLabel":"string"},"error":{"type":"object","properties":{"type":{"type":"string","description":"Anthropic error type","enum":["invalid_request_error","authentication_error","billing_error","permission_error","not_found_error","request_too_large","rate_limit_error","api_error","overloaded_error","timeout_error"],"example":"rate_limit_error","uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Error message","example":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits.","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"error","error":{"type":"rate_limit_error","message":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."}}}},"exampleType":"generated"}},"exampleType":"generated"},"098380c1-3fbd-4bcd-af8b-a495f00f2271":{"description":"Rate limit exceeded, or the model is at capacity","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Always `error`","example":"error","uniqueKey":"type","typeLabel":"string"},"error":{"type":"object","properties":{"type":{"type":"string","description":"Anthropic error type","enum":["invalid_request_error","authentication_error","billing_error","permission_error","not_found_error","request_too_large","rate_limit_error","api_error","overloaded_error","timeout_error"],"example":"rate_limit_error","uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Error message","example":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits.","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"error","error":{"type":"rate_limit_error","message":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."}}}},"exampleType":"generated"}},"exampleType":"generated"},"b636a1f4-49bd-4bb0-959f-0e73687e9d52":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Always `error`","example":"error","uniqueKey":"type","typeLabel":"string"},"error":{"type":"object","properties":{"type":{"type":"string","description":"Anthropic error type","enum":["invalid_request_error","authentication_error","billing_error","permission_error","not_found_error","request_too_large","rate_limit_error","api_error","overloaded_error","timeout_error"],"example":"rate_limit_error","uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Error message","example":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits.","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"error","error":{"type":"rate_limit_error","message":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."}}}},"exampleType":"generated"}},"exampleType":"generated"},"47b8f6bf-3b9c-4862-b244-9e33a657b5d8":{"description":"Model server error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Always `error`","example":"error","uniqueKey":"type","typeLabel":"string"},"error":{"type":"object","properties":{"type":{"type":"string","description":"Anthropic error type","enum":["invalid_request_error","authentication_error","billing_error","permission_error","not_found_error","request_too_large","rate_limit_error","api_error","overloaded_error","timeout_error"],"example":"rate_limit_error","uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Error message","example":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits.","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"error","error":{"type":"rate_limit_error","message":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."}}}},"exampleType":"generated"}},"exampleType":"generated"},"8fad5d7f-2c26-4b03-af57-cc0b0da333a4":{"description":"Model temporarily unavailable","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Always `error`","example":"error","uniqueKey":"type","typeLabel":"string"},"error":{"type":"object","properties":{"type":{"type":"string","description":"Anthropic error type","enum":["invalid_request_error","authentication_error","billing_error","permission_error","not_found_error","request_too_large","rate_limit_error","api_error","overloaded_error","timeout_error"],"example":"rate_limit_error","uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Error message","example":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits.","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"error","error":{"type":"rate_limit_error","message":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."}}}},"exampleType":"generated"}},"exampleType":"generated"},"180d01fc-3421-4eaa-a3ce-4cddfbe2e8fd":{"description":"Request to the model timed out","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Always `error`","example":"error","uniqueKey":"type","typeLabel":"string"},"error":{"type":"object","properties":{"type":{"type":"string","description":"Anthropic error type","enum":["invalid_request_error","authentication_error","billing_error","permission_error","not_found_error","request_too_large","rate_limit_error","api_error","overloaded_error","timeout_error"],"example":"rate_limit_error","uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Error message","example":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits.","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"error","error":{"type":"rate_limit_error","message":"Rate limit exceeded. Retry after the Retry-After interval, or contact support to raise your limits."}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"7ececd43-fe68-4a3f-bbbe-e55d0626f0f9":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Relace API key in the `x-api-key` header, as the Anthropic SDKs send it. Accepted on `/v1/messages` only.","scopes":[],"schemeName":"apiKeyAuth"}},"d62c1e69-ecf6-4d0e-bd5a-b3894874623c":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Relace API key Authorization header using the Bearer scheme.","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"2e495e1b-c753-46bc-bcd8-e1d7aa4f7004":{"url":"https://models.relace.ai"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","description":"Relace API key in the `x-api-key` header, as the Anthropic SDKs send it. Accepted on `/v1/messages` only.","scopes":[],"schemeName":"apiKeyAuth"},"schema":{"title":"x-api-key","type":"string","description":"Relace API key in the `x-api-key` header, as the Anthropic SDKs send it. Accepted on `/v1/messages` only.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"apiKeyAuth","name":"x-api-key"}],"title":"apiKeyAuth"},{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"Relace API key Authorization header using the Bearer scheme.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Relace API key Authorization header using the Bearer scheme.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"relace","siteName":"Relace","title":"Messages - Relace","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-23T05:22:07.794Z","originalFileLocation":"api-reference/open-models/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=\"Send an Anthropic-compatible Messages request to a Relace-hosted model.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Relace\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/relace/NSKygUkcOPJ0dXD5/_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/relace/NSKygUkcOPJ0dXD5/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/relace/NSKygUkcOPJ0dXD5/_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/relace/NSKygUkcOPJ0dXD5/_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/relace/NSKygUkcOPJ0dXD5/_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/relace/NSKygUkcOPJ0dXD5/_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/relace/NSKygUkcOPJ0dXD5/_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/relace/NSKygUkcOPJ0dXD5/_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/relace/NSKygUkcOPJ0dXD5/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Messages - Relace\">\u003cmeta data-mint-head property=\"og:description\" content=\"Send an Anthropic-compatible Messages request to a Relace-hosted model.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Relace\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.relace.ai/api-reference/open-models/messages\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://relace.mintlify.site/_mintlify/api/og/v2?division=Open+Models\u0026amp;title=Messages\u0026amp;description=Send+an+Anthropic-compatible+Messages+request+to+a+Relace-hosted+model.\u0026amp;theme=57c4eb56dcaa832310d126ad\u0026amp;signature=cc408be6c42d548f8cd31cd04b4be2a050a31475441d61eea1dc587b322243b6\">\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 - Relace\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Send an Anthropic-compatible Messages request to a Relace-hosted model.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://relace.mintlify.site/_mintlify/api/og/v2?division=Open+Models\u0026amp;title=Messages\u0026amp;description=Send+an+Anthropic-compatible+Messages+request+to+a+Relace-hosted+model.\u0026amp;theme=57c4eb56dcaa832310d126ad\u0026amp;signature=cc408be6c42d548f8cd31cd04b4be2a050a31475441d61eea1dc587b322243b6\">\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/relace/NSKygUkcOPJ0dXD5/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Relace\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0066FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.relace.ai/api-reference/open-models/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/open-models/messages.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.relace.ai/#organization\",\"name\":\"Relace\",\"url\":\"https://docs.relace.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/relace/db9WpuNCcZDHVmZO/logo/light.svg?fit=max\u0026auto=format\u0026n=db9WpuNCcZDHVmZO\u0026q=85\u0026s=8fb6212c3f7e36d063d878a98d7cff90\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.relace.ai#website\",\"name\":\"Relace\",\"url\":\"https://docs.relace.ai\",\"publisher\":{\"@id\":\"https://docs.relace.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.relace.ai/api-reference/open-models/messages#webpage\",\"url\":\"https://docs.relace.ai/api-reference/open-models/messages\",\"name\":\"Messages\",\"description\":\"Send an Anthropic-compatible Messages request to a Relace-hosted model.\",\"dateModified\":\"2026-10-23T05:22:07.794Z\",\"isPartOf\":{\"@id\":\"https://docs.relace.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.relace.ai/api-reference/open-models/messages#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.relace.ai/api-reference/open-models/messages#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Open Models\",\"item\":\"https://docs.relace.ai/api-reference/open-models/chat-completions\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Messages\",\"item\":\"https://docs.relace.ai/api-reference/open-models/messages\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.relace.ai/api-reference/open-models/messages#apireference\",\"headline\":\"Messages\",\"name\":\"Messages\",\"description\":\"Send an Anthropic-compatible Messages request to a Relace-hosted model.\",\"url\":\"https://docs.relace.ai/api-reference/open-models/messages\",\"mainEntityOfPage\":{\"@id\":\"https://docs.relace.ai/api-reference/open-models/messages#webpage\"},\"dateModified\":\"2026-10-23T05:22:07.794Z\",\"publisher\":{\"@id\":\"https://docs.relace.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.relace.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Relace\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Relace\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/open-models/messages.md","siteName":"Relace","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/docs/introduction"}]},{"anchor":"API Reference","icon":"square-terminal","groups":[{"group":"General","pages":[{"title":"Introduction","href":"/api-reference/introduction"},{"title":"Errors","href":"/api-reference/errors"}]},{"group":"Relace Models","pages":[{"title":"Compact Trace","openapi":"POST /v1/code/compact","href":"/api-reference/compact/compact"},{"title":"Apply Code","openapi":"POST /v1/code/apply","href":"/api-reference/instant-apply/apply"},{"title":"Search Code","openapi":"POST /v1/search/chat/completions","href":"/api-reference/fast-agentic-search/search"}]},{"group":"Open Models","pages":[{"title":"Chat Completions","openapi":"POST /v1/chat/completions","description":"Send an OpenAI-compatible chat completions request to a Relace-hosted model.","href":"/api-reference/open-models/chat-completions"},{"title":"Messages","openapi":"POST /v1/messages","href":"/api-reference/open-models/messages"},{"title":"List Models","openapi":"GET /v1/models","description":"The catalog of models your account can call, with each model's current per-token prices, context limit and supported parameters. Prices change over time; poll this endpoint to track them. Entries are OpenAI model objects (`object: \"model\"`, `owned_by: \"relace\"`), so `client.models.list()` in any OpenAI SDK pointed at `https://models.relace.ai/v1` works.","href":"/api-reference/open-models/list-models"}]}]}]},"basePath":"","title":"Messages - Relace","deploymentId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","buildId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-C6Z1vAfX.js","snippetPresets-Bjd6OXRM.js","utils-QL6OhUyF.js","style-to-object-BY3JEAdk.js","utils-Dsq-HLeF.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-CEYfmkoV.js","conditional-requirements-CFM0id0Q.js","cloneDeep-CHgPjMM8.js","_Uint8Array-IXRJ_ueo.js","isObject-FP1Yky1u.js","ApiExamples-pq4ns9YA.js","usePlaygroundInputsStore-D-gnigmo.js","shallow-DIfWGPrf.js","isEqual-DDFuixlH.js","CodeSnippets-8g5rilZj.js","CodeSnippet-C_J7pouP.js","use-playground-group-access-bkOyfPao.js","Page-B_smDgrp.js","api-description-markdown-DtcP2u3s.js","DynamicMarkdown-DOefW1_8.js","SectionHeading-Cg4lfWZw.js","MethodPill-BnqygvYm.js","getPastedJson-BGXYEZ3P.js","Check2Icon-BBeO3TOS.js","axios-CsQoIw0U.js","Markdown-D5IqLG6A.js","AssistantPageLink-_S2h4i6W.js","dist-DzZqOeCq.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}