Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
model
string
required
ID of the model to use
Example:
"meta-llama/Llama-3.3-70B-Instruct"
prompt
stringstring[]integer<int32>[]integer<int32>[][]
required
The prompt to generate completions for
best_of
integer<int32> | null
default:1
Example:
1
echo
boolean | null
default:false
Example:
false
frequency_penalty
number<float> | null
Number between -2.0 and 2.0. Positive values penalize new tokens based on their
existing frequency in the text so far
Example:
0
logit_bias
object | null
Modify the likelihood of specified tokens appearing in the completion.
Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer)
to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits
generated by the model prior to sampling. The exact effect will vary per model, but values
between -1 and 1 should decrease or increase likelihood of selection; values like -100 or
100 should result in a ban or exclusive selection of the relevant token.
Show child attributes
Example:
{ "1234567890": 0.5, "1234567891": -0.5 }
logprobs
integer<int32> | null
An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability.
Example:
1
max_tokens
integer<int32> | null
default:16
The maximum number of tokens to generate in the chat completion
Example:
4096
n
integer<int32> | null
How many chat completion choices to generate for each input message
Example:
1
presence_penalty
number<float> | null
Number between -2.0 and 2.0. Positive values penalize new tokens based on
whether they appear in the text so far
Example:
0
seed
integer<int64> | null
If specified, our system will make a best effort to sample deterministically
Example:
123
stop
string[] | null
Up to 4 sequences where the API will stop generating further tokens
Example:
"json([\"stop\", \"halt\"])"
stream
boolean | null
Whether to stream back partial progress
Example:
false
stream_options
null | object
Options for streaming response. Only set this when you set stream: true.
Show child attributes
suffix
string | null
The suffix that comes after a completion of inserted text.
Example:
"json(\"\\n\")"
temperature
number<float> | null
What sampling temperature to use, between 0 and 2
Example:
0.7
top_p
number<float> | null
An alternative to sampling with temperature
Example:
1
user
string | null
A unique identifier representing your end-user
Example:
"user-1234"
Response
Chat completions
choices
object[]
required
Array of completion choices response
Show child attributes
Example:
[ { "text": "This is a test", "index": 0, "logprobs": null, "finish_reason": "stop" } ]
created
integer<int64>
required
The creation time of the request
Example:
"2021-01-01T00:00:00.000Z"
id
string
required
The ID of the request
Example:
"cmpl-1234567890"
model
string
required
The model used for the request
Example:
"meta-llama/Llama-3.3-70B-Instruct"
object
string
required
The object type
Example:
"text_completion"
system_fingerprint
string
required
The system fingerprint
Example:
"system-fingerprint"
usage
object
required
The usage information for the request
Show child attributes
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Atoma","colors":{"primary":"#87CEFA","light":"#87CEFA","dark":"#87CEFA"},"favicon":"/logo/Favicon_Atoma.svg","logo":{"light":"https://mintcdn.com/atoma/tjjv1G2ZJctJbnbW/logo/Favicon_Atoma.svg?fit=max\u0026auto=format\u0026n=tjjv1G2ZJctJbnbW\u0026q=85\u0026s=fb271bbe709375a10927262bb6bc73a1","dark":"https://mintcdn.com/atoma/tjjv1G2ZJctJbnbW/logo/Favicon_Atoma.svg?fit=max\u0026auto=format\u0026n=tjjv1G2ZJctJbnbW\u0026q=85\u0026s=fb271bbe709375a10927262bb6bc73a1"},"navbar":{"links":[{"label":"Support","href":"mailto:support@atoma.ai"}],"primary":null},"footer":{"socials":{"x":"https://x.com/Atoma_AI","github":"https://github.com/atoma-ai","linkedin":"https://www.linkedin.com/company/atoma-ai-2025"}},"navigation":{"global":{"anchors":[{"anchor":"Website","href":"https://www.atoma.ai","icon":"globe"},{"anchor":"Community","href":"https://discord.gg/atoma","icon":"discord"},{"anchor":"Blog","href":"https://atomanetwork.medium.com","icon":"newspaper"},{"anchor":"Github","href":"https://github.com/atoma-ai","icon":"github"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"atoma","hasAudioNarration":false,"actualSubdomain":"atoma","customDomains":["docs.atoma.ai"],"gitSource":{"type":"github","owner":"atomaai","repo":"atoma-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae9237ce0bf2909fa98acd1:success","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"Cloud API Reference","count":14},{"language":"default","tag":"Documentation","count":4},{"language":"default","tag":"Get Started","count":4},{"language":"default","tag":"Changelog","count":2},{"language":"default","tag":"Models","count":2},{"language":"default","tag":"Nodes","count":2},{"language":"default","tag":"API Reference","count":1},{"language":"default","tag":"Chat","count":1},{"language":"default","tag":"Completions","count":1},{"language":"default","tag":"Confidential Chat","count":1}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"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},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"cloud-api-reference/completions/create-completions","slug":"/cloud-api-reference/completions/create-completions","pageMetadata":{"title":"Create completions","description":"This function processes completion requests by using the chat completions endpoint.\n\n## Returns\n\nReturns a Response containing either:\n- A streaming SSE connection for real-time completions\n- A single JSON response for non-streaming completions\n\n## Errors\n\nReturns an error status code if:\n- The request processing fails\n- The streaming/non-streaming handlers encounter errors\n- The underlying inference service returns an error","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/completions","href":"/cloud-api-reference/completions/create-completions","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n h2: \"h2\",\n li: \"li\",\n p: \"p\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"This function processes completion requests by using the chat completions endpoint.\"\n }), \"\\n\", _jsx(_components.h2, {\n children: \"Returns\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"Returns a Response containing either:\"\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsx(_components.li, {\n children: \"A streaming SSE connection for real-time completions\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"A single JSON response for non-streaming completions\"\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.h2, {\n children: \"Errors\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"Returns an error status code if:\"\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsx(_components.li, {\n children: \"The request processing fails\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"The streaming/non-streaming handlers encounter errors\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"The underlying inference service returns an error\"\n }), \"\\n\"]\n })]\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}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create completions","description":"This function processes completion requests by using the chat completions endpoint.\n\n## Returns\n\nReturns a Response containing either:\n- A streaming SSE connection for real-time completions\n- A single JSON response for non-streaming completions\n\n## Errors\n\nReturns an error status code if:\n- The request processing fails\n- The streaming/non-streaming handlers encounter errors\n- The underlying inference service returns an error","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/completions","href":"/cloud-api-reference/completions/create-completions","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Completions"],"summary":"Create completions","description":"This function processes completion requests by using the chat completions endpoint.\n\n## Returns\n\nReturns a Response containing either:\n- A streaming SSE connection for real-time completions\n- A single JSON response for non-streaming completions\n\n## Errors\n\nReturns an error status code if:\n- The request processing fails\n- The streaming/non-streaming handlers encounter errors\n- The underlying inference service returns an error","operationId":"completions_create","requestBody":"abbb5ec9-1acd-43f8-83c5-4b90a9cb78a3","responses":{"200":"9b2a6bfa-99dd-4f66-a822-daf9d350365a","400":"d9dbc795-a54d-4011-881f-cb270943fe06","401":"92ba941a-d718-4c57-b92a-80a73aaf5455","500":"bd40c1de-363e-4dcf-a896-cb8929a90ab7"},"security":["dba9d883-1e31-4717-92a7-6b343906e4ae"],"x-codeSamples":[{"lang":"typescript","label":"default","source":"import { AtomaSDK } from \"atoma-sdk\";\n\nconst atomaSDK = new AtomaSDK({\n bearerAuth: process.env[\"ATOMASDK_BEARER_AUTH\"] ?? \"\",\n});\n\nasync function run() {\n const completion = await atomaSDK.completions.completionsCreate({\n model: \"meta-llama/Llama-3.3-70B-Instruct\",\n prompt: \"Hello, world!\",\n });\n\n console.log(completion.choices[0]);\n}\n\nrun();"},{"lang":"typescript","label":"streaming","source":"import { AtomaSDK } from \"atoma-sdk\";\n\nconst atomaSDK = new AtomaSDK({\n bearerAuth: process.env[\"ATOMASDK_BEARER_AUTH\"] ?? \"\",\n});\n\nasync function run() {\n const completion = await atomaSDK.completions.completionsCreateStream({\n model: \"meta-llama/Llama-3.3-70B-Instruct\",\n prompt: \"Hello, world!\",\n });\n\n for await (const chunk of completion) {\n console.log(chunk.choices[0].text);\n }\n}\n\nrun();"},{"lang":"python","label":"default","source":"from atoma_sdk import AtomaSDK\nimport os\n\nwith AtomaSDK(\n bearer_auth=os.getenv(\"ATOMASDK_BEARER_AUTH\", \"\"),\n) as atoma_sdk:\n\n completion = atoma_sdk.completions.create(\n model=\"meta-llama/Llama-3.3-70B-Instruct\",\n prompt=\"Hello, how are you?\"\n )\n\n print(completion.choices[0].text)"},{"lang":"python","label":"streaming","source":"from atoma_sdk import AtomaSDK\nimport os\n\nwith AtomaSDK(\n bearer_auth=os.getenv(\"ATOMASDK_BEARER_AUTH\", \"\"),\n) as atoma_sdk:\n\n completion = atoma_sdk.completions.create_stream(\n model=\"meta-llama/Llama-3.3-70B-Instruct\",\n prompt=\"Hello, how are you?\"\n )\n\n for chunk in completion:\n print(chunk.data.choices[0].text)"}],"method":"post","type":"path","servers":["dfb8e2f7-db43-4d17-8dd7-eba4e1b68421"],"path":"/v1/completions","baseUrlOptions":["https://api.atoma.network"],"title":"Create completions","codeSamples":[{"label":"default","lang":"typescript","source":"import { AtomaSDK } from \"atoma-sdk\";\n\nconst atomaSDK = new AtomaSDK({\n bearerAuth: process.env[\"ATOMASDK_BEARER_AUTH\"] ?? \"\",\n});\n\nasync function run() {\n const completion = await atomaSDK.completions.completionsCreate({\n model: \"meta-llama/Llama-3.3-70B-Instruct\",\n prompt: \"Hello, world!\",\n });\n\n console.log(completion.choices[0]);\n}\n\nrun();"},{"label":"streaming","lang":"typescript","source":"import { AtomaSDK } from \"atoma-sdk\";\n\nconst atomaSDK = new AtomaSDK({\n bearerAuth: process.env[\"ATOMASDK_BEARER_AUTH\"] ?? \"\",\n});\n\nasync function run() {\n const completion = await atomaSDK.completions.completionsCreateStream({\n model: \"meta-llama/Llama-3.3-70B-Instruct\",\n prompt: \"Hello, world!\",\n });\n\n for await (const chunk of completion) {\n console.log(chunk.choices[0].text);\n }\n}\n\nrun();"},{"label":"default","lang":"python","source":"from atoma_sdk import AtomaSDK\nimport os\n\nwith AtomaSDK(\n bearer_auth=os.getenv(\"ATOMASDK_BEARER_AUTH\", \"\"),\n) as atoma_sdk:\n\n completion = atoma_sdk.completions.create(\n model=\"meta-llama/Llama-3.3-70B-Instruct\",\n prompt=\"Hello, how are you?\"\n )\n\n print(completion.choices[0].text)"},{"label":"streaming","lang":"python","source":"from atoma_sdk import AtomaSDK\nimport os\n\nwith AtomaSDK(\n bearer_auth=os.getenv(\"ATOMASDK_BEARER_AUTH\", \"\"),\n) as atoma_sdk:\n\n completion = atoma_sdk.completions.create_stream(\n model=\"meta-llama/Llama-3.3-70B-Instruct\",\n prompt=\"Hello, how are you?\"\n )\n\n for chunk in completion:\n print(chunk.data.choices[0].text)"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","description":"ID of the model to use","example":"meta-llama/Llama-3.3-70B-Instruct","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"prompt":{"oneOf":[{"type":"string","description":"The prompt to generate completions for","isRequired":true,"uniqueKey":"prompt.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"prompt.oneOf.1.items.[INDEX]","typeLabel":"string"},"description":"The prompt to generate completions for","isRequired":true,"uniqueKey":"prompt.oneOf.1","typeLabel":"string[]"},{"type":"array","items":{"type":"integer","format":"int32","minimum":0,"uniqueKey":"prompt.oneOf.2.items.[INDEX]","typeLabel":"integer\u003cint32>"},"description":"The prompt to generate completions for","isRequired":true,"uniqueKey":"prompt.oneOf.2","typeLabel":"integer\u003cint32>[]"},{"type":"array","items":{"type":"array","items":{"type":"integer","format":"int32","minimum":0,"uniqueKey":"prompt.oneOf.3.items.[INDEX].items.[INDEX]","typeLabel":"integer\u003cint32>"},"uniqueKey":"prompt.oneOf.3.items.[INDEX]","typeLabel":"integer\u003cint32>[]"},"description":"The prompt to generate completions for","isRequired":true,"uniqueKey":"prompt.oneOf.3","typeLabel":"integer\u003cint32>[][]"}],"isRequired":true,"uniqueKey":"prompt","typeLabel":"string | string[] | integer\u003cint32>[] | integer\u003cint32>[][]"},"best_of":{"oneOf":[{"type":"integer","format":"int32","default":1,"example":1,"uniqueKey":"best_of.oneOf.0","typeLabel":"integer\u003cint32>"},{"type":"null","format":"int32","default":1,"example":1,"uniqueKey":"best_of.oneOf.1","typeLabel":"null"}],"uniqueKey":"best_of","typeLabel":"integer\u003cint32> | null"},"echo":{"oneOf":[{"type":"boolean","default":false,"example":false,"uniqueKey":"echo.oneOf.0","typeLabel":"boolean"},{"type":"null","default":false,"example":false,"uniqueKey":"echo.oneOf.1","typeLabel":"null"}],"uniqueKey":"echo","typeLabel":"boolean | null"},"frequency_penalty":{"oneOf":[{"type":"number","format":"float","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their\nexisting frequency in the text so far","example":0,"uniqueKey":"frequency_penalty.oneOf.0","typeLabel":"number\u003cfloat>"},{"type":"null","format":"float","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their\nexisting frequency in the text so far","example":0,"uniqueKey":"frequency_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"frequency_penalty","typeLabel":"number\u003cfloat> | null"},"logit_bias":{"oneOf":[{"type":"object","description":"Modify the likelihood of specified tokens appearing in the completion.\n\nAccepts a JSON object that maps tokens (specified by their token ID in the tokenizer)\nto an associated bias value from -100 to 100. Mathematically, the bias is added to the logits\ngenerated by the model prior to sampling. The exact effect will vary per model, but values\nbetween -1 and 1 should decrease or increase likelihood of selection; values like -100 or\n100 should result in a ban or exclusive selection of the relevant token.","additionalProperties":{"type":"number","format":"float","uniqueKey":"logit_bias.oneOf.0.additionalProperties","typeLabel":"number\u003cfloat>"},"propertyNames":{"type":"string"},"example":{"1234567890":0.5,"1234567891":-0.5},"uniqueKey":"logit_bias.oneOf.0","typeLabel":"object"},{"type":"null","description":"Modify the likelihood of specified tokens appearing in the completion.\n\nAccepts a JSON object that maps tokens (specified by their token ID in the tokenizer)\nto an associated bias value from -100 to 100. Mathematically, the bias is added to the logits\ngenerated by the model prior to sampling. The exact effect will vary per model, but values\nbetween -1 and 1 should decrease or increase likelihood of selection; values like -100 or\n100 should result in a ban or exclusive selection of the relevant token.","additionalProperties":{"type":"number","format":"float","uniqueKey":"logit_bias.oneOf.1.additionalProperties","typeLabel":"number\u003cfloat>"},"propertyNames":{"type":"string"},"example":{"1234567890":0.5,"1234567891":-0.5},"uniqueKey":"logit_bias.oneOf.1","typeLabel":"null"}],"uniqueKey":"logit_bias","typeLabel":"object | null"},"logprobs":{"oneOf":[{"type":"integer","format":"int32","description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability.","example":1,"uniqueKey":"logprobs.oneOf.0","typeLabel":"integer\u003cint32>"},{"type":"null","format":"int32","description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability.","example":1,"uniqueKey":"logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"logprobs","typeLabel":"integer\u003cint32> | null"},"max_tokens":{"oneOf":[{"type":"integer","format":"int32","description":"The maximum number of tokens to generate in the chat completion","default":16,"example":4096,"uniqueKey":"max_tokens.oneOf.0","typeLabel":"integer\u003cint32>"},{"type":"null","format":"int32","description":"The maximum number of tokens to generate in the chat completion","default":16,"example":4096,"uniqueKey":"max_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"max_tokens","typeLabel":"integer\u003cint32> | null"},"n":{"oneOf":[{"type":"integer","format":"int32","description":"How many chat completion choices to generate for each input message","example":1,"uniqueKey":"n.oneOf.0","typeLabel":"integer\u003cint32>"},{"type":"null","format":"int32","description":"How many chat completion choices to generate for each input message","example":1,"uniqueKey":"n.oneOf.1","typeLabel":"null"}],"uniqueKey":"n","typeLabel":"integer\u003cint32> | null"},"presence_penalty":{"oneOf":[{"type":"number","format":"float","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on\nwhether they appear in the text so far","example":0,"uniqueKey":"presence_penalty.oneOf.0","typeLabel":"number\u003cfloat>"},{"type":"null","format":"float","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on\nwhether they appear in the text so far","example":0,"uniqueKey":"presence_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"presence_penalty","typeLabel":"number\u003cfloat> | null"},"seed":{"oneOf":[{"type":"integer","format":"int64","description":"If specified, our system will make a best effort to sample deterministically","example":123,"uniqueKey":"seed.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"If specified, our system will make a best effort to sample deterministically","example":123,"uniqueKey":"seed.oneOf.1","typeLabel":"null"}],"uniqueKey":"seed","typeLabel":"integer\u003cint64> | null"},"stop":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"stop.oneOf.0.items.[INDEX]","typeLabel":"string"},"description":"Up to 4 sequences where the API will stop generating further tokens","example":"json([\"stop\", \"halt\"])","default":"[]","uniqueKey":"stop.oneOf.0","typeLabel":"string[]"},{"type":"null","items":{"type":"string"},"description":"Up to 4 sequences where the API will stop generating further tokens","example":"json([\"stop\", \"halt\"])","default":"[]","uniqueKey":"stop.oneOf.1","typeLabel":"null"}],"uniqueKey":"stop","typeLabel":"string[] | null"},"stream":{"oneOf":[{"type":"boolean","description":"Whether to stream back partial progress","example":false,"uniqueKey":"stream.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether to stream back partial progress","example":false,"uniqueKey":"stream.oneOf.1","typeLabel":"null"}],"uniqueKey":"stream","typeLabel":"boolean | null"},"stream_options":{"oneOf":[{"type":"null","uniqueKey":"stream_options.oneOf.0","typeLabel":"null"},{"type":"object","description":"Options for streaming response. Only set this when you set stream: true.","properties":{"include_usage":{"oneOf":[{"type":"boolean","description":"If set, an additional chunk will be streamed before the data: [DONE] message.\nThe usage field on this chunk shows the token usage statistics for the entire request, and the choices field\nwill always be an empty array. All other chunks will also include a usage field, but with a null value.","uniqueKey":"stream_options.oneOf.1.include_usage.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"If set, an additional chunk will be streamed before the data: [DONE] message.\nThe usage field on this chunk shows the token usage statistics for the entire request, and the choices field\nwill always be an empty array. All other chunks will also include a usage field, but with a null value.","uniqueKey":"stream_options.oneOf.1.include_usage.oneOf.1","typeLabel":"null"}],"uniqueKey":"stream_options.oneOf.1.include_usage","typeLabel":"boolean | null"}},"uniqueKey":"stream_options.oneOf.1","typeLabel":"object"}],"uniqueKey":"stream_options","typeLabel":"null | object"},"suffix":{"oneOf":[{"type":"string","description":"The suffix that comes after a completion of inserted text.","example":"json(\"\\n\")","uniqueKey":"suffix.oneOf.0","typeLabel":"string"},{"type":"null","description":"The suffix that comes after a completion of inserted text.","example":"json(\"\\n\")","uniqueKey":"suffix.oneOf.1","typeLabel":"null"}],"uniqueKey":"suffix","typeLabel":"string | null"},"temperature":{"oneOf":[{"type":"number","format":"float","description":"What sampling temperature to use, between 0 and 2","example":0.7,"uniqueKey":"temperature.oneOf.0","typeLabel":"number\u003cfloat>"},{"type":"null","format":"float","description":"What sampling temperature to use, between 0 and 2","example":0.7,"uniqueKey":"temperature.oneOf.1","typeLabel":"null"}],"uniqueKey":"temperature","typeLabel":"number\u003cfloat> | null"},"top_p":{"oneOf":[{"type":"number","format":"float","description":"An alternative to sampling with temperature","example":1,"uniqueKey":"top_p.oneOf.0","typeLabel":"number\u003cfloat>"},{"type":"null","format":"float","description":"An alternative to sampling with temperature","example":1,"uniqueKey":"top_p.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_p","typeLabel":"number\u003cfloat> | null"},"user":{"oneOf":[{"type":"string","description":"A unique identifier representing your end-user","example":"user-1234","uniqueKey":"user.oneOf.0","typeLabel":"string"},{"type":"null","description":"A unique identifier representing your end-user","example":"user-1234","uniqueKey":"user.oneOf.1","typeLabel":"null"}],"uniqueKey":"user","typeLabel":"string | null"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"model":"meta-llama/Llama-3.3-70B-Instruct","prompt":"\u003cstring>","best_of":1,"echo":false,"frequency_penalty":0,"logit_bias":{"1234567890":0.5,"1234567891":-0.5},"logprobs":1,"max_tokens":4096,"n":1,"presence_penalty":0,"seed":123,"stop":"json([\"stop\", \"halt\"])","stream":false,"stream_options":{"include_usage":true},"suffix":"json(\"\\n\")","temperature":0.7,"top_p":1,"user":"user-1234"}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"9b2a6bfa-99dd-4f66-a822-daf9d350365a":{"description":"Chat completions","content":{"application/json":{"schema":{"type":"object","required":["choices","usage","created","id","model","object","system_fingerprint"],"properties":{"choices":{"type":"array","items":{"type":"object","description":"A completion choice response","required":["text","index","finish_reason"],"properties":{"finish_reason":{"type":"string","description":"The reason the model stopped generating tokens","example":"stop","isRequired":true,"uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"string"},"index":{"type":"integer","format":"int32","description":"The index of the choice in the list of choices","example":0,"isRequired":true,"uniqueKey":"choices.items.[INDEX].index","typeLabel":"integer\u003cint32>"},"text":{"type":"string","description":"The generated text","example":"This is a test","isRequired":true,"uniqueKey":"choices.items.[INDEX].text","typeLabel":"string"},"logprobs":{"oneOf":[{"type":"null","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0","typeLabel":"null"},{"type":"object","description":"The log probabilities of the chosen tokens","required":["tokens","token_logprobs","top_logprobs","text_offset"],"properties":{"text_offset":{"type":"array","items":{"type":"integer","format":"int32","minimum":0,"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.text_offset.items.[INDEX]","typeLabel":"integer\u003cint32>"},"description":"The text offset of the tokens","example":[0,10],"isRequired":true,"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.text_offset","typeLabel":"integer\u003cint32>[]"},"token_logprobs":{"type":"array","items":{"type":"number","format":"float","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.token_logprobs.items.[INDEX]","typeLabel":"number\u003cfloat>"},"description":"The log probabilities of the tokens","example":[0.5,-0.5],"isRequired":true,"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.token_logprobs","typeLabel":"number\u003cfloat>[]"},"tokens":{"type":"array","items":{"type":"string","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.tokens.items.[INDEX]","typeLabel":"string"},"description":"The tokens","example":["Hello ","world"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.tokens","typeLabel":"string[]"},"top_logprobs":{"type":"array","items":{"type":"object","additionalProperties":{"type":"number","format":"float","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.top_logprobs.items.[INDEX].additionalProperties","typeLabel":"number\u003cfloat>"},"propertyNames":{"type":"string"},"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.top_logprobs.items.[INDEX]","typeLabel":"object"},"description":"The top log probabilities","example":[{"Hello ":-0.2,"world":-0.8}],"isRequired":true,"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.top_logprobs","typeLabel":"object[]"}},"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1","typeLabel":"object"}],"uniqueKey":"choices.items.[INDEX].logprobs","typeLabel":"null | object"}},"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"description":"Array of completion choices response","example":[{"text":"This is a test","index":0,"logprobs":null,"finish_reason":"stop"}],"isRequired":true,"uniqueKey":"choices","typeLabel":"object[]"},"created":{"type":"integer","format":"int64","description":"The creation time of the request","example":"2021-01-01T00:00:00.000Z","isRequired":true,"uniqueKey":"created","typeLabel":"integer\u003cint64>"},"id":{"type":"string","description":"The ID of the request","example":"cmpl-1234567890","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"model":{"type":"string","description":"The model used for the request","example":"meta-llama/Llama-3.3-70B-Instruct","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"object":{"type":"string","description":"The object type","example":"text_completion","isRequired":true,"uniqueKey":"object","typeLabel":"string"},"system_fingerprint":{"type":"string","description":"The system fingerprint","example":"system-fingerprint","isRequired":true,"uniqueKey":"system_fingerprint","typeLabel":"string"},"usage":{"type":"object","required":["prompt_tokens","completion_tokens","total_tokens","completion_tokens_details","prompt_tokens_details"],"properties":{"completion_tokens":{"type":"integer","format":"int32","description":"The number of completion tokens used","example":10,"minimum":0,"isRequired":true,"uniqueKey":"usage.completion_tokens","typeLabel":"integer\u003cint32>"},"completion_tokens_details":{"type":"object","description":"The details of the completion tokens","required":["accepted_prediction_tokens","audio_tokens","reasoning_tokens","rejected_prediction_tokens"],"properties":{"accepted_prediction_tokens":{"type":"integer","format":"int32","description":"The number of tokens in the completion","example":10,"minimum":0,"isRequired":true,"uniqueKey":"usage.completion_tokens_details.accepted_prediction_tokens","typeLabel":"integer\u003cint32>"},"audio_tokens":{"type":"integer","format":"int32","description":"The number of audio tokens","example":0,"minimum":0,"isRequired":true,"uniqueKey":"usage.completion_tokens_details.audio_tokens","typeLabel":"integer\u003cint32>"},"reasoning_tokens":{"type":"integer","format":"int32","description":"The number of reasoning tokens","example":10,"minimum":0,"isRequired":true,"uniqueKey":"usage.completion_tokens_details.reasoning_tokens","typeLabel":"integer\u003cint32>"},"rejected_prediction_tokens":{"type":"integer","format":"int32","description":"The number of rejected prediction tokens","example":0,"minimum":0,"isRequired":true,"uniqueKey":"usage.completion_tokens_details.rejected_prediction_tokens","typeLabel":"integer\u003cint32>"}},"isRequired":true,"uniqueKey":"usage.completion_tokens_details","typeLabel":"object"},"prompt_tokens":{"type":"integer","format":"int32","description":"The number of prompt tokens used","example":10,"minimum":0,"isRequired":true,"uniqueKey":"usage.prompt_tokens","typeLabel":"integer\u003cint32>"},"prompt_tokens_details":{"type":"object","required":["audio_tokens","cached_tokens"],"properties":{"audio_tokens":{"type":"integer","format":"int32","description":"The number of audio tokens","example":0,"minimum":0,"isRequired":true,"uniqueKey":"usage.prompt_tokens_details.audio_tokens","typeLabel":"integer\u003cint32>"},"cached_tokens":{"type":"integer","format":"int32","description":"The number of cached tokens","example":10,"minimum":0,"isRequired":true,"uniqueKey":"usage.prompt_tokens_details.cached_tokens","typeLabel":"integer\u003cint32>"}},"description":"The details of the prompt tokens","isRequired":true,"uniqueKey":"usage.prompt_tokens_details","typeLabel":"object"},"total_tokens":{"type":"integer","format":"int32","description":"The total number of tokens used","example":20,"minimum":0,"isRequired":true,"uniqueKey":"usage.total_tokens","typeLabel":"integer\u003cint32>"}},"description":"The usage information for the request","isRequired":true,"uniqueKey":"usage","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"choices":[{"text":"This is a test","index":0,"logprobs":null,"finish_reason":"stop"}],"created":"2021-01-01T00:00:00.000Z","id":"cmpl-1234567890","model":"meta-llama/Llama-3.3-70B-Instruct","object":"text_completion","system_fingerprint":"system-fingerprint","usage":{"completion_tokens":10,"completion_tokens_details":{"accepted_prediction_tokens":10,"audio_tokens":0,"reasoning_tokens":10,"rejected_prediction_tokens":0},"prompt_tokens":10,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":10},"total_tokens":20}}}},"exampleType":"generated"}},"exampleType":"generated"},"d9dbc795-a54d-4011-881f-cb270943fe06":{"description":"Bad request","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"92ba941a-d718-4c57-b92a-80a73aaf5455":{"description":"Unauthorized","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"bd40c1de-363e-4dcf-a896-cb8929a90ab7":{"description":"Internal server error","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"dba9d883-1e31-4717-92a7-6b343906e4ae":{"bearerAuth":{"type":"http","scheme":"bearer","scopes":[]}}},"servers":{"dfb8e2f7-db43-4d17-8dd7-eba4e1b68421":{"url":"https://api.atoma.network"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"cloud-api-reference/openapi.yml"},"subdomain":"atoma","siteName":"Atoma","title":"Create completions - Atoma","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2025-08-27T12:14:43.537Z","originalFileLocation":"cloud-api-reference/completions/create-completions.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"This function processes completion requests by using the chat completions endpoint. ## Returns Returns a Response containing either: - A streaming SSE connection for real-time completions - A single JSON response for non-streaming completions ## Errors Returns an error status code if: - The request processing fails - The streaming/non-streaming handlers encounter errors - The underlying inference service returns an error\">\u003cmeta data-mint-head name=\"application-name\" content=\"Atoma\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/atoma/HSkPayHGWCvocihP/_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/atoma/HSkPayHGWCvocihP/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/atoma/HSkPayHGWCvocihP/_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/atoma/HSkPayHGWCvocihP/_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/atoma/HSkPayHGWCvocihP/_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/atoma/HSkPayHGWCvocihP/_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/atoma/HSkPayHGWCvocihP/_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/atoma/HSkPayHGWCvocihP/_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/atoma/HSkPayHGWCvocihP/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create completions - Atoma\">\u003cmeta data-mint-head property=\"og:description\" content=\"This function processes completion requests by using the chat completions endpoint. ## Returns Returns a Response containing either: - A streaming SSE connection for real-time completions - A single JSON response for non-streaming completions ## Errors Returns an error status code if: - The request processing fails - The streaming/non-streaming handlers encounter errors - The underlying inference service returns an error\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Atoma\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.atoma.ai/cloud-api-reference/completions/create-completions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://atoma.mintlify.site/_mintlify/api/og/v2?division=Completions\u0026amp;title=Create+completions\u0026amp;description=This+function+processes+completion+requests+by+using+the+chat+completions+endpoint.%0A%0A%23%23+Returns%0A%0AReturns+a+Response+containing+either%3A%0A-+A+streaming+SSE+connect\u0026amp;theme=cafd4bab465c83e2db0edc73\u0026amp;signature=3ed4bbe781046c8d51b2a25e6f2429d508d02b3a4769a01b18c7c834daa4ea81\">\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=\"Create completions - Atoma\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"This function processes completion requests by using the chat completions endpoint. ## Returns Returns a Response containing either: - A streaming SSE connection for real-time completions - A single JSON response for non-streaming completions ## Errors Returns an error status code if: - The request processing fails - The streaming/non-streaming handlers encounter errors - The underlying inference service returns an error\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://atoma.mintlify.site/_mintlify/api/og/v2?division=Completions\u0026amp;title=Create+completions\u0026amp;description=This+function+processes+completion+requests+by+using+the+chat+completions+endpoint.%0A%0A%23%23+Returns%0A%0AReturns+a+Response+containing+either%3A%0A-+A+streaming+SSE+connect\u0026amp;theme=cafd4bab465c83e2db0edc73\u0026amp;signature=3ed4bbe781046c8d51b2a25e6f2429d508d02b3a4769a01b18c7c834daa4ea81\">\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/atoma/HSkPayHGWCvocihP/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Atoma\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#87CEFA\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.atoma.ai/cloud-api-reference/completions/create-completions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/cloud-api-reference/completions/create-completions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.atoma.ai/#organization\",\"name\":\"Atoma\",\"url\":\"https://docs.atoma.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/atoma/tjjv1G2ZJctJbnbW/logo/Favicon_Atoma.svg?fit=max\u0026auto=format\u0026n=tjjv1G2ZJctJbnbW\u0026q=85\u0026s=fb271bbe709375a10927262bb6bc73a1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.atoma.ai#website\",\"name\":\"Atoma\",\"url\":\"https://docs.atoma.ai\",\"publisher\":{\"@id\":\"https://docs.atoma.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.atoma.ai/cloud-api-reference/completions/create-completions#webpage\",\"url\":\"https://docs.atoma.ai/cloud-api-reference/completions/create-completions\",\"name\":\"Create completions\",\"description\":\"This function processes completion requests by using the chat completions endpoint. ## Returns Returns a Response containing either: - A streaming SSE connection for real-time completions - A single JSON response for non-streaming completions ## Errors Returns an error status code if: - The request processing fails - The streaming/non-streaming handlers encounter errors - The underlying inference service returns an error\",\"dateModified\":\"2025-08-27T12:14:43.537Z\",\"isPartOf\":{\"@id\":\"https://docs.atoma.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.atoma.ai/cloud-api-reference/completions/create-completions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.atoma.ai/cloud-api-reference/completions/create-completions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Atoma\",\"item\":\"https://docs.atoma.ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create completions\",\"item\":\"https://docs.atoma.ai/cloud-api-reference/completions/create-completions\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.atoma.ai/cloud-api-reference/completions/create-completions#apireference\",\"headline\":\"Create completions\",\"name\":\"Create completions\",\"description\":\"This function processes completion requests by using the chat completions endpoint. ## Returns Returns a Response containing either: - A streaming SSE connection for real-time completions - A single JSON response for non-streaming completions ## Errors Returns an error status code if: - The request processing fails - The streaming/non-streaming handlers encounter errors - The underlying inference service returns an error\",\"url\":\"https://docs.atoma.ai/cloud-api-reference/completions/create-completions\",\"mainEntityOfPage\":{\"@id\":\"https://docs.atoma.ai/cloud-api-reference/completions/create-completions#webpage\"},\"dateModified\":\"2025-08-27T12:14:43.537Z\",\"publisher\":{\"@id\":\"https://docs.atoma.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.atoma.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Atoma\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Atoma\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/cloud-api-reference/completions/create-completions.md","siteName":"Atoma","nav":{"global":{"anchors":[{"anchor":"Website","href":"https://www.atoma.ai","icon":"globe"},{"anchor":"Community","href":"https://discord.gg/atoma","icon":"discord"},{"anchor":"Blog","href":"https://atomanetwork.medium.com","icon":"newspaper"},{"anchor":"Github","href":"https://github.com/atoma-ai","icon":"github"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/documentation/get-started/overview"}]},{"tab":"Cloud API Reference","groups":[{"group":"API Reference","pages":[{"title":"Get Started","description":"Learn how to use Atoma's Cloud API for AI inference","href":"/cloud-api-reference/get-started"}]},{"group":"Completions","pages":[{"title":"Create completions","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/completions","href":"/cloud-api-reference/completions/create-completions"}]},{"group":"Confidential Completions","pages":[{"title":"Create confidential completions","description":"This handler processes completions requests in a confidential manner, providing additional\nencryption and security measures for sensitive data processing. It supports both streaming and\nnon-streaming responses while maintaining data confidentiality through AEAD encryption and TEE hardware,\nfor full private AI compute.\n\n## Returns\n\nReturns a `Result` containing either:\n* An HTTP response with the completions result\n* A streaming SSE connection for real-time completions\n* An `AtomaProxyError` error if the request processing fails\n\n## Errors\n\nReturns `AtomaProxyError::InvalidBody` if:\n* The 'stream' field is missing or invalid in the payload\n\nReturns `AtomaProxyError::InternalError` if:\n* The inference service request fails\n* Response processing encounters errors\n* State manager updates fail\n\n## Security Features\n\n* Utilizes AEAD encryption for request/response data\n* Supports TEE (Trusted Execution Environment) processing\n* Implements secure key exchange using X25519\n* Maintains confidentiality throughout the request lifecycle","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/confidential/completions","href":"/cloud-api-reference/confidential-completions/create-confidential-completions"}]},{"group":"Chat","pages":[{"title":"Create chat completions","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/chat/completions","href":"/cloud-api-reference/chat/create-chat-completions"}]},{"group":"Confidential Chat","pages":[{"title":"Create confidential chat completions","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/confidential/chat/completions","href":"/cloud-api-reference/confidential-chat/create-confidential-chat-completions"}]},{"group":"Confidential Embeddings","pages":[{"title":"Create confidential embeddings","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/confidential/embeddings","href":"/cloud-api-reference/confidential-embeddings/create-confidential-embeddings"}]},{"group":"Confidential Images","pages":[{"title":"Create confidential image","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/confidential/images/generations","href":"/cloud-api-reference/confidential-images/create-confidential-image"}]},{"group":"Embeddings","pages":[{"title":"Create embeddings","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/embeddings","href":"/cloud-api-reference/embeddings/create-embeddings"}]},{"group":"Health","pages":[{"title":"Health","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml get /health","href":"/cloud-api-reference/health/health"}]},{"group":"Images","pages":[{"title":"Create image","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/images/generations","href":"/cloud-api-reference/images/create-image"}]},{"group":"Models","pages":[{"title":"List models","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml get /v1/models","href":"/cloud-api-reference/models/list-models"},{"title":"OpenRouter models listing endpoint","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml get /v1/open_router/models","href":"/cloud-api-reference/models/openrouter-models-listing-endpoint"}]},{"group":"Nodes","pages":[{"title":"Create node","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/nodes","href":"/cloud-api-reference/nodes/create-node"},{"title":"Create a node lock for confidential compute","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/nodes/lock","href":"/cloud-api-reference/nodes/create-a-node-lock-for-confidential-compute"}]}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/overview"}]}]},"basePath":"","title":"Create completions - Atoma","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DdEMm2kG.js","utils-BMo572L7.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-C-4m9KAx.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-DPLK2Oq9.js","snippetPresets-BKjfJMC9.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-DTsgtCEj.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C8vmhyQM.js","shallow-r9w8LQGS.js","getApiPlaygroundDisplay-DjPI64HQ.js","CodeSnippet-C8Bvhl16.js","CodeSnippets-BtWUwcMy.js","Page-BIYvYBgk.js","getPastedJson-Dcm_3Pgl.js","icon-BXwrTpjc.js","MethodPill-CcjfVmmy.js","DuplicateIcon-BuKIbXAQ.js","createIcon-DaL9yXsO.js","DynamicMarkdown-Co5nikxh.js","SectionHeading-P4UNTsMZ.js","axios-vUo_bRtp.js","Markdown-CEfymfIH.js","clsx-Dq9TQuNi.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-D2J8knkn.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-BgZ2ThuU.js"]}