Send prompts to /v1/responses to generate text with AtlasFlux, control output with max_output_tokens and temperature, and enable reasoning effort levels.
curl https://api.atlasflux.my/v1/responses \ -H "Authorization: Bearer $ATLASFLUX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "input": "Solve this step by step: If a train travels 120km in 2 hours, what is its average speed?", "reasoning": {"effort": "medium"}, "max_output_tokens": 1024 }'
OpenAI-compatible format
Use /v1/chat/completions if you prefer the OpenAI message format:
curl https://api.atlasflux.my/v1/chat/completions \ -H "Authorization: Bearer $ATLASFLUX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is the capital of Japan?"} ], "max_tokens": 256, "temperature": 0.5 }'
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/schema.json","name":"AtlasFlux API","description":"Unified AI model routing API. One endpoint, intelligent routing, web search, and prepaid MYR billing.","colors":{"primary":"#FF3333","light":"#e3a3a3","dark":"#FFB000"},"logo":{"light":"https://mintcdn.com/rainspeed/9hLKCKE2V9i9N5q9/images/atlas.png?fit=max\u0026auto=format\u0026n=9hLKCKE2V9i9N5q9\u0026q=85\u0026s=8a986fb44007cd3d88b509e406696354","dark":"https://mintcdn.com/rainspeed/9hLKCKE2V9i9N5q9/images/atlas.png?fit=max\u0026auto=format\u0026n=9hLKCKE2V9i9N5q9\u0026q=85\u0026s=8a986fb44007cd3d88b509e406696354"},"favicon":{"light":"https://mintcdn.com/rainspeed/UIjg82xMZiEIgHFH/favicon.svg?fit=max\u0026auto=format\u0026n=UIjg82xMZiEIgHFH\u0026q=85\u0026s=21ace199a401d361e8807147f84c903e","dark":"https://mintcdn.com/rainspeed/9hLKCKE2V9i9N5q9/images/atlas.png?fit=max\u0026auto=format\u0026n=9hLKCKE2V9i9N5q9\u0026q=85\u0026s=8a986fb44007cd3d88b509e406696354"},"navbar":{"links":[]},"search":{"prompt":"Search AtlasFlux API docs..."},"icons":{"library":"fontawesome"},"styling":{"latex":false},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"rainspeed","hasAudioNarration":false,"actualSubdomain":"rainspeed","customDomains":["api-docs.atlasflux.my"],"gitSource":{"type":"github","owner":"muhdnabil66","repo":"atlasflux-api-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6aea21c0ffb1edb4e0543749:success","clientVersion":"0.0.4416","searchFilterCounts":[{"language":"default","tag":"API Reference","count":18},{"language":"default","tag":"Core Concepts","count":7},{"language":"default","tag":"Guides","count":5},{"language":"default","tag":"Resources","count":3},{"language":"default","tag":"Dashboard — API Keys","count":3},{"language":"default","tag":"Dashboard — Billing","count":3},{"language":"default","tag":"Models","count":2},{"language":"default","tag":"Chat Completions","count":1},{"language":"default","tag":"Dashboard — Logs","count":1},{"language":"default","tag":"Dashboard — Overview","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"guides/text-generation","slug":"/guides/text-generation","pageMetadata":{"title":"Generate text with the AtlasFlux API","description":"Send prompts to /v1/responses to generate text with AtlasFlux, control output with max_output_tokens and temperature, and enable reasoning effort levels.","href":"/guides/text-generation"},"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 prompts to /v1/responses to generate text with AtlasFlux, control output with max_output_tokens and temperature, and enable reasoning effort levels.\"\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={code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`basic-text-generation`,children:`Basic text generation`}),`\n`,_jsxs(_components.p,{children:[`Send a prompt to the `,_jsx(_components.code,{children:`/v1/responses`}),` endpoint:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.atlasflux.my/v1/responses`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ATLASFLUX_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input\": \"Explain quantum computing in simple terms\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max_output_tokens\": 512,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"temperature\": 0.7`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`with-reasoning`,children:`With reasoning`}),`\n`,_jsx(_components.p,{children:`Enable reasoning for complex tasks:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.atlasflux.my/v1/responses`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ATLASFLUX_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input\": \"Solve this step by step: If a train travels 120km in 2 hours, what is its average speed?\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"reasoning\": {\"effort\": \"medium\"},`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max_output_tokens\": 1024`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`openai-compatible-format`,children:`OpenAI-compatible format`}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`/v1/chat/completions`}),` if you prefer the OpenAI message format:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.atlasflux.my/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ATLASFLUX_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {\"role\": \"user\", \"content\": \"What is the capital of Japan?\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max_tokens\": 256,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"temperature\": 0.5`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`temperature-guide`,children:`Temperature guide`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Value`}),_jsx(_components.th,{children:`Behavior`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`0.0`}),_jsx(_components.td,{children:`Deterministic, most focused`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`0.3`}),_jsx(_components.td,{children:`Conservative, low variation`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`0.7`}),_jsx(_components.td,{children:`Balanced (default)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`1.0`}),_jsx(_components.td,{children:`Creative, high variation`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`2.0`}),_jsx(_components.td,{children:`Maximum randomness`})]})]})]})]})}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":"Generate text with the AtlasFlux API","description":"Send prompts to /v1/responses to generate text with AtlasFlux, control output with max_output_tokens and temperature, and enable reasoning effort levels.","href":"/guides/text-generation"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Basic text generation","slug":"basic-text-generation","depth":2,"children":[]},{"title":"With reasoning","slug":"with-reasoning","depth":2,"children":[]},{"title":"OpenAI-compatible format","slug":"openai-compatible-format","depth":2,"children":[]},{"title":"Temperature guide","slug":"temperature-guide","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/rainspeed/7e047e161b1749ff/docs/snippets/javascript/generate-response.js"],"subdomain":"rainspeed","siteName":"AtlasFlux API","title":"Generate text with the AtlasFlux API - AtlasFlux API","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-09T11:57:52.048Z","originalFileLocation":"guides/text-generation.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 prompts to /v1/responses to generate text with AtlasFlux, control output with max_output_tokens and temperature, and enable reasoning effort levels.\">\u003cmeta data-mint-head name=\"application-name\" content=\"AtlasFlux API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/rainspeed/MLSVTBJS0YQ6L4Wm/_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/rainspeed/MLSVTBJS0YQ6L4Wm/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/rainspeed/MLSVTBJS0YQ6L4Wm/_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/rainspeed/MLSVTBJS0YQ6L4Wm/_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/rainspeed/MLSVTBJS0YQ6L4Wm/_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/rainspeed/MLSVTBJS0YQ6L4Wm/_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/rainspeed/MLSVTBJS0YQ6L4Wm/_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/rainspeed/MLSVTBJS0YQ6L4Wm/_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/rainspeed/MLSVTBJS0YQ6L4Wm/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Generate text with the AtlasFlux API - AtlasFlux API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Send prompts to /v1/responses to generate text with AtlasFlux, control output with max_output_tokens and temperature, and enable reasoning effort levels.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"AtlasFlux API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://api-docs.atlasflux.my/guides/text-generation\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://rainspeed.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Generate+text+with+the+AtlasFlux+API\u0026amp;description=Send+prompts+to+%2Fv1%2Fresponses+to+generate+text+with+AtlasFlux%2C+control+output+with+max_output_tokens+and+temperature%2C+and+enable+reasoning+effort+levels.\u0026amp;theme=8afb46a83c4f0ce93f8c9576\u0026amp;signature=bebf61e6ce67c9125bbb94d2feee9bfdb737465ee7403f3b8b4d270f5313aab0\">\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=\"Generate text with the AtlasFlux API - AtlasFlux API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Send prompts to /v1/responses to generate text with AtlasFlux, control output with max_output_tokens and temperature, and enable reasoning effort levels.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://rainspeed.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Generate+text+with+the+AtlasFlux+API\u0026amp;description=Send+prompts+to+%2Fv1%2Fresponses+to+generate+text+with+AtlasFlux%2C+control+output+with+max_output_tokens+and+temperature%2C+and+enable+reasoning+effort+levels.\u0026amp;theme=8afb46a83c4f0ce93f8c9576\u0026amp;signature=bebf61e6ce67c9125bbb94d2feee9bfdb737465ee7403f3b8b4d270f5313aab0\">\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/rainspeed/MLSVTBJS0YQ6L4Wm/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"AtlasFlux API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF3333\">\u003clink data-mint-head rel=\"canonical\" href=\"https://api-docs.atlasflux.my/guides/text-generation\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/text-generation.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://api-docs.atlasflux.my/#organization\",\"name\":\"AtlasFlux API\",\"url\":\"https://api-docs.atlasflux.my\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/rainspeed/9hLKCKE2V9i9N5q9/images/atlas.png?fit=max\u0026auto=format\u0026n=9hLKCKE2V9i9N5q9\u0026q=85\u0026s=8a986fb44007cd3d88b509e406696354\"}},{\"@type\":\"WebSite\",\"@id\":\"https://api-docs.atlasflux.my#website\",\"name\":\"AtlasFlux API\",\"url\":\"https://api-docs.atlasflux.my\",\"publisher\":{\"@id\":\"https://api-docs.atlasflux.my/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://api-docs.atlasflux.my/guides/text-generation#webpage\",\"url\":\"https://api-docs.atlasflux.my/guides/text-generation\",\"name\":\"Generate text with the AtlasFlux API\",\"description\":\"Send prompts to /v1/responses to generate text with AtlasFlux, control output with max_output_tokens and temperature, and enable reasoning effort levels.\",\"dateModified\":\"2026-08-09T11:57:52.048Z\",\"isPartOf\":{\"@id\":\"https://api-docs.atlasflux.my#website\"},\"breadcrumb\":{\"@id\":\"https://api-docs.atlasflux.my/guides/text-generation#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://api-docs.atlasflux.my/guides/text-generation#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://api-docs.atlasflux.my/guides/first-request\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Generate text with the AtlasFlux API\",\"item\":\"https://api-docs.atlasflux.my/guides/text-generation\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://api-docs.atlasflux.my/guides/text-generation#article\",\"headline\":\"Generate text with the AtlasFlux API\",\"name\":\"Generate text with the AtlasFlux API\",\"description\":\"Send prompts to /v1/responses to generate text with AtlasFlux, control output with max_output_tokens and temperature, and enable reasoning effort levels.\",\"url\":\"https://api-docs.atlasflux.my/guides/text-generation\",\"mainEntityOfPage\":{\"@id\":\"https://api-docs.atlasflux.my/guides/text-generation#webpage\"},\"dateModified\":\"2026-08-09T11:57:52.048Z\",\"publisher\":{\"@id\":\"https://api-docs.atlasflux.my/#organization\"},\"isPartOf\":{\"@id\":\"https://api-docs.atlasflux.my#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"AtlasFlux API\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"AtlasFlux API\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/guides/text-generation.md","siteName":"AtlasFlux API","nav":{"global":null,"pages":[{"title":"AtlasFlux API: unified AI model routing service","href":"/introduction"},{"title":"AtlasFlux quickstart: your first API call","href":"/quickstart"},{"title":"AtlasFlux JavaScript and TypeScript SDK","href":"/sdks"},{"group":"Core Concepts","pages":[{"title":"How the AtlasFlux API gateway works","href":"/concepts/overview"},{"title":"Create and manage AtlasFlux API keys","href":"/concepts/api-keys"},{"title":"AtlasFlux models, capabilities, and routing","href":"/concepts/models"},{"title":"AtlasFlux request and response formats","href":"/concepts/requests-and-responses"},{"title":"Server-Sent Events streaming for AtlasFlux responses","href":"/concepts/streaming"},{"title":"AtlasFlux prepaid MYR wallet, billing, and usage","href":"/concepts/usage-and-billing"},{"title":"AtlasFlux API rate limits and 429 responses","href":"/concepts/rate-limits"}]},{"title":"Authenticate requests to the AtlasFlux API","href":"/authentication"},{"group":"Guides","pages":[{"title":"Send your first AtlasFlux API request","description":"Step-by-step walkthrough for creating a test API key, exporting it as an environment variable, and sending your first AtlasFlux request with curl.","href":"/guides/first-request"},{"title":"Generate text with the AtlasFlux API","href":"/guides/text-generation"},{"title":"Stream AtlasFlux responses with SSE","description":"Enable streaming on /v1/chat/completions and /v1/responses, parse Server-Sent Events for incremental content, and handle usage totals and stream errors.","href":"/guides/streaming-responses"},{"title":"Handle AtlasFlux API errors and retries","href":"/guides/handling-errors"},{"title":"AtlasFlux production readiness checklist","href":"/guides/production-checklist"}]},{"group":"API Reference","pages":[{"title":"AtlasFlux API endpoints and base URL reference","href":"/api-reference/overview"},{"title":"Authentication reference for AtlasFlux endpoints","href":"/api-reference/authentication"},{"title":"AtlasFlux API error codes and retry behavior","href":"/api-reference/errors"},{"title":"AtlasFlux API changelog and release notes","href":"/api-reference/changelog"},{"group":"Responses","pages":[{"title":"Create a response","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/responses","href":"/api-reference/responses/create-a-response"}]},{"group":"Chat Completions","pages":[{"title":"Create a chat completion","deprecated":null,"version":null,"openapi":"/openapi.json post /v1/chat/completions","href":"/api-reference/chat-completions/create-a-chat-completion"}]},{"group":"Models","pages":[{"title":"List available models","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/models","href":"/api-reference/models/list-available-models"},{"title":"Retrieve a model","deprecated":null,"version":null,"openapi":"/openapi.json get /v1/models/{model}","href":"/api-reference/models/retrieve-a-model"}]},{"group":"Dashboard — API Keys","pages":[{"title":"List API keys","deprecated":null,"version":null,"openapi":"/openapi.json get /dashboard/api-keys","href":"/api-reference/dashboard-—-api-keys/list-api-keys"},{"title":"Create an API key","deprecated":null,"version":null,"openapi":"/openapi.json post /dashboard/api-keys","href":"/api-reference/dashboard-—-api-keys/create-an-api-key"},{"title":"Delete an API key","deprecated":null,"version":null,"openapi":"/openapi.json delete /dashboard/api-keys/{id}","href":"/api-reference/dashboard-—-api-keys/delete-an-api-key"}]},{"group":"Dashboard — Overview","pages":[{"title":"Get dashboard overview","deprecated":null,"version":null,"openapi":"/openapi.json get /dashboard/overview","href":"/api-reference/dashboard-—-overview/get-dashboard-overview"}]},{"group":"Dashboard — Usage","pages":[{"title":"Get usage data","deprecated":null,"version":null,"openapi":"/openapi.json get /dashboard/usage","href":"/api-reference/dashboard-—-usage/get-usage-data"}]},{"group":"Dashboard — Billing","pages":[{"title":"Get billing balance","deprecated":null,"version":null,"openapi":"/openapi.json get /dashboard/billing/balance","href":"/api-reference/dashboard-—-billing/get-billing-balance"},{"title":"Get transaction history","deprecated":null,"version":null,"openapi":"/openapi.json get /dashboard/billing/transactions","href":"/api-reference/dashboard-—-billing/get-transaction-history"},{"title":"Create a Stripe checkout session","deprecated":null,"version":null,"openapi":"/openapi.json post /dashboard/billing/checkout","href":"/api-reference/dashboard-—-billing/create-a-stripe-checkout-session"}]},{"group":"Dashboard — Logs","pages":[{"title":"Get request logs","deprecated":null,"version":null,"openapi":"/openapi.json get /dashboard/logs","href":"/api-reference/dashboard-—-logs/get-request-logs"}]},{"group":"Webhooks","pages":[{"title":"Stripe webhook receiver","deprecated":null,"version":null,"openapi":"/openapi.json post /billing/stripe/webhook","href":"/api-reference/webhooks/stripe-webhook-receiver"}]}]},{"group":"Resources","pages":[{"title":"AtlasFlux error code lookup and resolution","href":"/resources/errors"},{"title":"Secure your AtlasFlux integration","href":"/resources/security"},{"title":"Get support for the AtlasFlux API","href":"/resources/support"}]}]},"basePath":"","title":"Generate text with the AtlasFlux API - AtlasFlux API","deploymentId":"dpl_Bzhd2vEuuXmvNaTmqBBYbeBj3epG","buildId":"dpl_Bzhd2vEuuXmvNaTmqBBYbeBj3epG","dynamics":[],"chunks":[]}