Given a prompt ID, variable values, and optionally any hyperparameters, this API returns a JSON object containing the raw prompt template.
Note: Unlike inference requests, Prompt Render API calls are processed through Portkey’s Control Plane services.
Example: Using Prompt Render output in a new request
Here’s how you can take the output from the render API and use it for making a separate LLM call. We’ll take example of OpenAI SDKs, but you can use it simlarly for any other frameworks like Langchain etc. as well.
from portkey_ai import Portkeyfrom openai import OpenAI# Retrieving the Prompt from Portkeyportkey = Portkey( api_key="PORTKEY_API_KEY")render_response = portkey.prompts.render( prompt_id="PROMPT_ID", variables={ "movie":"Dune 2" })PROMPT_TEMPLATE = render_response.data# Making a Call to OpenAI with the Retrieved Promptopenai = OpenAI( api_key = "OPENAI_API_KEY", base_url = "https://api.portkey.ai/v1", default_headers = { 'x-portkey-provider': 'openai', 'x-portkey-api-key': 'PORTKEY_API_KEY', 'Content-Type': 'application/json', })chat_complete = openai.chat.completions.create(**PROMPT_TEMPLATE)print(chat_complete.choices[0].message.content)
import Portkey from 'portkey-ai';import OpenAI from 'openai';// Retrieving the Prompt from Portkeyconst portkey = new Portkey({ apiKey: "PORTKEY_API_KEY"})async function getPromptTemplate() { const render_response = await portkey.prompts.render({ promptID: "PROMPT_ID", variables: { "movie":"Dune 2" } }) return render_response.data;}// Making a Call to OpenAI with the Retrieved Promptconst openai = new OpenAI({ apiKey: 'OPENAI_API_KEY', baseURL: 'https://api.portkey.ai/v1', defaultHeaders: { 'x-portkey-provider': 'openai', 'x-portkey-api-key': 'PORTKEY_API_KEY', 'Content-Type': 'application/json', }});async function main() { const PROMPT_TEMPLATE = await getPromptTemplate(); const chatCompletion = await openai.chat.completions.create(PROMPT_TEMPLATE); console.log(chatCompletion.choices[0]);}main();
Portkey is now PRISMA AIRS AI Gateway. See it in action.
The unique identifier of the prompt template to render
Body
application/json
Note: Although hyperparameters are shown grouped here (like messages, max_completion_tokens, temperature, etc.), they should only be passed at the root level, alongside 'variables' and 'stream'. The max_tokens parameter is deprecated — use max_completion_tokens instead.
Note: All hyperparameters are optional. Pass them at the root level, and not nested under hyperparameters. Their grouping here is for educational purposes only.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Portkey (Prisma AIRS AI Gateway) Docs","description":"Comprehensive documentation for AI Gateway, Guardrails, Observability, and Governance features.","colors":{"primary":"#0891B2","light":"#0891B2","dark":"#0891B2"},"logo":{"light":"https://mintcdn.com/portkey-docs/tHk-hgNjLbEj4dhh/images/portkey-PANW-company-logo-positive.png?fit=max\u0026auto=format\u0026n=tHk-hgNjLbEj4dhh\u0026q=85\u0026s=c5fb09014ff79616583b1d3bffe27450","dark":"https://mintcdn.com/portkey-docs/tHk-hgNjLbEj4dhh/images/portkey-PANW-company-logo-negative.png?fit=max\u0026auto=format\u0026n=tHk-hgNjLbEj4dhh\u0026q=85\u0026s=6025ca49ef544522f58ff471b7f75f8f"},"favicon":"https://mintcdn.com/portkey-docs/Hf1XgyjG_b79ym4Q/favicon.png?fit=max\u0026auto=format\u0026n=Hf1XgyjG_b79ym4Q\u0026q=85\u0026s=cbaa1bfc49bb6e3fd6cf499a5da313a3","api":{"openapi":"https://raw.githubusercontent.com/Portkey-AI/openapi/refs/heads/master/openapi.yaml","examples":{"prefill":true},"url":"full"},"navbar":{"links":[{"href":"https://portkey.ai/models","label":"Models"},{"href":"https://support.portkey.ai/forms/customer-portal-ticket-form","label":"Support"},{"href":"https://www.paloaltonetworks.in/ai-security/ai-gateway?utm_source=portkey\u0026utm_medium=referral\u0026utm_campaign=prisma_airs\u0026utm_content=docs_nav#contact","label":"Contact Us"}],"primary":{"type":"button","label":"Sign in","href":"https://stratacloudmanager.paloaltonetworks.com/"}},"footer":{"socials":{"x":"https://twitter.com/PortkeyAI","linkedin":"https://www.linkedin.com/company/portkey-ai","github":"https://git.new/portkey"},"links":[{"header":"For LLMs","items":[{"label":"llms.txt","href":"https://portkey.ai/docs/llms.txt"},{"label":"llms-full.txt","href":"https://portkey.ai/docs/llms-full.txt"}]},{"header":"Products","items":[{"label":"Observability","href":"https://portkey.ai/features/observability"},{"label":"AI Gateway","href":"https://portkey.ai/features/ai-gateway"},{"label":"Guardrails","href":"https://portkey.ai/features/guardrails"},{"label":"Prompt Management","href":"https://portkey.ai/features/prompt-management"},{"label":"Agents","href":"https://portkey.ai/features/agents"},{"label":"MCP Gateway","href":"https://portkey.ai/docs/product/mcp-gateway"},{"label":"Security","href":"https://portkey.ai/features/security-and-compliance"},{"label":"Auto-Instrumentation","href":"https://portkey.ai/features/auto-instrumentation"}]},{"header":"Resources","items":[{"label":"API Status","href":"https://status.portkey.ai/"},{"label":"Helm Charts","href":"https://github.com/portkey-ai/helm"},{"label":"AI Grants Finder","href":"https://grantsfinder.portkey.ai/"},{"label":"Events Calendar","href":"https://lu.ma/portkey"},{"label":"Blog","href":"https://portkey.ai/blog"},{"label":"Error Library","href":"https://portkey.ai/error-library"},{"label":"Models \u0026 Pricing","href":"https://portkey.ai/models"}]},{"header":"Company","items":[{"label":"Pricing","href":"https://portkey.ai/pricing"},{"label":"Compliances","href":"https://trust.portkey.ai/"},{"label":"Privacy Policy","href":"https://portkey.ai/privacy-policy"},{"label":"Terms of Service","href":"https://portkey.ai/terms"},{"label":"DPA","href":"https://portkey.ai/dpa"},{"label":"Cookie Policy","href":"https://portkey.ai/cookie-policy"}]}]},"seo":{"metatags":{"og:type":"website","og:site_name":"Portkey AI Gateway Docs"},"indexing":"navigable"},"styling":{"eyebrows":"breadcrumbs","codeblocks":"system","latex":true},"integrations":{"ga4":{"measurementId":"G-JJMXYE4DRL"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"toc"},"interaction":{"drilldown":true},"metadata":{"timestamp":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"portkey-docs","hasAudioNarration":false,"actualSubdomain":"portkey-docs","customDomains":["docs.portkey.ai","portkey.ai"],"gitSource":{"type":"github","owner":"portkey-ai","repo":"docs-core","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6aea1fd4382c567ac457aa17","collectionId":"0c4de925-cec6-446b-9681-011c6b4a9b91","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aea1fd4382c567ac457aa17"},"feedback":{"thumbs":true,"edits":true,"issues":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aea1fd4382c567ac457aa17","clientVersion":"0.0.4054","searchFilterCounts":[{"language":"default","tag":"Integrations","count":699},{"language":"default","tag":"Product","count":386},{"language":"default","tag":"Docs","count":324},{"language":"default","tag":"LLM Integrations","count":307},{"language":"default","tag":"Admin APIs","count":189},{"language":"default","tag":"More","count":176},{"language":"default","tag":"Guardrails","count":102},{"language":"default","tag":"Administration","count":102},{"language":"default","tag":"AI Gateway","count":99},{"language":"default","tag":"Admin API","count":95}],"searchSettings":{"isFiltersEnabled":true,"showContentSnippets":true}},"assistantConfig":{"enableAskAiButton":true,"enableStarterQuestions":true,"enableContextualStarterQuestions":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@portkey.ai","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#banner{background:linear-gradient(90deg,#0d1b2e 0,#1a1040 40%,#2d0f22 100%);border-bottom:1px solid rgba(255,255,255,.08)}#banner a{color:#f0f0f0;text-decoration:none;font-weight:600;border-bottom:1px solid rgba(240,240,240,.5);padding-bottom:1px;transition:border-color .2s ease}#banner a:hover{border-bottom-color:#fff}"}],"page":{"pagePath":"api-reference/inference-api/prompts/render","slug":"/api-reference/inference-api/prompts/render","pageMetadata":{"title":"Prompt Render","openapi":"post /prompts/{promptId}/render","description":"Renders a prompt template with its variable values filled in\n","href":"/api-reference/inference-api/prompts/render"},"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: \"Renders a prompt template with its variable values filled in\"\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`,em:`em`,hr:`hr`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{Accordion,Card,CodeBlock,CodeGroup,Note}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!Card)_missingMdxReference(`Card`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Given a prompt ID, variable values, and `,_jsx(_components.em,{children:`optionally`}),` any hyperparameters, this API returns a JSON object containing the `,_jsx(_components.strong,{children:`raw prompt template`}),`.`]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Note: Unlike inference requests, Prompt Render API calls are processed through Portkey’s Control Plane services.`})}),`\n`,_jsxs(Accordion,{icon:`lightbulb`,title:`Example: Using Prompt Render output in a new request`,id:`example-using-prompt-render-output-in-a-new-request`,children:[_jsxs(_components.p,{children:[`Here’s how you can take the output from the `,_jsx(_components.code,{children:`render API`}),` and use it for making a separate LLM call. We’ll take example of OpenAI SDKs, but you can use it simlarly for any other frameworks like Langchain etc. as well.`]}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`OpenAI Python`,numberOfLines:`31`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`31`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` portkey_ai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Portkey`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Retrieving the Prompt from Portkey`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`portkey `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Portkey(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"PORTKEY_API_KEY\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`render_response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` portkey.prompts.render(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` prompt_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"PROMPT_ID\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` variables`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"movie\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Dune 2\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`PROMPT_TEMPLATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` render_response.data`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Making a Call to OpenAI with the Retrieved Prompt`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"OPENAI_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.portkey.ai/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` default_headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-portkey-provider'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'openai'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-portkey-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'PORTKEY_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`chat_complete `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai.chat.completions.create(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`**`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`PROMPT_TEMPLATE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(chat_complete.choices[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].message.content)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`OpenAI NodeJS`,numberOfLines:`36`,language:`typescript`,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:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`36`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Portkey`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'portkey-ai'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'openai'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Retrieving the Prompt from Portkey`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` portkey`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Portkey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"PORTKEY_API_KEY\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` getPromptTemplate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` render_response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` portkey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`prompts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`render`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` promptID:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"PROMPT_ID\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` variables:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"movie\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Dune 2\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` render_response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Making a Call to OpenAI with the Retrieved Prompt`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` openai`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'OPENAI_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` baseURL:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.portkey.ai/v1'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` defaultHeaders:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-portkey-provider'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'openai'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-portkey-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'PORTKEY_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` main`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` PROMPT_TEMPLATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` getPromptTemplate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` chatCompletion`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` openai`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`PROMPT_TEMPLATE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chatCompletion`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choices`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`main`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})})]})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Card,{title:`Portkey is now PRISMA AIRS AI Gateway. See it in action.`,href:`https://www.paloaltonetworks.in/ai-security/ai-gateway?utm_source=portkey\u0026utm_medium=referral\u0026utm_campaign=prisma_airs\u0026utm_content=docs_nav#contact`,icon:`arrow-up-right-from-square`,children:_jsx(_components.p,{children:`Contact Us`})})]})}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":{"codeStyling":"system","config":{},"pageMetadata":{"title":"Prompt Render","openapi":"post /prompts/{promptId}/render","description":"Renders a prompt template with its variable values filled in\n","href":"/api-reference/inference-api/prompts/render"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"createPromptRender","tags":["Prompts"],"summary":"Prompts Render","description":"Renders a prompt template with its variable values filled in\n","parameters":["0e7d6bbe-7c1c-45e6-b323-5785ef69d969"],"requestBody":"b7b4cfd8-d675-4bb2-beb7-12a8b73b8417","responses":{"200":"ea29f9dc-ea40-4fe9-8985-3df8f70bc28e"},"x-code-samples":[{"lang":"cURL","label":"Default","source":"curl -X POST \"https://api.portkey.ai/v1/prompts/YOUR_PROMPT_ID/render\" \\\n -H \"Content-Type: application/json\" \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -d '{\n \"variables\": {\n \"user_input\": \"Hello world\"\n },\n \"max_completion_tokens\": 250,\n \"presence_penalty\": 0.2\n }'\n"},{"lang":"Python","label":"Default","source":"from portkey_ai import Portkey\n\nclient = Portkey(\n api_key=\"PORTKEY_API_KEY\"\n)\n\ncompletion = client.prompts.render(\n prompt_id=\"YOUR_PROMPT_ID\",\n variables={\n \"user_input\": \"Hello world\"\n },\n max_completion_tokens=250,\n presence_penalty=0.2\n)\n\nprint(completion)\n"},{"lang":"JavaScript","label":"Default","source":"import Portkey from 'portkey-ai';\n\nconst portkey = new Portkey({\n apiKey: 'PORTKEY_API_KEY'\n});\n\nconst completion = await portkey.prompts.render({\n promptId: \"YOUR_PROMPT_ID\",\n variables: {\n user_input: \"Hello world\"\n },\n max_completion_tokens: 250,\n presence_penalty: 0.2\n});\n\nconsole.log(completion);\n"},{"lang":"cURL","label":"Self-Hosted","source":"curl -X POST \"SELF_HOSTED_GATEWAY_URL/prompts/YOUR_PROMPT_ID/render\" \\\n -H \"Content-Type: application/json\" \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -d '{\n \"variables\": {\n \"user_input\": \"Hello world\"\n },\n \"max_completion_tokens\": 250,\n \"presence_penalty\": 0.2\n }'\n"},{"lang":"Python","label":"Self-Hosted","source":"from portkey_ai import Portkey\n\nclient = Portkey(\n api_key=\"PORTKEY_API_KEY\",\n base_url=\"SELF_HOSTED_GATEWAY_URL\"\n)\n\ncompletion = client.prompts.render(\n prompt_id=\"YOUR_PROMPT_ID\",\n variables={\n \"user_input\": \"Hello world\"\n },\n max_completion_tokens=250,\n presence_penalty=0.2\n)\n\nprint(completion)\n"},{"lang":"JavaScript","label":"Self-Hosted","source":"import Portkey from 'portkey-ai';\n\nconst portkey = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n baseUrl: 'SELF_HOSTED_GATEWAY_URL'\n});\n\nconst completion = await portkey.prompts.render({\n promptId: \"YOUR_PROMPT_ID\",\n variables: {\n user_input: \"Hello world\"\n },\n max_completion_tokens: 250,\n presence_penalty: 0.2\n});\n\nconsole.log(completion);\n"}],"method":"post","type":"path","servers":["6aad26ff-25ef-4ace-b16b-25b10ac7ddb9","5f296b6c-8f69-4c2b-b832-0bdffbdf42de"],"security":["a32f564e-fd72-4d2a-b003-4f8f62227a26"],"path":"/prompts/{promptId}/render","baseUrlOptions":["https://api.portkey.ai/v1","SELF_HOSTED_GATEWAY_URL"],"title":"Prompts Render","codeSamples":[{"label":"Default","lang":"cURL","source":"curl -X POST \"https://api.portkey.ai/v1/prompts/YOUR_PROMPT_ID/render\" \\\n -H \"Content-Type: application/json\" \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -d '{\n \"variables\": {\n \"user_input\": \"Hello world\"\n },\n \"max_completion_tokens\": 250,\n \"presence_penalty\": 0.2\n }'\n"},{"label":"Default","lang":"Python","source":"from portkey_ai import Portkey\n\nclient = Portkey(\n api_key=\"PORTKEY_API_KEY\"\n)\n\ncompletion = client.prompts.render(\n prompt_id=\"YOUR_PROMPT_ID\",\n variables={\n \"user_input\": \"Hello world\"\n },\n max_completion_tokens=250,\n presence_penalty=0.2\n)\n\nprint(completion)\n"},{"label":"Default","lang":"JavaScript","source":"import Portkey from 'portkey-ai';\n\nconst portkey = new Portkey({\n apiKey: 'PORTKEY_API_KEY'\n});\n\nconst completion = await portkey.prompts.render({\n promptId: \"YOUR_PROMPT_ID\",\n variables: {\n user_input: \"Hello world\"\n },\n max_completion_tokens: 250,\n presence_penalty: 0.2\n});\n\nconsole.log(completion);\n"},{"label":"Self-Hosted","lang":"cURL","source":"curl -X POST \"SELF_HOSTED_GATEWAY_URL/prompts/YOUR_PROMPT_ID/render\" \\\n -H \"Content-Type: application/json\" \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -d '{\n \"variables\": {\n \"user_input\": \"Hello world\"\n },\n \"max_completion_tokens\": 250,\n \"presence_penalty\": 0.2\n }'\n"},{"label":"Self-Hosted","lang":"Python","source":"from portkey_ai import Portkey\n\nclient = Portkey(\n api_key=\"PORTKEY_API_KEY\",\n base_url=\"SELF_HOSTED_GATEWAY_URL\"\n)\n\ncompletion = client.prompts.render(\n prompt_id=\"YOUR_PROMPT_ID\",\n variables={\n \"user_input\": \"Hello world\"\n },\n max_completion_tokens=250,\n presence_penalty=0.2\n)\n\nprint(completion)\n"},{"label":"Self-Hosted","lang":"JavaScript","source":"import Portkey from 'portkey-ai';\n\nconst portkey = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n baseUrl: 'SELF_HOSTED_GATEWAY_URL'\n});\n\nconst completion = await portkey.prompts.render({\n promptId: \"YOUR_PROMPT_ID\",\n variables: {\n user_input: \"Hello world\"\n },\n max_completion_tokens: 250,\n presence_penalty: 0.2\n});\n\nconsole.log(completion);\n"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.variables":{},"body.hyperparameters.oneOf.0.messages.items.0.oneOf.0.content":"\u003cstring>","body.hyperparameters.oneOf.0.messages.items.0.oneOf.0.role":"system","body.hyperparameters.oneOf.0.messages.items.0.oneOf.0.name":"\u003cstring>","body.hyperparameters.oneOf.0.model.oneOf.0":"gpt-5","body.hyperparameters.oneOf.0.frequency_penalty.oneOf.0":0,"body.hyperparameters.oneOf.0.logprobs.oneOf.0":false,"body.hyperparameters.oneOf.0.top_logprobs.oneOf.0":10,"body.hyperparameters.oneOf.0.max_tokens.oneOf.0":123,"body.hyperparameters.oneOf.0.max_completion_tokens.oneOf.0":123,"body.hyperparameters.oneOf.0.n.oneOf.0":1,"body.hyperparameters.oneOf.0.presence_penalty.oneOf.0":0,"body.hyperparameters.oneOf.0.response_format.oneOf.0.type":"text","body.hyperparameters.oneOf.0.seed.oneOf.0":0,"body.hyperparameters.oneOf.0.stop.oneOf.0":"\u003cstring>","body.hyperparameters.oneOf.0.stream.oneOf.0":false,"body.hyperparameters.oneOf.0.thinking.oneOf.0.type":"enabled","body.hyperparameters.oneOf.0.thinking.oneOf.0.budget_tokens":2030,"body.hyperparameters.oneOf.0.temperature.oneOf.0":1,"body.hyperparameters.oneOf.0.top_p.oneOf.0":1,"body.hyperparameters.oneOf.0.tools.items.0.type":"function","body.hyperparameters.oneOf.0.tools.items.0.function.name":"\u003cstring>","body.hyperparameters.oneOf.0.tools.items.0.function.description":"\u003cstring>","body.hyperparameters.oneOf.0.tools.items.0.function.parameters":{},"body.hyperparameters.oneOf.0.tools.items.0.function.strict.oneOf.0":false,"body.hyperparameters.oneOf.0.parallel_tool_calls":true,"body.hyperparameters.oneOf.0.user":"user-1234","body.hyperparameters.oneOf.0.functions.items.0.name":"\u003cstring>","body.hyperparameters.oneOf.0.functions.items.0.description":"\u003cstring>","body.hyperparameters.oneOf.0.functions.items.0.parameters":{}}],"urlDisplay":"full"},"dependencies":{"parameters":{"0e7d6bbe-7c1c-45e6-b323-5785ef69d969":{"in":"path","name":"promptId","required":true,"schema":{"type":"string","isRequired":true,"description":"The unique identifier of the prompt template to render","uniqueKey":"","typeLabel":"string"},"description":"The unique identifier of the prompt template to render"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Note: Although hyperparameters are shown grouped here (like messages, max_completion_tokens, temperature, etc.), they should only be passed at the root level, alongside 'variables' and 'stream'. The `max_tokens` parameter is deprecated — use `max_completion_tokens` instead.\n","required":["variables"],"properties":{"variables":{"type":"object","description":"Variables to substitute in the prompt template","isRequired":true,"uniqueKey":"variables","typeLabel":"object"},"hyperparameters":{"oneOf":[{"type":"object","title":"Chat Completions","description":"**Note**: All hyperparameters are optional. Pass them at the root level, and not nested under `hyperparameters`. Their grouping here is for educational purposes only.\n","required":["model","messages"],"properties":{"messages":{"description":"A list of messages comprising the conversation so far. [Example Python code](https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models).","type":"array","minItems":1,"items":{"oneOf":[{"type":"object","title":"System message","required":["content","role"],"x-oaiExpandable":true,"properties":{"content":{"description":"The contents of the system message.","type":"string","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.0.content","typeLabel":"string"},"role":{"type":"string","enum":["system"],"description":"The role of the messages author, in this case `system`.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.0.role","typeLabel":"enum\u003cstring>"},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.0.name","typeLabel":"string"}},"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.0","typeLabel":"System message · object"},{"type":"object","title":"Developer message","description":"New role by OpenAI for select models. Must be explicitly used for models that support it. When used with incompatible models or providers, Portkey automatically converts it to a system role.","required":["content","role"],"x-oaiExpandable":true,"properties":{"content":{"description":"The contents of the Developer message.","type":"string","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.1.content","typeLabel":"string"},"role":{"type":"string","enum":["developer"],"description":"The role of the messages author, in this case `Developer`.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.1.role","typeLabel":"enum\u003cstring>"},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.1.name","typeLabel":"string"}},"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.1","typeLabel":"Developer message · object"},{"type":"object","title":"User message","required":["content","role"],"x-oaiExpandable":true,"properties":{"content":{"oneOf":[{"type":"string","title":"Text content","description":"The contents of the user message.\n","x-oaiExpandable":true,"isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","title":"Text content part","required":["type","text"],"x-oaiExpandable":true,"properties":{"type":{"type":"string","enum":["text"],"description":"The type of the content part.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"},"text":{"type":"string","description":"The text content.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.0.text","typeLabel":"string"}},"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.0","typeLabel":"Text content part · object"},{"type":"object","title":"Image content part","required":["type","image_url"],"x-oaiExpandable":true,"properties":{"type":{"type":"string","enum":["image_url"],"description":"The type of the content part.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"image_url":{"type":"object","properties":{"url":{"type":"string","description":"Either a URL of the image or the base64 encoded image data.","format":"uri","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string\u003curi>"},"detail":{"type":"string","description":"Specifies the detail level of the image. Learn more in the [Vision guide](https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding).","enum":["auto","low","high"],"default":"auto","uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.1.image_url.detail","typeLabel":"enum\u003cstring>"}},"required":["url"],"isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.1.image_url","typeLabel":"object"}},"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.1","typeLabel":"Image content part · object"}],"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX]","typeLabel":"Text content part · object | Image content part · object"},"title":"Array of content parts","description":"The contents of the user message.\n","minItems":1,"x-oaiExpandable":true,"isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1","typeLabel":"(Text content part · object | Image content part · object)[]"}],"isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2.content","typeLabel":"string | (Text content part · object | Image content part · object)[]"},"role":{"type":"string","enum":["user"],"description":"The role of the messages author, in this case `user`.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2.role","typeLabel":"enum\u003cstring>"},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2.name","typeLabel":"string"}},"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.2","typeLabel":"User message · object"},{"type":"object","title":"Assistant message","required":["role"],"x-oaiExpandable":true,"properties":{"role":{"type":"string","enum":["assistant"],"description":"The role of the messages author, in this case `assistant`.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","description":"The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.\n","uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.\n","uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.content","typeLabel":"string | null"},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.name","typeLabel":"string"},"tool_calls":{"type":"array","description":"The tool calls generated by the model, such as function calls.","items":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the tool call.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.tool_calls.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","enum":["function"],"description":"The type of the tool. Currently, only `function` is supported.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.tool_calls.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"function":{"type":"object","description":"The function that the model called.","properties":{"name":{"type":"string","description":"The name of the function to call.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.tool_calls.items.[INDEX].function.name","typeLabel":"string"},"arguments":{"type":"string","description":"The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.tool_calls.items.[INDEX].function.arguments","typeLabel":"string"}},"required":["name","arguments"],"isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.tool_calls.items.[INDEX].function","typeLabel":"object"}},"required":["id","type","function"],"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.tool_calls.items.[INDEX]","typeLabel":"object"},"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.tool_calls","typeLabel":"object[]"},"function_call":{"oneOf":[{"type":"object","deprecated":true,"description":"Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.","properties":{"arguments":{"type":"string","description":"The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.function_call.oneOf.0.arguments","typeLabel":"string"},"name":{"type":"string","description":"The name of the function to call.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.function_call.oneOf.0.name","typeLabel":"string"}},"required":["arguments","name"],"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.function_call.oneOf.0","typeLabel":"object"},{"type":"null","deprecated":true,"description":"Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.","properties":{"arguments":{"type":"string","description":"The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function."},"name":{"type":"string","description":"The name of the function to call."}},"required":["arguments","name"],"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.function_call.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3.function_call","typeLabel":"object | null"}},"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.3","typeLabel":"Assistant message · object"},{"type":"object","title":"Tool message","required":["role","content","tool_call_id"],"x-oaiExpandable":true,"properties":{"role":{"type":"string","enum":["tool"],"description":"The role of the messages author, in this case `tool`.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.4.role","typeLabel":"enum\u003cstring>"},"content":{"type":"string","description":"The contents of the tool message.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.4.content","typeLabel":"string"},"tool_call_id":{"type":"string","description":"Tool call that this message is responding to.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.4.tool_call_id","typeLabel":"string"}},"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.4","typeLabel":"Tool message · object"},{"type":"object","title":"Function message","required":["role","content","name"],"deprecated":true,"x-oaiExpandable":true,"properties":{"role":{"type":"string","enum":["function"],"description":"The role of the messages author, in this case `function`.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.5.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","description":"The contents of the function message.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.5.content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The contents of the function message.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.5.content.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.5.content","typeLabel":"string | null"},"name":{"type":"string","description":"The name of the function to call.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.5.name","typeLabel":"string"}},"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX].oneOf.5","typeLabel":"Function message · object"}],"uniqueKey":"hyperparameters.oneOf.0.messages.items.[INDEX]","typeLabel":"System message · object | Developer message · object | User message · object | Assistant message · object | Tool message · object | Function message · object"},"isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.messages","typeLabel":"(System message · object | Developer message · object | User message · object | Assistant message · object | Tool message · object | Function message · object)[]"},"model":{"oneOf":[{"type":"string","description":"ID of the model to use. See the [model endpoint compatibility](https://platform.openai.com/docs/models/model-endpoint-compatibility) table for details on which models work with the Chat API.","x-oaiTypeLabel":"string","example":"gpt-5","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.model.oneOf.0","typeLabel":"string"},{"type":"string","description":"ID of the model to use. See the [model endpoint compatibility](https://platform.openai.com/docs/models/model-endpoint-compatibility) table for details on which models work with the Chat API.","enum":["gpt-5","gpt-5-mini","gpt-5-nano","o4-mini","o3","o3-mini","o1","o1-mini","gpt-4o","gpt-4o-mini","gpt-4o-2024-05-13","gpt-4-turbo","gpt-4-turbo-2024-04-09","gpt-4-0125-preview","gpt-4-turbo-preview","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4","gpt-4-0314","gpt-4-0613","gpt-4-32k","gpt-4-32k-0314","gpt-4-32k-0613","gpt-3.5-turbo","gpt-3.5-turbo-16k","gpt-3.5-turbo-0301","gpt-3.5-turbo-0613","gpt-3.5-turbo-1106","gpt-3.5-turbo-0125","gpt-3.5-turbo-16k-0613"],"x-oaiTypeLabel":"string","example":"gpt-5","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.model.oneOf.1","typeLabel":"enum\u003cstring>"}],"isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.model","typeLabel":"string | enum\u003cstring>"},"frequency_penalty":{"oneOf":[{"type":"number","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"hyperparameters.oneOf.0.frequency_penalty.oneOf.0","typeLabel":"number"},{"type":"null","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"hyperparameters.oneOf.0.frequency_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.frequency_penalty","typeLabel":"number | null"},"logit_bias":{"oneOf":[{"type":"object","x-oaiTypeLabel":"map","default":null,"additionalProperties":{"type":"integer","uniqueKey":"hyperparameters.oneOf.0.logit_bias.oneOf.0.additionalProperties","typeLabel":"integer"},"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) 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.\n","uniqueKey":"hyperparameters.oneOf.0.logit_bias.oneOf.0","typeLabel":"object"},{"type":"null","x-oaiTypeLabel":"map","default":null,"additionalProperties":{"type":"integer","uniqueKey":"hyperparameters.oneOf.0.logit_bias.oneOf.1.additionalProperties","typeLabel":"integer"},"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) 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.\n","uniqueKey":"hyperparameters.oneOf.0.logit_bias.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.logit_bias","typeLabel":"object | null"},"logprobs":{"oneOf":[{"description":"Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`.","type":"boolean","default":false,"uniqueKey":"hyperparameters.oneOf.0.logprobs.oneOf.0","typeLabel":"boolean"},{"description":"Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`.","type":"null","default":false,"uniqueKey":"hyperparameters.oneOf.0.logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.logprobs","typeLabel":"boolean | null"},"top_logprobs":{"oneOf":[{"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. `logprobs` must be set to `true` if this parameter is used.","type":"integer","minimum":0,"maximum":20,"uniqueKey":"hyperparameters.oneOf.0.top_logprobs.oneOf.0","typeLabel":"integer"},{"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. `logprobs` must be set to `true` if this parameter is used.","type":"null","minimum":0,"maximum":20,"uniqueKey":"hyperparameters.oneOf.0.top_logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.top_logprobs","typeLabel":"integer | null"},"max_tokens":{"oneOf":[{"description":"Deprecated in favor of `max_completion_tokens`.\n\nThe maximum number of [tokens](https://platform.openai.com/tokenizer?view=bpe) that can be generated in the chat completion. This value can be used to control [costs](https://openai.com/api/pricing/) for text generated via API.\n\n**Supported models:** GPT-4o, GPT-4o-mini, GPT-4, GPT-4 Turbo, GPT-3.5 Turbo.\n\n**Not supported:** o-series reasoning models (o1, o3, o3-mini, o4-mini) and GPT-5 series — use `max_completion_tokens` instead.\n","type":"integer","deprecated":true,"uniqueKey":"hyperparameters.oneOf.0.max_tokens.oneOf.0","typeLabel":"integer"},{"description":"Deprecated in favor of `max_completion_tokens`.\n\nThe maximum number of [tokens](https://platform.openai.com/tokenizer?view=bpe) that can be generated in the chat completion. This value can be used to control [costs](https://openai.com/api/pricing/) for text generated via API.\n\n**Supported models:** GPT-4o, GPT-4o-mini, GPT-4, GPT-4 Turbo, GPT-3.5 Turbo.\n\n**Not supported:** o-series reasoning models (o1, o3, o3-mini, o4-mini) and GPT-5 series — use `max_completion_tokens` instead.\n","type":"null","deprecated":true,"uniqueKey":"hyperparameters.oneOf.0.max_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.max_tokens","typeLabel":"integer | null"},"max_completion_tokens":{"oneOf":[{"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).\n\n**Supported models:** GPT-5 series, o-series reasoning models (o1, o3, o3-mini, o4-mini) — required. Also supported on GPT-4o, GPT-4o-mini, GPT-4, GPT-4 Turbo, GPT-3.5 Turbo as a replacement for `max_tokens`.\n","type":"integer","uniqueKey":"hyperparameters.oneOf.0.max_completion_tokens.oneOf.0","typeLabel":"integer"},{"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).\n\n**Supported models:** GPT-5 series, o-series reasoning models (o1, o3, o3-mini, o4-mini) — required. Also supported on GPT-4o, GPT-4o-mini, GPT-4, GPT-4 Turbo, GPT-3.5 Turbo as a replacement for `max_tokens`.\n","type":"null","uniqueKey":"hyperparameters.oneOf.0.max_completion_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.max_completion_tokens","typeLabel":"integer | null"},"n":{"oneOf":[{"type":"integer","minimum":1,"maximum":128,"default":1,"example":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.","uniqueKey":"hyperparameters.oneOf.0.n.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":1,"maximum":128,"default":1,"example":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.","uniqueKey":"hyperparameters.oneOf.0.n.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.n","typeLabel":"integer | null"},"presence_penalty":{"oneOf":[{"type":"number","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"hyperparameters.oneOf.0.presence_penalty.oneOf.0","typeLabel":"number"},{"type":"null","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"hyperparameters.oneOf.0.presence_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.presence_penalty","typeLabel":"number | null"},"response_format":{"oneOf":[{"type":"object","title":"Text","description":"Default response format. Used to generate text responses.\n","required":["type"],"properties":{"type":{"type":"string","description":"The type of response format being defined. Always `text`.","enum":["text"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.response_format.oneOf.0.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"hyperparameters.oneOf.0.response_format.oneOf.0","typeLabel":"Text · object"},{"type":"object","title":"JSON schema","description":"JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).\n","required":["type","json_schema"],"properties":{"type":{"type":"string","description":"The type of response format being defined. Always `json_schema`.","enum":["json_schema"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.response_format.oneOf.1.type","typeLabel":"enum\u003cstring>"},"json_schema":{"type":"object","title":"JSON schema","description":"Structured Outputs configuration options, including a JSON Schema.\n","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.response_format.oneOf.1.json_schema.name","typeLabel":"string"},"description":{"type":"string","description":"A description of what the response format is for, used by the model to\ndetermine how to respond in the format.\n","uniqueKey":"hyperparameters.oneOf.0.response_format.oneOf.1.json_schema.description","typeLabel":"string"},"schema":{"type":"object","title":"JSON schema","description":"The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n","additionalProperties":true,"uniqueKey":"hyperparameters.oneOf.0.response_format.oneOf.1.json_schema.schema","typeLabel":"JSON schema · object"},"strict":{"oneOf":[{"type":"boolean","default":false,"description":"Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n","uniqueKey":"hyperparameters.oneOf.0.response_format.oneOf.1.json_schema.strict.oneOf.0","typeLabel":"boolean"},{"type":"null","default":false,"description":"Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n","uniqueKey":"hyperparameters.oneOf.0.response_format.oneOf.1.json_schema.strict.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.response_format.oneOf.1.json_schema.strict","typeLabel":"boolean | null"}},"required":["name"],"isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.response_format.oneOf.1.json_schema","typeLabel":"JSON schema · object"}},"uniqueKey":"hyperparameters.oneOf.0.response_format.oneOf.1","typeLabel":"JSON schema · object"},{"type":"object","title":"JSON object","description":"JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.\n","required":["type"],"properties":{"type":{"type":"string","description":"The type of response format being defined. Always `json_object`.","enum":["json_object"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.response_format.oneOf.2.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"hyperparameters.oneOf.0.response_format.oneOf.2","typeLabel":"JSON object · object"}],"uniqueKey":"hyperparameters.oneOf.0.response_format","typeLabel":"Text · object | JSON schema · object | JSON object · object"},"seed":{"oneOf":[{"type":"integer","minimum":-9223372036854776000,"maximum":9223372036854776000,"description":"This feature is in Beta.\nIf specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.\n","x-code-samples":{"beta":true},"uniqueKey":"hyperparameters.oneOf.0.seed.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":-9223372036854776000,"maximum":9223372036854776000,"description":"This feature is in Beta.\nIf specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.\n","x-code-samples":{"beta":true},"uniqueKey":"hyperparameters.oneOf.0.seed.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.seed","typeLabel":"integer | null"},"stop":{"oneOf":[{"type":"string","description":"Up to 4 sequences where the API will stop generating further tokens.\n","uniqueKey":"hyperparameters.oneOf.0.stop.oneOf.0","typeLabel":"string"},{"type":"null","description":"Up to 4 sequences where the API will stop generating further tokens.\n","uniqueKey":"hyperparameters.oneOf.0.stop.oneOf.1","typeLabel":"null"},{"type":"array","items":{"type":"string","uniqueKey":"hyperparameters.oneOf.0.stop.oneOf.2.items.[INDEX]","typeLabel":"string"},"description":"Up to 4 sequences where the API will stop generating further tokens.\n","maxItems":4,"minItems":1,"uniqueKey":"hyperparameters.oneOf.0.stop.oneOf.2","typeLabel":"string[]"}],"uniqueKey":"hyperparameters.oneOf.0.stop","typeLabel":"string | null | string[]"},"stream":{"oneOf":[{"description":"If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-UShttps://platform.openai.com/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).\n","type":"boolean","default":false,"uniqueKey":"hyperparameters.oneOf.0.stream.oneOf.0","typeLabel":"boolean"},{"description":"If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-UShttps://platform.openai.com/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).\n","type":"null","default":false,"uniqueKey":"hyperparameters.oneOf.0.stream.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.stream","typeLabel":"boolean | null"},"stream_options":{"oneOf":[{"description":"Options for streaming response. Only set this when you set `stream: true`.\n","type":"object","default":null,"properties":{"include_usage":{"type":"boolean","description":"If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.\n","uniqueKey":"hyperparameters.oneOf.0.stream_options.oneOf.0.include_usage","typeLabel":"boolean"}},"uniqueKey":"hyperparameters.oneOf.0.stream_options.oneOf.0","typeLabel":"object"},{"description":"Options for streaming response. Only set this when you set `stream: true`.\n","type":"null","default":null,"properties":{"include_usage":{"type":"boolean","description":"If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.\n"}},"uniqueKey":"hyperparameters.oneOf.0.stream_options.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.stream_options","typeLabel":"object | null"},"thinking":{"oneOf":[{"type":"object","description":"View the thinking/reasoning tokens as part of your response. Thinking models produce a long internal chain of thought before generating a response. Supported only for specific Claude models on Anthropic, Google Vertex AI, and AWS Bedrock. Requires setting `strict_openai_compliance = false` in your API call.\n","properties":{"type":{"type":"string","enum":["enabled","disabled"],"description":"Enables or disables the thinking mode capability.","default":"disabled","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.thinking.oneOf.0.type","typeLabel":"enum\u003cstring>"},"budget_tokens":{"type":"integer","description":"The maximum number of tokens to allocate for the thinking process.\nA higher token budget allows for more thorough reasoning but may increase overall response time.\n","minimum":1,"example":2030,"uniqueKey":"hyperparameters.oneOf.0.thinking.oneOf.0.budget_tokens","typeLabel":"integer"}},"required":["type"],"example":{"type":"enabled","budget_tokens":2030},"uniqueKey":"hyperparameters.oneOf.0.thinking.oneOf.0","typeLabel":"object"},{"type":"null","description":"View the thinking/reasoning tokens as part of your response. Thinking models produce a long internal chain of thought before generating a response. Supported only for specific Claude models on Anthropic, Google Vertex AI, and AWS Bedrock. Requires setting `strict_openai_compliance = false` in your API call.\n","properties":{"type":{"type":"string","enum":["enabled","disabled"],"description":"Enables or disables the thinking mode capability.","default":"disabled"},"budget_tokens":{"type":"integer","description":"The maximum number of tokens to allocate for the thinking process.\nA higher token budget allows for more thorough reasoning but may increase overall response time.\n","minimum":1,"example":2030}},"required":["type"],"example":{"type":"enabled","budget_tokens":2030},"uniqueKey":"hyperparameters.oneOf.0.thinking.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.thinking","typeLabel":"object | null"},"temperature":{"oneOf":[{"type":"number","minimum":0,"maximum":2,"default":1,"example":1,"description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\n\nWe generally recommend altering this or `top_p` but not both.\n","uniqueKey":"hyperparameters.oneOf.0.temperature.oneOf.0","typeLabel":"number"},{"type":"null","minimum":0,"maximum":2,"default":1,"example":1,"description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\n\nWe generally recommend altering this or `top_p` but not both.\n","uniqueKey":"hyperparameters.oneOf.0.temperature.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.temperature","typeLabel":"number | null"},"top_p":{"oneOf":[{"type":"number","minimum":0,"maximum":1,"default":1,"example":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or `temperature` but not both.\n","uniqueKey":"hyperparameters.oneOf.0.top_p.oneOf.0","typeLabel":"number"},{"type":"null","minimum":0,"maximum":1,"default":1,"example":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or `temperature` but not both.\n","uniqueKey":"hyperparameters.oneOf.0.top_p.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.top_p","typeLabel":"number | null"},"tools":{"type":"array","description":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.\n","items":{"type":"object","properties":{"type":{"type":"string","enum":["function"],"description":"The type of the tool. Currently, only `function` is supported.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.tools.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"function":{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.tools.items.[INDEX].function.name","typeLabel":"string"},"description":{"type":"string","description":"A description of what the function does, used by the model to choose when and how to call the function.","uniqueKey":"hyperparameters.oneOf.0.tools.items.[INDEX].function.description","typeLabel":"string"},"parameters":{"type":"object","description":"The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.","additionalProperties":true,"uniqueKey":"hyperparameters.oneOf.0.tools.items.[INDEX].function.parameters","typeLabel":"object"},"strict":{"oneOf":[{"type":"boolean","default":false,"description":"Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).","uniqueKey":"hyperparameters.oneOf.0.tools.items.[INDEX].function.strict.oneOf.0","typeLabel":"boolean"},{"type":"null","default":false,"description":"Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).","uniqueKey":"hyperparameters.oneOf.0.tools.items.[INDEX].function.strict.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.0.tools.items.[INDEX].function.strict","typeLabel":"boolean | null"}},"required":["name"],"isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.tools.items.[INDEX].function","typeLabel":"object"}},"required":["type","function"],"uniqueKey":"hyperparameters.oneOf.0.tools.items.[INDEX]","typeLabel":"object"},"uniqueKey":"hyperparameters.oneOf.0.tools","typeLabel":"object[]"},"tool_choice":{"oneOf":[{"type":"string","description":"Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools.\nSpecifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n\n`none` is the default when no tools are present. `auto` is the default if tools are present.\n","enum":["none","auto","required"],"x-oaiExpandable":true,"uniqueKey":"hyperparameters.oneOf.0.tool_choice.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"object","description":"Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools.\nSpecifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n\n`none` is the default when no tools are present. `auto` is the default if tools are present.\n","required":["type","function"],"x-oaiExpandable":true,"properties":{"type":{"type":"string","enum":["function"],"description":"The type of the tool. Currently, only `function` is supported.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.tool_choice.oneOf.1.type","typeLabel":"enum\u003cstring>"},"function":{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.tool_choice.oneOf.1.function.name","typeLabel":"string"}},"required":["name"],"isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.tool_choice.oneOf.1.function","typeLabel":"object"}},"uniqueKey":"hyperparameters.oneOf.0.tool_choice.oneOf.1","typeLabel":"object"}],"uniqueKey":"hyperparameters.oneOf.0.tool_choice","typeLabel":"enum\u003cstring> | object"},"parallel_tool_calls":{"description":"Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling) during tool use.","type":"boolean","default":true,"uniqueKey":"hyperparameters.oneOf.0.parallel_tool_calls","typeLabel":"boolean"},"user":{"type":"string","example":"user-1234","description":"A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).\n","uniqueKey":"hyperparameters.oneOf.0.user","typeLabel":"string"},"function_call":{"oneOf":[{"type":"string","description":"Deprecated in favor of `tool_choice`.\n\nControls which (if any) function is called by the model.\n`none` means the model will not call a function and instead generates a message.\n`auto` means the model can pick between generating a message or calling a function.\nSpecifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.\n\n`none` is the default when no functions are present. `auto` is the default if functions are present.\n","enum":["none","auto"],"deprecated":true,"x-oaiExpandable":true,"uniqueKey":"hyperparameters.oneOf.0.function_call.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"object","description":"Deprecated in favor of `tool_choice`.\n\nControls which (if any) function is called by the model.\n`none` means the model will not call a function and instead generates a message.\n`auto` means the model can pick between generating a message or calling a function.\nSpecifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.\n\n`none` is the default when no functions are present. `auto` is the default if functions are present.\n","required":["name"],"deprecated":true,"x-oaiExpandable":true,"properties":{"name":{"type":"string","description":"The name of the function to call.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.function_call.oneOf.1.name","typeLabel":"string"}},"uniqueKey":"hyperparameters.oneOf.0.function_call.oneOf.1","typeLabel":"object"}],"uniqueKey":"hyperparameters.oneOf.0.function_call","typeLabel":"enum\u003cstring> | object"},"functions":{"deprecated":true,"description":"Deprecated in favor of `tools`.\n\nA list of functions the model may generate JSON inputs for.\n","type":"array","minItems":1,"maxItems":128,"items":{"type":"object","deprecated":true,"properties":{"name":{"type":"string","description":"The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.0.functions.items.[INDEX].name","typeLabel":"string"},"description":{"type":"string","description":"A description of what the function does, used by the model to choose when and how to call the function.","uniqueKey":"hyperparameters.oneOf.0.functions.items.[INDEX].description","typeLabel":"string"},"parameters":{"type":"object","description":"The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.","additionalProperties":true,"uniqueKey":"hyperparameters.oneOf.0.functions.items.[INDEX].parameters","typeLabel":"object"}},"required":["name"],"uniqueKey":"hyperparameters.oneOf.0.functions.items.[INDEX]","typeLabel":"object"},"uniqueKey":"hyperparameters.oneOf.0.functions","typeLabel":"object[]"}},"uniqueKey":"hyperparameters.oneOf.0","typeLabel":"Chat Completions · object"},{"type":"object","title":"Completions","description":"**Note**: All hyperparameters are optional. Pass them at the root level, and not nested under `hyperparameters`. Their grouping here is for educational purposes only.\n","required":["model","prompt"],"properties":{"model":{"oneOf":[{"type":"string","description":"ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models/overview) for descriptions of them.\n","x-oaiTypeLabel":"string","isRequired":true,"uniqueKey":"hyperparameters.oneOf.1.model.oneOf.0","typeLabel":"string"},{"type":"string","description":"ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models/overview) for descriptions of them.\n","enum":["gpt-3.5-turbo-instruct","davinci-002","babbage-002"],"x-oaiTypeLabel":"string","isRequired":true,"uniqueKey":"hyperparameters.oneOf.1.model.oneOf.1","typeLabel":"enum\u003cstring>"}],"isRequired":true,"uniqueKey":"hyperparameters.oneOf.1.model","typeLabel":"string | enum\u003cstring>"},"prompt":{"oneOf":[{"type":"string","description":"The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.\n\nNote that \u003c|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.\n","default":"\u003c|endoftext|>","example":"This is a test.","isRequired":true,"uniqueKey":"hyperparameters.oneOf.1.prompt.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","default":"","example":"This is a test.","uniqueKey":"hyperparameters.oneOf.1.prompt.oneOf.1.items.[INDEX]","typeLabel":"string"},"description":"The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.\n\nNote that \u003c|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.\n","default":"\u003c|endoftext|>","isRequired":true,"uniqueKey":"hyperparameters.oneOf.1.prompt.oneOf.1","typeLabel":"string[]"},{"type":"array","items":{"type":"integer","uniqueKey":"hyperparameters.oneOf.1.prompt.oneOf.2.items.[INDEX]","typeLabel":"integer"},"description":"The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.\n\nNote that \u003c|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.\n","default":"\u003c|endoftext|>","minItems":1,"example":"[1212, 318, 257, 1332, 13]","isRequired":true,"uniqueKey":"hyperparameters.oneOf.1.prompt.oneOf.2","typeLabel":"integer[]"},{"type":"array","items":{"type":"array","minItems":1,"items":{"type":"integer","uniqueKey":"hyperparameters.oneOf.1.prompt.oneOf.3.items.[INDEX].items.[INDEX]","typeLabel":"integer"},"uniqueKey":"hyperparameters.oneOf.1.prompt.oneOf.3.items.[INDEX]","typeLabel":"integer[]"},"description":"The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.\n\nNote that \u003c|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.\n","default":"\u003c|endoftext|>","minItems":1,"example":"[[1212, 318, 257, 1332, 13]]","isRequired":true,"uniqueKey":"hyperparameters.oneOf.1.prompt.oneOf.3","typeLabel":"integer[][]"},{"type":"null","isRequired":true,"uniqueKey":"hyperparameters.oneOf.1.prompt.oneOf.4","typeLabel":"null"}],"isRequired":true,"uniqueKey":"hyperparameters.oneOf.1.prompt","typeLabel":"string | string[] | integer[] | integer[][] | null"},"best_of":{"oneOf":[{"type":"integer","default":1,"minimum":0,"maximum":20,"description":"Generates `best_of` completions server-side and returns the \"best\" (the one with the highest log probability per token). Results cannot be streamed.\n\nWhen used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`.\n\n**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.\n","uniqueKey":"hyperparameters.oneOf.1.best_of.oneOf.0","typeLabel":"integer"},{"type":"null","default":1,"minimum":0,"maximum":20,"description":"Generates `best_of` completions server-side and returns the \"best\" (the one with the highest log probability per token). Results cannot be streamed.\n\nWhen used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`.\n\n**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.\n","uniqueKey":"hyperparameters.oneOf.1.best_of.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.best_of","typeLabel":"integer | null"},"echo":{"oneOf":[{"type":"boolean","default":false,"description":"Echo back the prompt in addition to the completion\n","uniqueKey":"hyperparameters.oneOf.1.echo.oneOf.0","typeLabel":"boolean"},{"type":"null","default":false,"description":"Echo back the prompt in addition to the completion\n","uniqueKey":"hyperparameters.oneOf.1.echo.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.echo","typeLabel":"boolean | null"},"frequency_penalty":{"oneOf":[{"type":"number","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"hyperparameters.oneOf.1.frequency_penalty.oneOf.0","typeLabel":"number"},{"type":"null","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"hyperparameters.oneOf.1.frequency_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.frequency_penalty","typeLabel":"number | null"},"logit_bias":{"oneOf":[{"type":"object","x-oaiTypeLabel":"map","default":null,"additionalProperties":{"type":"integer","uniqueKey":"hyperparameters.oneOf.1.logit_bias.oneOf.0.additionalProperties","typeLabel":"integer"},"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 GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](https://platform.openai.com/tokenizer?view=bpe) to convert text to token IDs. 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.\n\nAs an example, you can pass `{\"50256\": -100}` to prevent the \u003c|endoftext|> token from being generated.\n","uniqueKey":"hyperparameters.oneOf.1.logit_bias.oneOf.0","typeLabel":"object"},{"type":"null","x-oaiTypeLabel":"map","default":null,"additionalProperties":{"type":"integer","uniqueKey":"hyperparameters.oneOf.1.logit_bias.oneOf.1.additionalProperties","typeLabel":"integer"},"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 GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](https://platform.openai.com/tokenizer?view=bpe) to convert text to token IDs. 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.\n\nAs an example, you can pass `{\"50256\": -100}` to prevent the \u003c|endoftext|> token from being generated.\n","uniqueKey":"hyperparameters.oneOf.1.logit_bias.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.logit_bias","typeLabel":"object | null"},"logprobs":{"oneOf":[{"type":"integer","minimum":0,"maximum":5,"default":null,"description":"Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response.\n\nThe maximum value for `logprobs` is 5.\n","uniqueKey":"hyperparameters.oneOf.1.logprobs.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":0,"maximum":5,"default":null,"description":"Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response.\n\nThe maximum value for `logprobs` is 5.\n","uniqueKey":"hyperparameters.oneOf.1.logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.logprobs","typeLabel":"integer | null"},"max_tokens":{"oneOf":[{"type":"integer","minimum":0,"default":16,"example":16,"description":"The maximum number of [tokens](https://platform.openai.com/tokenizer?view=bpe) that can be generated in the completion.\n\nThe token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.\n","uniqueKey":"hyperparameters.oneOf.1.max_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":0,"default":16,"example":16,"description":"The maximum number of [tokens](https://platform.openai.com/tokenizer?view=bpe) that can be generated in the completion.\n\nThe token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.\n","uniqueKey":"hyperparameters.oneOf.1.max_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.max_tokens","typeLabel":"integer | null"},"n":{"oneOf":[{"type":"integer","minimum":1,"maximum":128,"default":1,"example":1,"description":"How many completions to generate for each prompt.\n\n**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.\n","uniqueKey":"hyperparameters.oneOf.1.n.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":1,"maximum":128,"default":1,"example":1,"description":"How many completions to generate for each prompt.\n\n**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.\n","uniqueKey":"hyperparameters.oneOf.1.n.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.n","typeLabel":"integer | null"},"presence_penalty":{"oneOf":[{"type":"number","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"hyperparameters.oneOf.1.presence_penalty.oneOf.0","typeLabel":"number"},{"type":"null","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"hyperparameters.oneOf.1.presence_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.presence_penalty","typeLabel":"number | null"},"seed":{"oneOf":[{"type":"integer","minimum":-9223372036854776000,"maximum":9223372036854776000,"description":"If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\n\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.\n","uniqueKey":"hyperparameters.oneOf.1.seed.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":-9223372036854776000,"maximum":9223372036854776000,"description":"If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\n\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.\n","uniqueKey":"hyperparameters.oneOf.1.seed.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.seed","typeLabel":"integer | null"},"stop":{"oneOf":[{"type":"string","description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.\n","default":"\u003c|endoftext|>","example":"\n","uniqueKey":"hyperparameters.oneOf.1.stop.oneOf.0","typeLabel":"string"},{"type":"null","description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.\n","default":"\u003c|endoftext|>","example":"\n","uniqueKey":"hyperparameters.oneOf.1.stop.oneOf.1","typeLabel":"null"},{"type":"array","items":{"type":"string","example":"[\"\\n\"]","uniqueKey":"hyperparameters.oneOf.1.stop.oneOf.2.items.[INDEX]","typeLabel":"string"},"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.\n","maxItems":4,"minItems":1,"uniqueKey":"hyperparameters.oneOf.1.stop.oneOf.2","typeLabel":"string[]"},{"type":"null","uniqueKey":"hyperparameters.oneOf.1.stop.oneOf.3","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.stop","typeLabel":"string · null · string[] · null"},"stream":{"oneOf":[{"description":"Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-UShttps://platform.openai.com/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).\n","type":"boolean","default":false,"uniqueKey":"hyperparameters.oneOf.1.stream.oneOf.0","typeLabel":"boolean"},{"description":"Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-UShttps://platform.openai.com/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).\n","type":"null","default":false,"uniqueKey":"hyperparameters.oneOf.1.stream.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.stream","typeLabel":"boolean | null"},"stream_options":{"oneOf":[{"description":"Options for streaming response. Only set this when you set `stream: true`.\n","type":"object","default":null,"properties":{"include_usage":{"type":"boolean","description":"If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.\n","uniqueKey":"hyperparameters.oneOf.1.stream_options.oneOf.0.include_usage","typeLabel":"boolean"}},"uniqueKey":"hyperparameters.oneOf.1.stream_options.oneOf.0","typeLabel":"object"},{"description":"Options for streaming response. Only set this when you set `stream: true`.\n","type":"null","default":null,"properties":{"include_usage":{"type":"boolean","description":"If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.\n"}},"uniqueKey":"hyperparameters.oneOf.1.stream_options.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.stream_options","typeLabel":"object | null"},"suffix":{"oneOf":[{"description":"The suffix that comes after a completion of inserted text.\n\nThis parameter is only supported for `gpt-3.5-turbo-instruct`.\n","default":null,"type":"string","example":"test.","uniqueKey":"hyperparameters.oneOf.1.suffix.oneOf.0","typeLabel":"string"},{"description":"The suffix that comes after a completion of inserted text.\n\nThis parameter is only supported for `gpt-3.5-turbo-instruct`.\n","default":null,"type":"null","example":"test.","uniqueKey":"hyperparameters.oneOf.1.suffix.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.suffix","typeLabel":"string | null"},"temperature":{"oneOf":[{"type":"number","minimum":0,"maximum":2,"default":1,"example":1,"description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\n\nWe generally recommend altering this or `top_p` but not both.\n","uniqueKey":"hyperparameters.oneOf.1.temperature.oneOf.0","typeLabel":"number"},{"type":"null","minimum":0,"maximum":2,"default":1,"example":1,"description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\n\nWe generally recommend altering this or `top_p` but not both.\n","uniqueKey":"hyperparameters.oneOf.1.temperature.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.temperature","typeLabel":"number | null"},"top_p":{"oneOf":[{"type":"number","minimum":0,"maximum":1,"default":1,"example":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or `temperature` but not both.\n","uniqueKey":"hyperparameters.oneOf.1.top_p.oneOf.0","typeLabel":"number"},{"type":"null","minimum":0,"maximum":1,"default":1,"example":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or `temperature` but not both.\n","uniqueKey":"hyperparameters.oneOf.1.top_p.oneOf.1","typeLabel":"null"}],"uniqueKey":"hyperparameters.oneOf.1.top_p","typeLabel":"number | null"},"user":{"type":"string","example":"user-1234","description":"A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).\n","uniqueKey":"hyperparameters.oneOf.1.user","typeLabel":"string"}},"uniqueKey":"hyperparameters.oneOf.1","typeLabel":"Completions · object"}],"uniqueKey":"hyperparameters","typeLabel":"Chat Completions · object | Completions · object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"variables":{},"hyperparameters":{"messages":[{"content":"\u003cstring>","role":"system","name":"\u003cstring>"}],"model":"gpt-5","frequency_penalty":0,"logit_bias":null,"logprobs":false,"top_logprobs":10,"max_tokens":123,"max_completion_tokens":123,"n":1,"presence_penalty":0,"response_format":{"type":"text"},"seed":0,"stop":"\u003cstring>","stream":false,"stream_options":null,"thinking":{"type":"enabled","budget_tokens":2030},"temperature":1,"top_p":1,"tools":[{"type":"function","function":{"name":"\u003cstring>","description":"\u003cstring>","parameters":{},"strict":false}}],"parallel_tool_calls":true,"user":"user-1234","functions":[{"name":"\u003cstring>","description":"\u003cstring>","parameters":{}}]}}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"ea29f9dc-ea40-4fe9-8985-3df8f70bc28e":{"description":"Successful rendered prompt","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","description":"Indicates if the render was successful","isRequired":true,"uniqueKey":"success","typeLabel":"boolean"},"data":{"oneOf":[{"type":"object","title":"Chat Completions","required":["model","messages"],"properties":{"messages":{"description":"A list of messages comprising the conversation so far. [Example Python code](https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models).","type":"array","minItems":1,"items":{"oneOf":[{"type":"object","title":"System message","required":["content","role"],"x-oaiExpandable":true,"properties":{"content":{"description":"The contents of the system message.","type":"string","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.0.content","typeLabel":"string"},"role":{"type":"string","enum":["system"],"description":"The role of the messages author, in this case `system`.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.0.role","typeLabel":"enum\u003cstring>"},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.0.name","typeLabel":"string"}},"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.0","typeLabel":"System message · object"},{"type":"object","title":"Developer message","description":"New role by OpenAI for select models. Must be explicitly used for models that support it. When used with incompatible models or providers, Portkey automatically converts it to a system role.","required":["content","role"],"x-oaiExpandable":true,"properties":{"content":{"description":"The contents of the Developer message.","type":"string","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.1.content","typeLabel":"string"},"role":{"type":"string","enum":["developer"],"description":"The role of the messages author, in this case `Developer`.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.1.role","typeLabel":"enum\u003cstring>"},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.1.name","typeLabel":"string"}},"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.1","typeLabel":"Developer message · object"},{"type":"object","title":"User message","required":["content","role"],"x-oaiExpandable":true,"properties":{"content":{"oneOf":[{"type":"string","title":"Text content","description":"The contents of the user message.\n","x-oaiExpandable":true,"isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","title":"Text content part","required":["type","text"],"x-oaiExpandable":true,"properties":{"type":{"type":"string","enum":["text"],"description":"The type of the content part.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"},"text":{"type":"string","description":"The text content.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.0.text","typeLabel":"string"}},"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.0","typeLabel":"Text content part · object"},{"type":"object","title":"Image content part","required":["type","image_url"],"x-oaiExpandable":true,"properties":{"type":{"type":"string","enum":["image_url"],"description":"The type of the content part.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"image_url":{"type":"object","properties":{"url":{"type":"string","description":"Either a URL of the image or the base64 encoded image data.","format":"uri","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string\u003curi>"},"detail":{"type":"string","description":"Specifies the detail level of the image. Learn more in the [Vision guide](https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding).","enum":["auto","low","high"],"default":"auto","uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.1.image_url.detail","typeLabel":"enum\u003cstring>"}},"required":["url"],"isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.1.image_url","typeLabel":"object"}},"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.1","typeLabel":"Image content part · object"}],"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX]","typeLabel":"Text content part · object | Image content part · object"},"title":"Array of content parts","description":"The contents of the user message.\n","minItems":1,"x-oaiExpandable":true,"isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2.content.oneOf.1","typeLabel":"(Text content part · object | Image content part · object)[]"}],"isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2.content","typeLabel":"string | (Text content part · object | Image content part · object)[]"},"role":{"type":"string","enum":["user"],"description":"The role of the messages author, in this case `user`.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2.role","typeLabel":"enum\u003cstring>"},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2.name","typeLabel":"string"}},"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.2","typeLabel":"User message · object"},{"type":"object","title":"Assistant message","required":["role"],"x-oaiExpandable":true,"properties":{"role":{"type":"string","enum":["assistant"],"description":"The role of the messages author, in this case `assistant`.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","description":"The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.\n","uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.\n","uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.content","typeLabel":"string | null"},"name":{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.name","typeLabel":"string"},"tool_calls":{"type":"array","description":"The tool calls generated by the model, such as function calls.","items":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the tool call.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.tool_calls.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","enum":["function"],"description":"The type of the tool. Currently, only `function` is supported.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.tool_calls.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"function":{"type":"object","description":"The function that the model called.","properties":{"name":{"type":"string","description":"The name of the function to call.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.tool_calls.items.[INDEX].function.name","typeLabel":"string"},"arguments":{"type":"string","description":"The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.tool_calls.items.[INDEX].function.arguments","typeLabel":"string"}},"required":["name","arguments"],"isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.tool_calls.items.[INDEX].function","typeLabel":"object"}},"required":["id","type","function"],"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.tool_calls.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.tool_calls","typeLabel":"object[]"},"function_call":{"oneOf":[{"type":"object","deprecated":true,"description":"Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.","properties":{"arguments":{"type":"string","description":"The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.function_call.oneOf.0.arguments","typeLabel":"string"},"name":{"type":"string","description":"The name of the function to call.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.function_call.oneOf.0.name","typeLabel":"string"}},"required":["arguments","name"],"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.function_call.oneOf.0","typeLabel":"object"},{"type":"null","deprecated":true,"description":"Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.","properties":{"arguments":{"type":"string","description":"The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function."},"name":{"type":"string","description":"The name of the function to call."}},"required":["arguments","name"],"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.function_call.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3.function_call","typeLabel":"object | null"}},"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.3","typeLabel":"Assistant message · object"},{"type":"object","title":"Tool message","required":["role","content","tool_call_id"],"x-oaiExpandable":true,"properties":{"role":{"type":"string","enum":["tool"],"description":"The role of the messages author, in this case `tool`.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.4.role","typeLabel":"enum\u003cstring>"},"content":{"type":"string","description":"The contents of the tool message.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.4.content","typeLabel":"string"},"tool_call_id":{"type":"string","description":"Tool call that this message is responding to.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.4.tool_call_id","typeLabel":"string"}},"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.4","typeLabel":"Tool message · object"},{"type":"object","title":"Function message","required":["role","content","name"],"deprecated":true,"x-oaiExpandable":true,"properties":{"role":{"type":"string","enum":["function"],"description":"The role of the messages author, in this case `function`.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.5.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","description":"The contents of the function message.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.5.content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The contents of the function message.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.5.content.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.5.content","typeLabel":"string | null"},"name":{"type":"string","description":"The name of the function to call.","isRequired":true,"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.5.name","typeLabel":"string"}},"uniqueKey":"data.oneOf.0.messages.items.[INDEX].oneOf.5","typeLabel":"Function message · object"}],"uniqueKey":"data.oneOf.0.messages.items.[INDEX]","typeLabel":"System message · object | Developer message · object | User message · object | Assistant message · object | Tool message · object | Function message · object"},"isRequired":true,"uniqueKey":"data.oneOf.0.messages","typeLabel":"(System message · object | Developer message · object | User message · object | Assistant message · object | Tool message · object | Function message · object)[]"},"model":{"oneOf":[{"type":"string","description":"ID of the model to use. See the [model endpoint compatibility](https://platform.openai.com/docs/models/model-endpoint-compatibility) table for details on which models work with the Chat API.","x-oaiTypeLabel":"string","example":"gpt-5","isRequired":true,"uniqueKey":"data.oneOf.0.model.oneOf.0","typeLabel":"string"},{"type":"string","description":"ID of the model to use. See the [model endpoint compatibility](https://platform.openai.com/docs/models/model-endpoint-compatibility) table for details on which models work with the Chat API.","enum":["gpt-5","gpt-5-mini","gpt-5-nano","o4-mini","o3","o3-mini","o1","o1-mini","gpt-4o","gpt-4o-mini","gpt-4o-2024-05-13","gpt-4-turbo","gpt-4-turbo-2024-04-09","gpt-4-0125-preview","gpt-4-turbo-preview","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4","gpt-4-0314","gpt-4-0613","gpt-4-32k","gpt-4-32k-0314","gpt-4-32k-0613","gpt-3.5-turbo","gpt-3.5-turbo-16k","gpt-3.5-turbo-0301","gpt-3.5-turbo-0613","gpt-3.5-turbo-1106","gpt-3.5-turbo-0125","gpt-3.5-turbo-16k-0613"],"x-oaiTypeLabel":"string","example":"gpt-5","isRequired":true,"uniqueKey":"data.oneOf.0.model.oneOf.1","typeLabel":"enum\u003cstring>"}],"isRequired":true,"uniqueKey":"data.oneOf.0.model","typeLabel":"string | enum\u003cstring>"},"frequency_penalty":{"oneOf":[{"type":"number","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"data.oneOf.0.frequency_penalty.oneOf.0","typeLabel":"number"},{"type":"null","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"data.oneOf.0.frequency_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.frequency_penalty","typeLabel":"number | null"},"logit_bias":{"oneOf":[{"type":"object","x-oaiTypeLabel":"map","default":null,"additionalProperties":{"type":"integer","uniqueKey":"data.oneOf.0.logit_bias.oneOf.0.additionalProperties","typeLabel":"integer"},"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) 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.\n","uniqueKey":"data.oneOf.0.logit_bias.oneOf.0","typeLabel":"object"},{"type":"null","x-oaiTypeLabel":"map","default":null,"additionalProperties":{"type":"integer","uniqueKey":"data.oneOf.0.logit_bias.oneOf.1.additionalProperties","typeLabel":"integer"},"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) 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.\n","uniqueKey":"data.oneOf.0.logit_bias.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.logit_bias","typeLabel":"object | null"},"logprobs":{"oneOf":[{"description":"Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`.","type":"boolean","default":false,"uniqueKey":"data.oneOf.0.logprobs.oneOf.0","typeLabel":"boolean"},{"description":"Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`.","type":"null","default":false,"uniqueKey":"data.oneOf.0.logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.logprobs","typeLabel":"boolean | null"},"top_logprobs":{"oneOf":[{"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. `logprobs` must be set to `true` if this parameter is used.","type":"integer","minimum":0,"maximum":20,"uniqueKey":"data.oneOf.0.top_logprobs.oneOf.0","typeLabel":"integer"},{"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. `logprobs` must be set to `true` if this parameter is used.","type":"null","minimum":0,"maximum":20,"uniqueKey":"data.oneOf.0.top_logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.top_logprobs","typeLabel":"integer | null"},"max_tokens":{"oneOf":[{"description":"Deprecated in favor of `max_completion_tokens`.\n\nThe maximum number of [tokens](https://platform.openai.com/tokenizer?view=bpe) that can be generated in the chat completion. This value can be used to control [costs](https://openai.com/api/pricing/) for text generated via API.\n\n**Supported models:** GPT-4o, GPT-4o-mini, GPT-4, GPT-4 Turbo, GPT-3.5 Turbo.\n\n**Not supported:** o-series reasoning models (o1, o3, o3-mini, o4-mini) and GPT-5 series — use `max_completion_tokens` instead.\n","type":"integer","deprecated":true,"uniqueKey":"data.oneOf.0.max_tokens.oneOf.0","typeLabel":"integer"},{"description":"Deprecated in favor of `max_completion_tokens`.\n\nThe maximum number of [tokens](https://platform.openai.com/tokenizer?view=bpe) that can be generated in the chat completion. This value can be used to control [costs](https://openai.com/api/pricing/) for text generated via API.\n\n**Supported models:** GPT-4o, GPT-4o-mini, GPT-4, GPT-4 Turbo, GPT-3.5 Turbo.\n\n**Not supported:** o-series reasoning models (o1, o3, o3-mini, o4-mini) and GPT-5 series — use `max_completion_tokens` instead.\n","type":"null","deprecated":true,"uniqueKey":"data.oneOf.0.max_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.max_tokens","typeLabel":"integer | null"},"max_completion_tokens":{"oneOf":[{"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).\n\n**Supported models:** GPT-5 series, o-series reasoning models (o1, o3, o3-mini, o4-mini) — required. Also supported on GPT-4o, GPT-4o-mini, GPT-4, GPT-4 Turbo, GPT-3.5 Turbo as a replacement for `max_tokens`.\n","type":"integer","uniqueKey":"data.oneOf.0.max_completion_tokens.oneOf.0","typeLabel":"integer"},{"description":"An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).\n\n**Supported models:** GPT-5 series, o-series reasoning models (o1, o3, o3-mini, o4-mini) — required. Also supported on GPT-4o, GPT-4o-mini, GPT-4, GPT-4 Turbo, GPT-3.5 Turbo as a replacement for `max_tokens`.\n","type":"null","uniqueKey":"data.oneOf.0.max_completion_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.max_completion_tokens","typeLabel":"integer | null"},"n":{"oneOf":[{"type":"integer","minimum":1,"maximum":128,"default":1,"example":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.","uniqueKey":"data.oneOf.0.n.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":1,"maximum":128,"default":1,"example":1,"description":"How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.","uniqueKey":"data.oneOf.0.n.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.n","typeLabel":"integer | null"},"presence_penalty":{"oneOf":[{"type":"number","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"data.oneOf.0.presence_penalty.oneOf.0","typeLabel":"number"},{"type":"null","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"data.oneOf.0.presence_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.presence_penalty","typeLabel":"number | null"},"response_format":{"oneOf":[{"type":"object","title":"Text","description":"Default response format. Used to generate text responses.\n","required":["type"],"properties":{"type":{"type":"string","description":"The type of response format being defined. Always `text`.","enum":["text"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"data.oneOf.0.response_format.oneOf.0.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"data.oneOf.0.response_format.oneOf.0","typeLabel":"Text · object"},{"type":"object","title":"JSON schema","description":"JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).\n","required":["type","json_schema"],"properties":{"type":{"type":"string","description":"The type of response format being defined. Always `json_schema`.","enum":["json_schema"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"data.oneOf.0.response_format.oneOf.1.type","typeLabel":"enum\u003cstring>"},"json_schema":{"type":"object","title":"JSON schema","description":"Structured Outputs configuration options, including a JSON Schema.\n","properties":{"name":{"type":"string","description":"The name of the response format. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n","isRequired":true,"uniqueKey":"data.oneOf.0.response_format.oneOf.1.json_schema.name","typeLabel":"string"},"description":{"type":"string","description":"A description of what the response format is for, used by the model to\ndetermine how to respond in the format.\n","uniqueKey":"data.oneOf.0.response_format.oneOf.1.json_schema.description","typeLabel":"string"},"schema":{"type":"object","title":"JSON schema","description":"The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n","additionalProperties":true,"uniqueKey":"data.oneOf.0.response_format.oneOf.1.json_schema.schema","typeLabel":"JSON schema · object"},"strict":{"oneOf":[{"type":"boolean","default":false,"description":"Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n","uniqueKey":"data.oneOf.0.response_format.oneOf.1.json_schema.strict.oneOf.0","typeLabel":"boolean"},{"type":"null","default":false,"description":"Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n","uniqueKey":"data.oneOf.0.response_format.oneOf.1.json_schema.strict.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.response_format.oneOf.1.json_schema.strict","typeLabel":"boolean | null"}},"required":["name"],"isRequired":true,"uniqueKey":"data.oneOf.0.response_format.oneOf.1.json_schema","typeLabel":"JSON schema · object"}},"uniqueKey":"data.oneOf.0.response_format.oneOf.1","typeLabel":"JSON schema · object"},{"type":"object","title":"JSON object","description":"JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.\n","required":["type"],"properties":{"type":{"type":"string","description":"The type of response format being defined. Always `json_object`.","enum":["json_object"],"x-stainless-const":true,"isRequired":true,"uniqueKey":"data.oneOf.0.response_format.oneOf.2.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"data.oneOf.0.response_format.oneOf.2","typeLabel":"JSON object · object"}],"uniqueKey":"data.oneOf.0.response_format","typeLabel":"Text · object | JSON schema · object | JSON object · object"},"seed":{"oneOf":[{"type":"integer","minimum":-9223372036854776000,"maximum":9223372036854776000,"description":"This feature is in Beta.\nIf specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.\n","x-code-samples":{"beta":true},"uniqueKey":"data.oneOf.0.seed.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":-9223372036854776000,"maximum":9223372036854776000,"description":"This feature is in Beta.\nIf specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.\n","x-code-samples":{"beta":true},"uniqueKey":"data.oneOf.0.seed.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.seed","typeLabel":"integer | null"},"stop":{"oneOf":[{"type":"string","description":"Up to 4 sequences where the API will stop generating further tokens.\n","uniqueKey":"data.oneOf.0.stop.oneOf.0","typeLabel":"string"},{"type":"null","description":"Up to 4 sequences where the API will stop generating further tokens.\n","uniqueKey":"data.oneOf.0.stop.oneOf.1","typeLabel":"null"},{"type":"array","items":{"type":"string","uniqueKey":"data.oneOf.0.stop.oneOf.2.items.[INDEX]","typeLabel":"string"},"description":"Up to 4 sequences where the API will stop generating further tokens.\n","maxItems":4,"minItems":1,"uniqueKey":"data.oneOf.0.stop.oneOf.2","typeLabel":"string[]"}],"uniqueKey":"data.oneOf.0.stop","typeLabel":"string | null | string[]"},"stream":{"oneOf":[{"description":"If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-UShttps://platform.openai.com/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).\n","type":"boolean","default":false,"uniqueKey":"data.oneOf.0.stream.oneOf.0","typeLabel":"boolean"},{"description":"If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-UShttps://platform.openai.com/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).\n","type":"null","default":false,"uniqueKey":"data.oneOf.0.stream.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.stream","typeLabel":"boolean | null"},"stream_options":{"oneOf":[{"description":"Options for streaming response. Only set this when you set `stream: true`.\n","type":"object","default":null,"properties":{"include_usage":{"type":"boolean","description":"If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.\n","uniqueKey":"data.oneOf.0.stream_options.oneOf.0.include_usage","typeLabel":"boolean"}},"uniqueKey":"data.oneOf.0.stream_options.oneOf.0","typeLabel":"object"},{"description":"Options for streaming response. Only set this when you set `stream: true`.\n","type":"null","default":null,"properties":{"include_usage":{"type":"boolean","description":"If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.\n"}},"uniqueKey":"data.oneOf.0.stream_options.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.stream_options","typeLabel":"object | null"},"thinking":{"oneOf":[{"type":"object","description":"View the thinking/reasoning tokens as part of your response. Thinking models produce a long internal chain of thought before generating a response. Supported only for specific Claude models on Anthropic, Google Vertex AI, and AWS Bedrock. Requires setting `strict_openai_compliance = false` in your API call.\n","properties":{"type":{"type":"string","enum":["enabled","disabled"],"description":"Enables or disables the thinking mode capability.","default":"disabled","isRequired":true,"uniqueKey":"data.oneOf.0.thinking.oneOf.0.type","typeLabel":"enum\u003cstring>"},"budget_tokens":{"type":"integer","description":"The maximum number of tokens to allocate for the thinking process.\nA higher token budget allows for more thorough reasoning but may increase overall response time.\n","minimum":1,"example":2030,"uniqueKey":"data.oneOf.0.thinking.oneOf.0.budget_tokens","typeLabel":"integer"}},"required":["type"],"example":{"type":"enabled","budget_tokens":2030},"uniqueKey":"data.oneOf.0.thinking.oneOf.0","typeLabel":"object"},{"type":"null","description":"View the thinking/reasoning tokens as part of your response. Thinking models produce a long internal chain of thought before generating a response. Supported only for specific Claude models on Anthropic, Google Vertex AI, and AWS Bedrock. Requires setting `strict_openai_compliance = false` in your API call.\n","properties":{"type":{"type":"string","enum":["enabled","disabled"],"description":"Enables or disables the thinking mode capability.","default":"disabled"},"budget_tokens":{"type":"integer","description":"The maximum number of tokens to allocate for the thinking process.\nA higher token budget allows for more thorough reasoning but may increase overall response time.\n","minimum":1,"example":2030}},"required":["type"],"example":{"type":"enabled","budget_tokens":2030},"uniqueKey":"data.oneOf.0.thinking.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.thinking","typeLabel":"object | null"},"temperature":{"oneOf":[{"type":"number","minimum":0,"maximum":2,"default":1,"example":1,"description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\n\nWe generally recommend altering this or `top_p` but not both.\n","uniqueKey":"data.oneOf.0.temperature.oneOf.0","typeLabel":"number"},{"type":"null","minimum":0,"maximum":2,"default":1,"example":1,"description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\n\nWe generally recommend altering this or `top_p` but not both.\n","uniqueKey":"data.oneOf.0.temperature.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.temperature","typeLabel":"number | null"},"top_p":{"oneOf":[{"type":"number","minimum":0,"maximum":1,"default":1,"example":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or `temperature` but not both.\n","uniqueKey":"data.oneOf.0.top_p.oneOf.0","typeLabel":"number"},{"type":"null","minimum":0,"maximum":1,"default":1,"example":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or `temperature` but not both.\n","uniqueKey":"data.oneOf.0.top_p.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.top_p","typeLabel":"number | null"},"tools":{"type":"array","description":"A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.\n","items":{"type":"object","properties":{"type":{"type":"string","enum":["function"],"description":"The type of the tool. Currently, only `function` is supported.","isRequired":true,"uniqueKey":"data.oneOf.0.tools.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"function":{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.","isRequired":true,"uniqueKey":"data.oneOf.0.tools.items.[INDEX].function.name","typeLabel":"string"},"description":{"type":"string","description":"A description of what the function does, used by the model to choose when and how to call the function.","uniqueKey":"data.oneOf.0.tools.items.[INDEX].function.description","typeLabel":"string"},"parameters":{"type":"object","description":"The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.","additionalProperties":true,"uniqueKey":"data.oneOf.0.tools.items.[INDEX].function.parameters","typeLabel":"object"},"strict":{"oneOf":[{"type":"boolean","default":false,"description":"Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).","uniqueKey":"data.oneOf.0.tools.items.[INDEX].function.strict.oneOf.0","typeLabel":"boolean"},{"type":"null","default":false,"description":"Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).","uniqueKey":"data.oneOf.0.tools.items.[INDEX].function.strict.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.tools.items.[INDEX].function.strict","typeLabel":"boolean | null"}},"required":["name"],"isRequired":true,"uniqueKey":"data.oneOf.0.tools.items.[INDEX].function","typeLabel":"object"}},"required":["type","function"],"uniqueKey":"data.oneOf.0.tools.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data.oneOf.0.tools","typeLabel":"object[]"},"tool_choice":{"oneOf":[{"type":"string","description":"Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools.\nSpecifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n\n`none` is the default when no tools are present. `auto` is the default if tools are present.\n","enum":["none","auto","required"],"x-oaiExpandable":true,"uniqueKey":"data.oneOf.0.tool_choice.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"object","description":"Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools.\nSpecifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n\n`none` is the default when no tools are present. `auto` is the default if tools are present.\n","required":["type","function"],"x-oaiExpandable":true,"properties":{"type":{"type":"string","enum":["function"],"description":"The type of the tool. Currently, only `function` is supported.","isRequired":true,"uniqueKey":"data.oneOf.0.tool_choice.oneOf.1.type","typeLabel":"enum\u003cstring>"},"function":{"type":"object","properties":{"name":{"type":"string","description":"The name of the function to call.","isRequired":true,"uniqueKey":"data.oneOf.0.tool_choice.oneOf.1.function.name","typeLabel":"string"}},"required":["name"],"isRequired":true,"uniqueKey":"data.oneOf.0.tool_choice.oneOf.1.function","typeLabel":"object"}},"uniqueKey":"data.oneOf.0.tool_choice.oneOf.1","typeLabel":"object"}],"uniqueKey":"data.oneOf.0.tool_choice","typeLabel":"enum\u003cstring> | object"},"parallel_tool_calls":{"description":"Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling) during tool use.","type":"boolean","default":true,"uniqueKey":"data.oneOf.0.parallel_tool_calls","typeLabel":"boolean"},"user":{"type":"string","example":"user-1234","description":"A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).\n","uniqueKey":"data.oneOf.0.user","typeLabel":"string"},"function_call":{"oneOf":[{"type":"string","description":"Deprecated in favor of `tool_choice`.\n\nControls which (if any) function is called by the model.\n`none` means the model will not call a function and instead generates a message.\n`auto` means the model can pick between generating a message or calling a function.\nSpecifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.\n\n`none` is the default when no functions are present. `auto` is the default if functions are present.\n","enum":["none","auto"],"deprecated":true,"x-oaiExpandable":true,"uniqueKey":"data.oneOf.0.function_call.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"object","description":"Deprecated in favor of `tool_choice`.\n\nControls which (if any) function is called by the model.\n`none` means the model will not call a function and instead generates a message.\n`auto` means the model can pick between generating a message or calling a function.\nSpecifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.\n\n`none` is the default when no functions are present. `auto` is the default if functions are present.\n","required":["name"],"deprecated":true,"x-oaiExpandable":true,"properties":{"name":{"type":"string","description":"The name of the function to call.","isRequired":true,"uniqueKey":"data.oneOf.0.function_call.oneOf.1.name","typeLabel":"string"}},"uniqueKey":"data.oneOf.0.function_call.oneOf.1","typeLabel":"object"}],"uniqueKey":"data.oneOf.0.function_call","typeLabel":"enum\u003cstring> | object"},"functions":{"deprecated":true,"description":"Deprecated in favor of `tools`.\n\nA list of functions the model may generate JSON inputs for.\n","type":"array","minItems":1,"maxItems":128,"items":{"type":"object","deprecated":true,"properties":{"name":{"type":"string","description":"The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.","isRequired":true,"uniqueKey":"data.oneOf.0.functions.items.[INDEX].name","typeLabel":"string"},"description":{"type":"string","description":"A description of what the function does, used by the model to choose when and how to call the function.","uniqueKey":"data.oneOf.0.functions.items.[INDEX].description","typeLabel":"string"},"parameters":{"type":"object","description":"The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.","additionalProperties":true,"uniqueKey":"data.oneOf.0.functions.items.[INDEX].parameters","typeLabel":"object"}},"required":["name"],"uniqueKey":"data.oneOf.0.functions.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data.oneOf.0.functions","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"data.oneOf.0","typeLabel":"Chat Completions · object"},{"type":"object","title":"Completions","required":["model","prompt"],"properties":{"model":{"oneOf":[{"type":"string","description":"ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models/overview) for descriptions of them.\n","x-oaiTypeLabel":"string","isRequired":true,"uniqueKey":"data.oneOf.1.model.oneOf.0","typeLabel":"string"},{"type":"string","description":"ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models/overview) for descriptions of them.\n","enum":["gpt-3.5-turbo-instruct","davinci-002","babbage-002"],"x-oaiTypeLabel":"string","isRequired":true,"uniqueKey":"data.oneOf.1.model.oneOf.1","typeLabel":"enum\u003cstring>"}],"isRequired":true,"uniqueKey":"data.oneOf.1.model","typeLabel":"string | enum\u003cstring>"},"prompt":{"oneOf":[{"type":"string","description":"The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.\n\nNote that \u003c|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.\n","default":"\u003c|endoftext|>","example":"This is a test.","isRequired":true,"uniqueKey":"data.oneOf.1.prompt.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","default":"","example":"This is a test.","uniqueKey":"data.oneOf.1.prompt.oneOf.1.items.[INDEX]","typeLabel":"string"},"description":"The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.\n\nNote that \u003c|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.\n","default":"\u003c|endoftext|>","isRequired":true,"uniqueKey":"data.oneOf.1.prompt.oneOf.1","typeLabel":"string[]"},{"type":"array","items":{"type":"integer","uniqueKey":"data.oneOf.1.prompt.oneOf.2.items.[INDEX]","typeLabel":"integer"},"description":"The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.\n\nNote that \u003c|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.\n","default":"\u003c|endoftext|>","minItems":1,"example":"[1212, 318, 257, 1332, 13]","isRequired":true,"uniqueKey":"data.oneOf.1.prompt.oneOf.2","typeLabel":"integer[]"},{"type":"array","items":{"type":"array","minItems":1,"items":{"type":"integer","uniqueKey":"data.oneOf.1.prompt.oneOf.3.items.[INDEX].items.[INDEX]","typeLabel":"integer"},"uniqueKey":"data.oneOf.1.prompt.oneOf.3.items.[INDEX]","typeLabel":"integer[]"},"description":"The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.\n\nNote that \u003c|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.\n","default":"\u003c|endoftext|>","minItems":1,"example":"[[1212, 318, 257, 1332, 13]]","isRequired":true,"uniqueKey":"data.oneOf.1.prompt.oneOf.3","typeLabel":"integer[][]"},{"type":"null","isRequired":true,"uniqueKey":"data.oneOf.1.prompt.oneOf.4","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.oneOf.1.prompt","typeLabel":"string | string[] | integer[] | integer[][] | null"},"best_of":{"oneOf":[{"type":"integer","default":1,"minimum":0,"maximum":20,"description":"Generates `best_of` completions server-side and returns the \"best\" (the one with the highest log probability per token). Results cannot be streamed.\n\nWhen used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`.\n\n**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.\n","uniqueKey":"data.oneOf.1.best_of.oneOf.0","typeLabel":"integer"},{"type":"null","default":1,"minimum":0,"maximum":20,"description":"Generates `best_of` completions server-side and returns the \"best\" (the one with the highest log probability per token). Results cannot be streamed.\n\nWhen used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`.\n\n**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.\n","uniqueKey":"data.oneOf.1.best_of.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.best_of","typeLabel":"integer | null"},"echo":{"oneOf":[{"type":"boolean","default":false,"description":"Echo back the prompt in addition to the completion\n","uniqueKey":"data.oneOf.1.echo.oneOf.0","typeLabel":"boolean"},{"type":"null","default":false,"description":"Echo back the prompt in addition to the completion\n","uniqueKey":"data.oneOf.1.echo.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.echo","typeLabel":"boolean | null"},"frequency_penalty":{"oneOf":[{"type":"number","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"data.oneOf.1.frequency_penalty.oneOf.0","typeLabel":"number"},{"type":"null","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"data.oneOf.1.frequency_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.frequency_penalty","typeLabel":"number | null"},"logit_bias":{"oneOf":[{"type":"object","x-oaiTypeLabel":"map","default":null,"additionalProperties":{"type":"integer","uniqueKey":"data.oneOf.1.logit_bias.oneOf.0.additionalProperties","typeLabel":"integer"},"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 GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](https://platform.openai.com/tokenizer?view=bpe) to convert text to token IDs. 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.\n\nAs an example, you can pass `{\"50256\": -100}` to prevent the \u003c|endoftext|> token from being generated.\n","uniqueKey":"data.oneOf.1.logit_bias.oneOf.0","typeLabel":"object"},{"type":"null","x-oaiTypeLabel":"map","default":null,"additionalProperties":{"type":"integer","uniqueKey":"data.oneOf.1.logit_bias.oneOf.1.additionalProperties","typeLabel":"integer"},"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 GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](https://platform.openai.com/tokenizer?view=bpe) to convert text to token IDs. 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.\n\nAs an example, you can pass `{\"50256\": -100}` to prevent the \u003c|endoftext|> token from being generated.\n","uniqueKey":"data.oneOf.1.logit_bias.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.logit_bias","typeLabel":"object | null"},"logprobs":{"oneOf":[{"type":"integer","minimum":0,"maximum":5,"default":null,"description":"Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response.\n\nThe maximum value for `logprobs` is 5.\n","uniqueKey":"data.oneOf.1.logprobs.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":0,"maximum":5,"default":null,"description":"Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response.\n\nThe maximum value for `logprobs` is 5.\n","uniqueKey":"data.oneOf.1.logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.logprobs","typeLabel":"integer | null"},"max_tokens":{"oneOf":[{"type":"integer","minimum":0,"default":16,"example":16,"description":"The maximum number of [tokens](https://platform.openai.com/tokenizer?view=bpe) that can be generated in the completion.\n\nThe token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.\n","uniqueKey":"data.oneOf.1.max_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":0,"default":16,"example":16,"description":"The maximum number of [tokens](https://platform.openai.com/tokenizer?view=bpe) that can be generated in the completion.\n\nThe token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.\n","uniqueKey":"data.oneOf.1.max_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.max_tokens","typeLabel":"integer | null"},"n":{"oneOf":[{"type":"integer","minimum":1,"maximum":128,"default":1,"example":1,"description":"How many completions to generate for each prompt.\n\n**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.\n","uniqueKey":"data.oneOf.1.n.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":1,"maximum":128,"default":1,"example":1,"description":"How many completions to generate for each prompt.\n\n**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.\n","uniqueKey":"data.oneOf.1.n.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.n","typeLabel":"integer | null"},"presence_penalty":{"oneOf":[{"type":"number","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"data.oneOf.1.presence_penalty.oneOf.0","typeLabel":"number"},{"type":"null","default":0,"minimum":-2,"maximum":2,"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n\n[See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)\n","uniqueKey":"data.oneOf.1.presence_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.presence_penalty","typeLabel":"number | null"},"seed":{"oneOf":[{"type":"integer","minimum":-9223372036854776000,"maximum":9223372036854776000,"description":"If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\n\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.\n","uniqueKey":"data.oneOf.1.seed.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":-9223372036854776000,"maximum":9223372036854776000,"description":"If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\n\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.\n","uniqueKey":"data.oneOf.1.seed.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.seed","typeLabel":"integer | null"},"stop":{"oneOf":[{"type":"string","description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.\n","default":"\u003c|endoftext|>","example":"\n","uniqueKey":"data.oneOf.1.stop.oneOf.0","typeLabel":"string"},{"type":"null","description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.\n","default":"\u003c|endoftext|>","example":"\n","uniqueKey":"data.oneOf.1.stop.oneOf.1","typeLabel":"null"},{"type":"array","items":{"type":"string","example":"[\"\\n\"]","uniqueKey":"data.oneOf.1.stop.oneOf.2.items.[INDEX]","typeLabel":"string"},"description":"Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.\n","maxItems":4,"minItems":1,"uniqueKey":"data.oneOf.1.stop.oneOf.2","typeLabel":"string[]"},{"type":"null","uniqueKey":"data.oneOf.1.stop.oneOf.3","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.stop","typeLabel":"string · null · string[] · null"},"stream":{"oneOf":[{"description":"Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-UShttps://platform.openai.com/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).\n","type":"boolean","default":false,"uniqueKey":"data.oneOf.1.stream.oneOf.0","typeLabel":"boolean"},{"description":"Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-UShttps://platform.openai.com/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).\n","type":"null","default":false,"uniqueKey":"data.oneOf.1.stream.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.stream","typeLabel":"boolean | null"},"stream_options":{"oneOf":[{"description":"Options for streaming response. Only set this when you set `stream: true`.\n","type":"object","default":null,"properties":{"include_usage":{"type":"boolean","description":"If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.\n","uniqueKey":"data.oneOf.1.stream_options.oneOf.0.include_usage","typeLabel":"boolean"}},"uniqueKey":"data.oneOf.1.stream_options.oneOf.0","typeLabel":"object"},{"description":"Options for streaming response. Only set this when you set `stream: true`.\n","type":"null","default":null,"properties":{"include_usage":{"type":"boolean","description":"If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.\n"}},"uniqueKey":"data.oneOf.1.stream_options.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.stream_options","typeLabel":"object | null"},"suffix":{"oneOf":[{"description":"The suffix that comes after a completion of inserted text.\n\nThis parameter is only supported for `gpt-3.5-turbo-instruct`.\n","default":null,"type":"string","example":"test.","uniqueKey":"data.oneOf.1.suffix.oneOf.0","typeLabel":"string"},{"description":"The suffix that comes after a completion of inserted text.\n\nThis parameter is only supported for `gpt-3.5-turbo-instruct`.\n","default":null,"type":"null","example":"test.","uniqueKey":"data.oneOf.1.suffix.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.suffix","typeLabel":"string | null"},"temperature":{"oneOf":[{"type":"number","minimum":0,"maximum":2,"default":1,"example":1,"description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\n\nWe generally recommend altering this or `top_p` but not both.\n","uniqueKey":"data.oneOf.1.temperature.oneOf.0","typeLabel":"number"},{"type":"null","minimum":0,"maximum":2,"default":1,"example":1,"description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\n\nWe generally recommend altering this or `top_p` but not both.\n","uniqueKey":"data.oneOf.1.temperature.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.temperature","typeLabel":"number | null"},"top_p":{"oneOf":[{"type":"number","minimum":0,"maximum":1,"default":1,"example":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or `temperature` but not both.\n","uniqueKey":"data.oneOf.1.top_p.oneOf.0","typeLabel":"number"},{"type":"null","minimum":0,"maximum":1,"default":1,"example":1,"description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or `temperature` but not both.\n","uniqueKey":"data.oneOf.1.top_p.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.1.top_p","typeLabel":"number | null"},"user":{"type":"string","example":"user-1234","description":"A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).\n","uniqueKey":"data.oneOf.1.user","typeLabel":"string"}},"isRequired":true,"uniqueKey":"data.oneOf.1","typeLabel":"Completions · object"}],"isRequired":true,"uniqueKey":"data","typeLabel":"Chat Completions · object | Completions · object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":true,"data":{"messages":[{"content":"\u003cstring>","role":"system","name":"\u003cstring>"}],"model":"gpt-5","frequency_penalty":0,"logit_bias":null,"logprobs":false,"top_logprobs":10,"max_tokens":123,"max_completion_tokens":123,"n":1,"presence_penalty":0,"response_format":{"type":"text"},"seed":0,"stop":"\u003cstring>","stream":false,"stream_options":null,"thinking":{"type":"enabled","budget_tokens":2030},"temperature":1,"top_p":1,"tools":[{"type":"function","function":{"name":"\u003cstring>","description":"\u003cstring>","parameters":{},"strict":false}}],"tool_choice":"none","parallel_tool_calls":true,"user":"user-1234","function_call":"none","functions":[{"name":"\u003cstring>","description":"\u003cstring>","parameters":{}}]}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"a32f564e-fd72-4d2a-b003-4f8f62227a26":{"Portkey-Key":{"type":"apiKey","in":"header","name":"x-portkey-api-key","scopes":[],"schemeName":"Portkey-Key"}}},"servers":{"6aad26ff-25ef-4ace-b16b-25b10ac7ddb9":{"url":"https://api.portkey.ai/v1","description":"Portkey API Public Endpoint"},"5f296b6c-8f69-4c2b-b832-0bdffbdf42de":{"url":"SELF_HOSTED_GATEWAY_URL","description":"Self-Hosted Gateway URL"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-portkey-api-key","scopes":[],"schemeName":"Portkey-Key"},"schema":{"title":"x-portkey-api-key","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"Portkey-Key","name":"x-portkey-api-key"}],"title":"Portkey-Key"}]},"originalFileLocation":"https://raw.githubusercontent.com/Portkey-AI/openapi/refs/heads/master/openapi.yaml"},"subdomain":"portkey-docs","siteName":"Portkey (Prisma AIRS AI Gateway) Docs","title":"Prompt Render - Portkey (Prisma AIRS AI Gateway) Docs","relatedPagesConfig":{"enabled":true,"limit":5,"mode":"automatic"},"contextualStarterQuestions":[{"_id":"6aa971b90031bd0287c96613","deploymentId":"67086365a151447bf2fa5021","questionText":"Can I use render output in LLM calls?","status":"active","generatedBy":"contextual","path":"api-reference/inference-api/prompts/render","createdAt":"2026-09-15T16:26:33.217Z","updatedAt":"2026-09-15T16:26:33.217Z","__v":0},{"_id":"6aa971b90031bd0287c96614","deploymentId":"67086365a151447bf2fa5021","questionText":"What variables can I fill in?","status":"active","generatedBy":"contextual","path":"api-reference/inference-api/prompts/render","createdAt":"2026-09-15T16:26:33.217Z","updatedAt":"2026-09-15T16:26:33.217Z","__v":0},{"_id":"6aa971b90031bd0287c96612","deploymentId":"67086365a151447bf2fa5021","questionText":"How do I render a prompt template?","status":"active","generatedBy":"contextual","path":"api-reference/inference-api/prompts/render","createdAt":"2026-09-15T16:26:33.217Z","updatedAt":"2026-09-15T16:26:33.217Z","__v":0}],"navMaps":{"firstHrefInVersion":{"Latest":{"href":"/api-reference/inference-api/prompts/render","matchLevel":0},"Prisma AIRS":{"href":"/aigw/introduction/welcome","matchLevel":4},"Virtual Keys (Deprecated)":{"href":"/api-reference/inference-api/prompts/render","matchLevel":0}},"firstHrefInLanguage":{}},"originalFileLocation":"api-reference/inference-api/prompts/render.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=\"Renders a prompt template with its variable values filled in\">\u003cmeta data-mint-head name=\"application-name\" content=\"Portkey (Prisma AIRS AI Gateway) Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_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=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Prompt Render - Portkey (Prisma AIRS AI Gateway) Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Renders a prompt template with its variable values filled in\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Portkey AI Gateway Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.portkey.ai/docs/api-reference/inference-api/prompts/render\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://portkey-docs.mintlify.app/_mintlify/api/og/v2?division=Portkey+Endpoints\u0026amp;title=Prompt+Render\u0026amp;description=Renders+a+prompt+template+with+its+variable+values+filled+in%0A\u0026amp;theme=262137c9f2583e48984715e7\u0026amp;signature=cb35d4539f25afcf323f2e4bb54ea02f67f107912bc4d34eae1a749e155a1c1a\">\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=\"Prompt Render - Portkey (Prisma AIRS AI Gateway) Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Renders a prompt template with its variable values filled in\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://portkey-docs.mintlify.app/_mintlify/api/og/v2?division=Portkey+Endpoints\u0026amp;title=Prompt+Render\u0026amp;description=Renders+a+prompt+template+with+its+variable+values+filled+in%0A\u0026amp;theme=262137c9f2583e48984715e7\u0026amp;signature=cb35d4539f25afcf323f2e4bb54ea02f67f107912bc4d34eae1a749e155a1c1a\">\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=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Portkey (Prisma AIRS AI Gateway) Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0891B2\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.portkey.ai/docs/api-reference/inference-api/prompts/render\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api-reference/inference-api/prompts/render.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.portkey.ai/#organization\",\"name\":\"Portkey (Prisma AIRS AI Gateway) Docs\",\"url\":\"https://docs.portkey.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/portkey-docs/tHk-hgNjLbEj4dhh/images/portkey-PANW-company-logo-positive.png?fit=max\u0026auto=format\u0026n=tHk-hgNjLbEj4dhh\u0026q=85\u0026s=c5fb09014ff79616583b1d3bffe27450\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.portkey.ai/docs#website\",\"name\":\"Portkey (Prisma AIRS AI Gateway) Docs\",\"url\":\"https://docs.portkey.ai/docs\",\"publisher\":{\"@id\":\"https://docs.portkey.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.portkey.ai/docs/api-reference/inference-api/prompts/render#webpage\",\"url\":\"https://docs.portkey.ai/docs/api-reference/inference-api/prompts/render\",\"name\":\"Prompt Render\",\"description\":\"Renders a prompt template with its variable values filled in\",\"isPartOf\":{\"@id\":\"https://docs.portkey.ai/docs#website\"},\"breadcrumb\":{\"@id\":\"https://docs.portkey.ai/docs/api-reference/inference-api/prompts/render#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.portkey.ai/docs/api-reference/inference-api/prompts/render#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portkey Endpoints\",\"item\":\"https://docs.portkey.ai/docs/api-reference/inference-api/prompts/prompt-completion\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Prompt Render\",\"item\":\"https://docs.portkey.ai/docs/api-reference/inference-api/prompts/render\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.portkey.ai/docs/api-reference/inference-api/prompts/render#apireference\",\"headline\":\"Prompt Render\",\"name\":\"Prompt Render\",\"description\":\"Renders a prompt template with its variable values filled in\",\"url\":\"https://docs.portkey.ai/docs/api-reference/inference-api/prompts/render\",\"mainEntityOfPage\":{\"@id\":\"https://docs.portkey.ai/docs/api-reference/inference-api/prompts/render#webpage\"},\"publisher\":{\"@id\":\"https://docs.portkey.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.portkey.ai/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Portkey (Prisma AIRS AI Gateway) Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Portkey (Prisma AIRS AI Gateway) Docs","nav":{"global":null,"versions":[{"version":"Latest","tabs":[{"tab":"Docs","pages":[{"title":"Docs","href":"/introduction/what-is-portkey"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/ecosystem"}]},{"tab":"Gateway APIs","groups":[{"group":"API Reference","pages":[{"title":"Introduction","href":"/api-reference/inference-api/introduction"},{"title":"Agentic Usage","href":"/api-reference/inference-api/agentic-usage"},{"title":"Supported Providers","href":"/api-reference/inference-api/supported-providers"},{"title":"Authentication","href":"/api-reference/inference-api/authentication"},{"title":"Headers","href":"/api-reference/inference-api/headers"},{"title":"Errors","href":"/api-reference/inference-api/error-codes"},{"title":"Response Schema","href":"/api-reference/inference-api/response-schema"},{"group":"More","pages":[{"title":"Gateway Config Object","href":"/api-reference/inference-api/config-object"},{"title":"OpenAPI Specification","url":"https://github.com/Portkey-AI/openapi","href":"/api-reference/inference-api/open-api-specification"}]}]},{"group":"SDK","pages":[{"title":"Supported SDKs","href":"/api-reference/sdk/list"},{"title":"Python","href":"/api-reference/sdk/python"},{"title":"Node.js","href":"/api-reference/sdk/node"},{"title":"C# (.NET)","href":"/api-reference/sdk/c-sharp"}]},{"group":"Chat Completions","pages":[{"title":"Chat","openapi":"post /chat/completions","href":"/api-reference/inference-api/chat"}]},{"group":"Responses","pages":[{"title":"Create a Response","openapi":"post /responses","href":"/api-reference/inference-api/responses/responses"},{"title":"Get a Response","openapi":"get /responses/{response_id}","href":"/api-reference/inference-api/responses/retrieve-response"},{"title":"Delete a Response","openapi":"delete /responses/{response_id}","href":"/api-reference/inference-api/responses/delete-response"},{"title":"List Input Items","openapi":"get /responses/{response_id}/input_items","href":"/api-reference/inference-api/responses/retrieve-inputs"}]},{"group":"Portkey Endpoints","pages":[{"title":"Prompt Completions","openapi":"post /prompts/{promptId}/completions","description":"Execute your saved prompt templates on Portkey\n","href":"/api-reference/inference-api/prompts/prompt-completion"},{"title":"Prompt Render","openapi":"post /prompts/{promptId}/render","href":"/api-reference/inference-api/prompts/render"},{"title":"Insert a Log","openapi":"post /logs","description":"","href":"/api-reference/admin-api/data-plane/logs/insert-a-log"},{"title":"Create Feedback","openapi":"post /feedback","href":"/api-reference/admin-api/data-plane/feedback/create-feedback"},{"title":"Update Feedback","openapi":"put /feedback/{id}","href":"/api-reference/admin-api/data-plane/feedback/update-feedback"},{"group":"Log Exports","pages":[{"title":"Retrieve a Log Export","openapi":"get /logs/exports/{exportId}","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/retrieve-a-log-export"},{"title":"Update a Log Export","openapi":"put /logs/exports/{exportId}","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/update-a-log-export"},{"title":"List a Log Export","openapi":"get /logs/exports","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/list-log-exports"},{"title":"Create a Log Export","openapi":"post /logs/exports","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/create-a-log-export"},{"title":"Start a Log Export","openapi":"post /logs/exports/{exportId}/start","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/start-a-log-export"},{"title":"Cancel a Log Export","openapi":"post /logs/exports/{exportId}/cancel","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/cancel-a-log-export"},{"title":"Delete a Log Export","openapi":"delete /logs/exports/{exportId}","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/delete-a-log-export"},{"title":"Download a Log Export","openapi":"get /logs/exports/{exportId}/download","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/download-a-log-export"}]}]},{"group":"Embeddings","pages":[{"title":"Embeddings","openapi":"post /embeddings","href":"/api-reference/inference-api/embeddings"}]},{"group":"Rerank","pages":[{"title":"Rerank","openapi":"post /rerank","href":"/api-reference/inference-api/rerank"}]},{"group":"Decisions","pages":[{"title":"Decisions","openapi":"post /decisions","href":"/api-reference/inference-api/decisions"}]},{"group":"OCR","pages":[{"title":"OCR","openapi":"post /ocr","href":"/api-reference/inference-api/ocr"}]},{"group":"Images","pages":[{"title":"Create Image","openapi":"post /images/generations","href":"/api-reference/inference-api/images/create-image"},{"title":"Create Image Edit","openapi":"post /images/edits","href":"/api-reference/inference-api/images/create-image-edit"},{"title":"Create Image Variation","openapi":"post /images/variations","href":"/api-reference/inference-api/images/create-image-variation"}]},{"group":"Models","pages":[{"title":"Models","openapi":"get /models","href":"/api-reference/inference-api/models/models"}]},{"group":"Audio","pages":[{"title":"Create Speech","openapi":"post /audio/speech","href":"/api-reference/inference-api/audio/create-speech"},{"title":"Create Transcription","openapi":"post /audio/transcriptions","href":"/api-reference/inference-api/audio/create-transcription"},{"title":"Create Translation","openapi":"post /audio/translations","href":"/api-reference/inference-api/audio/create-translation"}]},{"group":"Other APIs","pages":[{"title":"Gateway to Other APIs","icon":"chart-network","href":"/api-reference/inference-api/gateway-for-other-apis"}]},{"group":"Completions","pages":[{"title":"Completions","openapi":"post /completions","href":"/api-reference/inference-api/completions"}]},{"group":"Moderations","pages":[{"title":"Moderations","openapi":"post /moderations","href":"/api-reference/inference-api/moderations"}]},{"group":"Fine-tuning","pages":[{"title":"Create Fine-tuning Job","openapi":"post /fine_tuning/jobs","href":"/api-reference/inference-api/fine-tuning/create-fine-tuning-job"},{"title":"List Fine-tuning Jobs","openapi":"get /fine_tuning/jobs","href":"/api-reference/inference-api/fine-tuning/list-fine-tuning-jobs"},{"title":"Retrieve Fine-tuning Job","openapi":"get /fine_tuning/jobs/{fine_tuning_job_id}","href":"/api-reference/inference-api/fine-tuning/retrieve-fine-tuning-job"},{"title":"List Fine-tuning Events","openapi":"get /fine_tuning/jobs/{fine_tuning_job_id}/events","href":"/api-reference/inference-api/fine-tuning/list-fine-tuning-events"},{"title":"List Fine-tuning Checkpoints","openapi":"get /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints","href":"/api-reference/inference-api/fine-tuning/list-fine-tuning-checkpoints"},{"title":"Cancel Fine-tuning","openapi":"post /fine_tuning/jobs/{fine_tuning_job_id}/cancel","href":"/api-reference/inference-api/fine-tuning/cancel-fine-tuning"}]},{"group":"Batch","pages":[{"title":"Create Batch","openapi":"post /batches","href":"/api-reference/inference-api/batch/create-batch"},{"title":"List Batch","openapi":"get /batches","href":"/api-reference/inference-api/batch/list-batch"},{"title":"Retrieve Batch","openapi":"get /batches/{batch_id}","href":"/api-reference/inference-api/batch/retrieve-batch"},{"title":"Cancel Batch","openapi":"post /batches/{batch_id}/cancel","href":"/api-reference/inference-api/batch/cancel-batch"}]},{"group":"Files","pages":[{"title":"Upload File","openapi":"post /files","href":"/api-reference/inference-api/files/upload-file"},{"title":"List Files","openapi":"get /files","href":"/api-reference/inference-api/files/list-files"},{"title":"Retrieve File","openapi":"get /files/{file_id}","href":"/api-reference/inference-api/files/retrieve-file"},{"title":"Retrieve File Content","openapi":"get /files/{file_id}/content","href":"/api-reference/inference-api/files/retrieve-file-content"},{"title":"Delete File","openapi":"delete /files/{file_id}","href":"/api-reference/inference-api/files/delete-file"}]},{"group":"Assistants","pages":[{"group":"Assistants","pages":[{"title":"Create Assistant","openapi":"post /assistants","href":"/api-reference/inference-api/assistants-api/assistants/create-assistant"},{"title":"List Assistant","openapi":"get /assistants","href":"/api-reference/inference-api/assistants-api/assistants/list-assistants"},{"title":"Retrieve Assistant","openapi":"get /assistants/{assistant_id}","href":"/api-reference/inference-api/assistants-api/assistants/retrieve-assistant"},{"title":"Modify Assistant","openapi":"post /assistants/{assistant_id}","href":"/api-reference/inference-api/assistants-api/assistants/modify-assistant"},{"title":"Delete Assistant","openapi":"delete /assistants/{assistant_id}","href":"/api-reference/inference-api/assistants-api/assistants/delete-assistant"}]},{"group":"Threads","pages":[{"title":"Create Thread","openapi":"post /threads","href":"/api-reference/inference-api/assistants-api/threads/create-thread"},{"title":"Retrieve Thread","openapi":"get /threads/{thread_id}","href":"/api-reference/inference-api/assistants-api/threads/retrieve-thread"},{"title":"Modify Thread","openapi":"post /threads/{thread_id}","href":"/api-reference/inference-api/assistants-api/threads/modify-thread"},{"title":"Delete Thread","openapi":"delete /threads/{thread_id}","href":"/api-reference/inference-api/assistants-api/threads/delete-thread"}]},{"group":"Messages","pages":[{"title":"Create Message","openapi":"post /threads/{thread_id}/messages","href":"/api-reference/inference-api/assistants-api/messages/create-message"},{"title":"List Message","openapi":"get /threads/{thread_id}/messages","href":"/api-reference/inference-api/assistants-api/messages/list-messages"},{"title":"Retrieve Message","openapi":"get /threads/{thread_id}/messages/{message_id}","href":"/api-reference/inference-api/assistants-api/messages/retrieve-message"},{"title":"Modify Message","openapi":"post /threads/{thread_id}/messages/{message_id}","href":"/api-reference/inference-api/assistants-api/messages/modify-message"},{"title":"Delete Message","openapi":"delete /threads/{thread_id}/messages/{message_id}","href":"/api-reference/inference-api/assistants-api/messages/delete-message"}]},{"group":"Runs","pages":[{"title":"Create Run","openapi":"post /threads/{thread_id}/runs","href":"/api-reference/inference-api/assistants-api/runs/create-run"},{"title":"Create thread and Run","openapi":"post /threads/runs","href":"/api-reference/inference-api/assistants-api/runs/create-thread-and-run"},{"title":"list Run","openapi":"get /threads/{thread_id}/runs","href":"/api-reference/inference-api/assistants-api/runs/list-runs"},{"title":"Retrieve Run","openapi":"get /threads/{thread_id}/runs/{run_id}","href":"/api-reference/inference-api/assistants-api/runs/retrieve-run"},{"title":"Modify Run","openapi":"post /threads/{thread_id}/runs/{run_id}","href":"/api-reference/inference-api/assistants-api/runs/modify-run"},{"title":"Submit Tool Outputs to Run","openapi":"post /threads/{thread_id}/runs/{run_id}/submit_tool_outputs","href":"/api-reference/inference-api/assistants-api/runs/submit-tool-outputs-to-run"},{"title":"Cancel Run","openapi":"post /threads/{thread_id}/runs/{run_id}/cancel","href":"/api-reference/inference-api/assistants-api/runs/cancel-run"}]},{"group":"Run Steps","pages":[{"title":"List Run Steps","openapi":"get /threads/{thread_id}/runs/{run_id}/steps","href":"/api-reference/inference-api/assistants-api/run-steps/list-run-steps"},{"title":"Retrieve Run Steps","openapi":"get /threads/{thread_id}/runs/{run_id}/steps/{step_id}","href":"/api-reference/inference-api/assistants-api/run-steps/retrieve-run-steps"}]}]}]},{"tab":"Admin APIs","pages":[{"title":"Admin APIs","href":"/api-reference/admin-api/introduction"}]},{"tab":"Cookbooks","pages":[{"title":"Cookbooks","href":"/guides/use-cases/run-batch-evals"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/2026/september"}]},{"tab":"Help Center","pages":[{"title":"Help Center","href":"/help-center/you-do-not-have-enough-permissions"}]}]},{"version":"Prisma AIRS","pages":[{"title":"Prisma AIRS","href":"/aigw/introduction/welcome"}]},{"version":"Virtual Keys (Deprecated)","tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/virtual_key_old/introduction/what-is-portkey"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/virtual_key_old/integrations/ecosystem"}]},{"tab":"Inference API","groups":[{"group":"API Reference","pages":[{"title":"Introduction","href":"/api-reference/inference-api/introduction"},{"title":"Agentic Usage","href":"/api-reference/inference-api/agentic-usage"},{"title":"Supported Providers","href":"/api-reference/inference-api/supported-providers"},{"title":"Authentication","href":"/api-reference/inference-api/authentication"},{"title":"Headers","href":"/api-reference/inference-api/headers"},{"title":"Errors","href":"/api-reference/inference-api/error-codes"},{"title":"Response Schema","href":"/api-reference/inference-api/response-schema"},{"group":"More","pages":[{"title":"Gateway Config Object","href":"/api-reference/inference-api/config-object"},{"title":"OpenAPI Specification","url":"https://github.com/Portkey-AI/openapi","href":"/api-reference/inference-api/open-api-specification"}]}]},{"group":"SDK","pages":[{"title":"Supported SDKs","href":"/api-reference/sdk/list"},{"title":"Python","href":"/api-reference/sdk/python"},{"title":"Node.js","href":"/api-reference/sdk/node"},{"title":"C# (.NET)","href":"/api-reference/sdk/c-sharp"}]},{"group":"Chat Completions","pages":[{"title":"Chat","openapi":"post /chat/completions","href":"/api-reference/inference-api/chat"}]},{"group":"Responses","pages":[{"title":"Create a Response","openapi":"post /responses","href":"/api-reference/inference-api/responses/responses"},{"title":"Get a Response","openapi":"get /responses/{response_id}","href":"/api-reference/inference-api/responses/retrieve-response"},{"title":"Delete a Response","openapi":"delete /responses/{response_id}","href":"/api-reference/inference-api/responses/delete-response"},{"title":"List Input Items","openapi":"get /responses/{response_id}/input_items","href":"/api-reference/inference-api/responses/retrieve-inputs"}]},{"group":"Portkey Endpoints","pages":[{"title":"Prompt Completions","openapi":"post /prompts/{promptId}/completions","description":"Execute your saved prompt templates on Portkey\n","href":"/api-reference/inference-api/prompts/prompt-completion"},{"title":"Prompt Render","openapi":"post /prompts/{promptId}/render","href":"/api-reference/inference-api/prompts/render"},{"title":"Insert a Log","openapi":"post /logs","description":"","href":"/api-reference/admin-api/data-plane/logs/insert-a-log"},{"title":"Create Feedback","openapi":"post /feedback","href":"/api-reference/admin-api/data-plane/feedback/create-feedback"},{"title":"Update Feedback","openapi":"put /feedback/{id}","href":"/api-reference/admin-api/data-plane/feedback/update-feedback"},{"group":"Log Exports","pages":[{"title":"Retrieve a Log Export","openapi":"get /logs/exports/{exportId}","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/retrieve-a-log-export"},{"title":"Update a Log Export","openapi":"put /logs/exports/{exportId}","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/update-a-log-export"},{"title":"List a Log Export","openapi":"get /logs/exports","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/list-log-exports"},{"title":"Create a Log Export","openapi":"post /logs/exports","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/create-a-log-export"},{"title":"Start a Log Export","openapi":"post /logs/exports/{exportId}/start","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/start-a-log-export"},{"title":"Cancel a Log Export","openapi":"post /logs/exports/{exportId}/cancel","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/cancel-a-log-export"},{"title":"Delete a Log Export","openapi":"delete /logs/exports/{exportId}","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/delete-a-log-export"},{"title":"Download a Log Export","openapi":"get /logs/exports/{exportId}/download","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/download-a-log-export"}]}]},{"group":"Embeddings","pages":[{"title":"Embeddings","openapi":"post /embeddings","href":"/api-reference/inference-api/embeddings"}]},{"group":"Rerank","pages":[{"title":"Rerank","openapi":"post /rerank","href":"/api-reference/inference-api/rerank"}]},{"group":"Decisions","pages":[{"title":"Decisions","openapi":"post /decisions","href":"/api-reference/inference-api/decisions"}]},{"group":"OCR","pages":[{"title":"OCR","openapi":"post /ocr","href":"/api-reference/inference-api/ocr"}]},{"group":"Images","pages":[{"title":"Create Image","openapi":"post /images/generations","href":"/api-reference/inference-api/images/create-image"},{"title":"Create Image Edit","openapi":"post /images/edits","href":"/api-reference/inference-api/images/create-image-edit"},{"title":"Create Image Variation","openapi":"post /images/variations","href":"/api-reference/inference-api/images/create-image-variation"}]},{"group":"Audio","pages":[{"title":"Create Speech","openapi":"post /audio/speech","href":"/api-reference/inference-api/audio/create-speech"},{"title":"Create Transcription","openapi":"post /audio/transcriptions","href":"/api-reference/inference-api/audio/create-transcription"},{"title":"Create Translation","openapi":"post /audio/translations","href":"/api-reference/inference-api/audio/create-translation"}]},{"group":"Other APIs","pages":[{"title":"Gateway to Other APIs","icon":"chart-network","href":"/api-reference/inference-api/gateway-for-other-apis"}]},{"group":"Completions","pages":[{"title":"Completions","openapi":"post /completions","href":"/api-reference/inference-api/completions"}]},{"group":"Moderations","pages":[{"title":"Moderations","openapi":"post /moderations","href":"/api-reference/inference-api/moderations"}]},{"group":"Fine-tuning","pages":[{"title":"Create Fine-tuning Job","openapi":"post /fine_tuning/jobs","href":"/api-reference/inference-api/fine-tuning/create-fine-tuning-job"},{"title":"List Fine-tuning Jobs","openapi":"get /fine_tuning/jobs","href":"/api-reference/inference-api/fine-tuning/list-fine-tuning-jobs"},{"title":"Retrieve Fine-tuning Job","openapi":"get /fine_tuning/jobs/{fine_tuning_job_id}","href":"/api-reference/inference-api/fine-tuning/retrieve-fine-tuning-job"},{"title":"List Fine-tuning Events","openapi":"get /fine_tuning/jobs/{fine_tuning_job_id}/events","href":"/api-reference/inference-api/fine-tuning/list-fine-tuning-events"},{"title":"List Fine-tuning Checkpoints","openapi":"get /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints","href":"/api-reference/inference-api/fine-tuning/list-fine-tuning-checkpoints"},{"title":"Cancel Fine-tuning","openapi":"post /fine_tuning/jobs/{fine_tuning_job_id}/cancel","href":"/api-reference/inference-api/fine-tuning/cancel-fine-tuning"}]},{"group":"Batch","pages":[{"title":"Create Batch","openapi":"post /batches","href":"/api-reference/inference-api/batch/create-batch"},{"title":"List Batch","openapi":"get /batches","href":"/api-reference/inference-api/batch/list-batch"},{"title":"Retrieve Batch","openapi":"get /batches/{batch_id}","href":"/api-reference/inference-api/batch/retrieve-batch"},{"title":"Cancel Batch","openapi":"post /batches/{batch_id}/cancel","href":"/api-reference/inference-api/batch/cancel-batch"}]},{"group":"Files","pages":[{"title":"Upload File","openapi":"post /files","href":"/api-reference/inference-api/files/upload-file"},{"title":"List Files","openapi":"get /files","href":"/api-reference/inference-api/files/list-files"},{"title":"Retrieve File","openapi":"get /files/{file_id}","href":"/api-reference/inference-api/files/retrieve-file"},{"title":"Retrieve File Content","openapi":"get /files/{file_id}/content","href":"/api-reference/inference-api/files/retrieve-file-content"},{"title":"Delete File","openapi":"delete /files/{file_id}","href":"/api-reference/inference-api/files/delete-file"}]},{"group":"Assistants","pages":[{"group":"Assistants","pages":[{"title":"Create Assistant","openapi":"post /assistants","href":"/api-reference/inference-api/assistants-api/assistants/create-assistant"},{"title":"List Assistant","openapi":"get /assistants","href":"/api-reference/inference-api/assistants-api/assistants/list-assistants"},{"title":"Retrieve Assistant","openapi":"get /assistants/{assistant_id}","href":"/api-reference/inference-api/assistants-api/assistants/retrieve-assistant"},{"title":"Modify Assistant","openapi":"post /assistants/{assistant_id}","href":"/api-reference/inference-api/assistants-api/assistants/modify-assistant"},{"title":"Delete Assistant","openapi":"delete /assistants/{assistant_id}","href":"/api-reference/inference-api/assistants-api/assistants/delete-assistant"}]},{"group":"Threads","pages":[{"title":"Create Thread","openapi":"post /threads","href":"/api-reference/inference-api/assistants-api/threads/create-thread"},{"title":"Retrieve Thread","openapi":"get /threads/{thread_id}","href":"/api-reference/inference-api/assistants-api/threads/retrieve-thread"},{"title":"Modify Thread","openapi":"post /threads/{thread_id}","href":"/api-reference/inference-api/assistants-api/threads/modify-thread"},{"title":"Delete Thread","openapi":"delete /threads/{thread_id}","href":"/api-reference/inference-api/assistants-api/threads/delete-thread"}]},{"group":"Messages","pages":[{"title":"Create Message","openapi":"post /threads/{thread_id}/messages","href":"/api-reference/inference-api/assistants-api/messages/create-message"},{"title":"List Message","openapi":"get /threads/{thread_id}/messages","href":"/api-reference/inference-api/assistants-api/messages/list-messages"},{"title":"Retrieve Message","openapi":"get /threads/{thread_id}/messages/{message_id}","href":"/api-reference/inference-api/assistants-api/messages/retrieve-message"},{"title":"Modify Message","openapi":"post /threads/{thread_id}/messages/{message_id}","href":"/api-reference/inference-api/assistants-api/messages/modify-message"},{"title":"Delete Message","openapi":"delete /threads/{thread_id}/messages/{message_id}","href":"/api-reference/inference-api/assistants-api/messages/delete-message"}]},{"group":"Runs","pages":[{"title":"Create Run","openapi":"post /threads/{thread_id}/runs","href":"/api-reference/inference-api/assistants-api/runs/create-run"},{"title":"Create thread and Run","openapi":"post /threads/runs","href":"/api-reference/inference-api/assistants-api/runs/create-thread-and-run"},{"title":"list Run","openapi":"get /threads/{thread_id}/runs","href":"/api-reference/inference-api/assistants-api/runs/list-runs"},{"title":"Retrieve Run","openapi":"get /threads/{thread_id}/runs/{run_id}","href":"/api-reference/inference-api/assistants-api/runs/retrieve-run"},{"title":"Modify Run","openapi":"post /threads/{thread_id}/runs/{run_id}","href":"/api-reference/inference-api/assistants-api/runs/modify-run"},{"title":"Submit Tool Outputs to Run","openapi":"post /threads/{thread_id}/runs/{run_id}/submit_tool_outputs","href":"/api-reference/inference-api/assistants-api/runs/submit-tool-outputs-to-run"},{"title":"Cancel Run","openapi":"post /threads/{thread_id}/runs/{run_id}/cancel","href":"/api-reference/inference-api/assistants-api/runs/cancel-run"}]},{"group":"Run Steps","pages":[{"title":"List Run Steps","openapi":"get /threads/{thread_id}/runs/{run_id}/steps","href":"/api-reference/inference-api/assistants-api/run-steps/list-run-steps"},{"title":"Retrieve Run Steps","openapi":"get /threads/{thread_id}/runs/{run_id}/steps/{step_id}","href":"/api-reference/inference-api/assistants-api/run-steps/retrieve-run-steps"}]}]}]},{"tab":"Admin API","pages":[{"title":"Admin API","href":"/api-reference/admin-api/introduction"}]},{"tab":"Cookbooks","pages":[{"title":"Cookbooks","href":"/guides/use-cases/run-batch-evals"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/2025/may"}]},{"tab":"Help articles","pages":[{"title":"Help articles","href":"/help-center/you-do-not-have-enough-permissions"}]}]}]},"basePath":"","title":"Prompt Render - Portkey (Prisma AIRS AI Gateway) Docs","buildId":"dpl_GWQzn6k13MqphA3qck3hQKoQXDzM","deploymentId":"dpl_GWQzn6k13MqphA3qck3hQKoQXDzM","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-vlKR2tYY.js","utils-DBDPZSWe.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-CxHK4zz2.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-27b98BOz.js","snippetPresets-DNnui32z.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-cDVS2zyo.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BEE-OyDQ.js","shallow-fqEMZOYR.js","getApiPlaygroundDisplay-BPut1_OB.js","CodeSnippet-h9vp8UTG.js","CodeSnippets-DoMjCW5Q.js","Page-BOWGOUSK.js","getPastedJson-C4r-hmQ_.js","icon-CCDahfhO.js","MethodPill-Dpq0JSrS.js","DuplicateIcon-BGPwFt-j.js","createIcon-DBULrQp7.js","DynamicMarkdown-B74atANy.js","SectionHeading-DZCpbSmT.js","axios-vUo_bRtp.js","Markdown-BwkgxkAH.js","clsx-CEIlvfOI.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-f6OgbvLC.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-DvlTOml0.js"]}