모델이 어떤 도구를 호출할지(호출하는 경우) 제어합니다. none은 모델이 도구를 호출하지 않음을 의미합니다. auto는 모델이 메시지 생성 또는 도구 호출 중에서 선택할 수 있음을 의미합니다. required는 모델이 하나 이상의 도구를 호출해야 함을 의미합니다. {"type": "function", "function": {"name": "my_function"}}을 통해 특정 함수를 지정할 수도 있습니다.
모델이 실행되는 백엔드 구성을 나타내는 핑거프린트. seed 매개변수와 함께 사용하여 백엔드 변경 사항을 파악할 수 있습니다.
curl -X POST https://api-llm.sunra.ai/v1/chat/completions \ -H "Authorization: Bearer <SUNRA_KEY>" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/gpt-4o", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "What is the capital of France?" } ] }'
import requestsresponse = requests.post( "https://api-llm.sunra.ai/v1/chat/completions", headers={ "Authorization": "Bearer <SUNRA_KEY>", "Content-Type": "application/json" }, json={ "model": "openai/gpt-4o", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is the capital of France?"} ] })print(response.json())
const response = await fetch("https://api-llm.sunra.ai/v1/chat/completions", { method: "POST", headers: { "Authorization": "Bearer <SUNRA_KEY>", "Content-Type": "application/json" }, body: JSON.stringify({ model: "openai/gpt-4o", messages: [ { role: "system", content: "You are a helpful assistant." }, { role: "user", content: "What is the capital of France?" } ] })});const data = await response.json();console.log(data);
{ "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1677652288, "model": "openai/gpt-4o", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "The capital of France is Paris." }, "finish_reason": "stop", "logprobs": null } ], "system_fingerprint": "fp_44709d6fcb", "usage": { "prompt_tokens": 25, "completion_tokens": 8, "total_tokens": 33 }}
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Sunra.ai","colors":{"primary":"#ff632f","light":"#ff632f","dark":"#ff632f"},"logo":{"light":"https://mintcdn.com/sunraai/U2o8uzmv75no70tM/logo/light.svg?fit=max\u0026auto=format\u0026n=U2o8uzmv75no70tM\u0026q=85\u0026s=520c0afb29ad1fddc46fec66c975eb2a","dark":"https://mintcdn.com/sunraai/U2o8uzmv75no70tM/logo/dark.svg?fit=max\u0026auto=format\u0026n=U2o8uzmv75no70tM\u0026q=85\u0026s=16e2ed4856376448550627daa81544b9"},"favicon":"https://mintcdn.com/sunraai/U2o8uzmv75no70tM/favicon.svg?fit=max\u0026auto=format\u0026n=U2o8uzmv75no70tM\u0026q=85\u0026s=c47b7db8e76fb19f94de55c161e2fcd1","api":{},"navbar":{"links":[{"href":"https://sunra.ai/about","label":"About"}],"primary":{"type":"button","label":"Go to sunra.ai","href":"https://sunra.ai"}},"footer":{"socials":{"x":"https://x.com/sunra_ai","discord":"https://discord.gg/897qCzvCcU","github":"https://github.com/sunra-ai"}},"integrations":{"amplitude":{"apiKey":"94a6621e5239157d3f0a392f6d5f8a21"}},"banner":{"content":"The developer site has moved to **platform.sunra.ai**. API endpoints, SDKs and keys are unchanged — you may just need to sign in again.","dismissible":true},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"X (Twitter)","icon":"x-twitter","href":"https://x.com/sunra_ai"},{"anchor":"Discord","icon":"discord","href":"https://discord.gg/897qCzvCcU"},{"anchor":"GitHub","icon":"github","href":"https://github.com/sunra-ai"}]},"languages":[{"language":"en","href":""},{"language":"zh-Hans","href":"zh-Hans"},{"language":"zh-Hant","href":"zh-Hant"},{"language":"fr","href":"fr"},{"language":"ja","href":"ja"},{"language":"es","href":"es"},{"language":"pt","href":"pt"},{"language":"hi","href":"hi"},{"language":"tr","href":"tr"},{"language":"de","href":"de"},{"language":"id","href":"id"},{"language":"it","href":"it"},{"language":"ko","href":"ko"},{"language":"ru","href":"ru"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"sunraai","hasAudioNarration":false,"actualSubdomain":"sunraai","customDomains":["docs.sunra.ai"],"gitSource":{"type":"github","owner":"sunra-ai","repo":"sunra-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae46d92a3eed560d7e4c18a","collectionId":"4754d27b-94dc-45d7-b9f3-30dbad1abac8","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae46d92a3eed560d7e4c18a"},"entitlements":{},"buildId":"6ae46d92a3eed560d7e4c18a","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"en","tag":"Multimodal","count":10},{"language":"en","tag":"LLM","count":9},{"language":"de","tag":"Multimodal","count":9},{"language":"es","tag":"Multimodal","count":9},{"language":"fr","tag":"Multimodal","count":9},{"language":"hi","tag":"Multimodal","count":9},{"language":"id","tag":"Multimodal","count":9},{"language":"it","tag":"Multimodal","count":9},{"language":"ja","tag":"Multimodal","count":9},{"language":"ko","tag":"Multimodal","count":9},{"language":"pt","tag":"Multimodal","count":9},{"language":"ru","tag":"Multimodal","count":9},{"language":"tr","tag":"Multimodal","count":9},{"language":"zh-Hans","tag":"Multimodal","count":9},{"language":"zh-Hant","tag":"Multimodal","count":9},{"language":"zh-Hans","tag":"LLM","count":8},{"language":"en","tag":"Platform","count":6},{"language":"de","tag":"LLM","count":6},{"language":"es","tag":"LLM","count":6},{"language":"fr","tag":"LLM","count":6},{"language":"hi","tag":"LLM","count":6},{"language":"id","tag":"LLM","count":6},{"language":"it","tag":"LLM","count":6},{"language":"ja","tag":"LLM","count":6},{"language":"ko","tag":"LLM","count":6},{"language":"pt","tag":"LLM","count":6},{"language":"ru","tag":"LLM","count":6},{"language":"tr","tag":"LLM","count":6},{"language":"zh-Hant","tag":"LLM","count":6},{"language":"zh-Hans","tag":"平台","count":5},{"language":"en","tag":"Client Libraries","count":4},{"language":"de","tag":"Client-Bibliotheken","count":4},{"language":"es","tag":"Bibliotecas de cliente","count":4},{"language":"fr","tag":"Bibliothèques clientes","count":4},{"language":"hi","tag":"क्लाइंट लाइब्रेरी","count":4},{"language":"id","tag":"Pustaka Klien","count":4},{"language":"it","tag":"Librerie client","count":4},{"language":"ja","tag":"クライアントライブラリ","count":4},{"language":"ko","tag":"클라이언트 라이브러리","count":4},{"language":"pt","tag":"Bibliotecas de cliente","count":4},{"language":"ru","tag":"Клиентские библиотеки","count":4},{"language":"tr","tag":"İstemci Kütüphaneleri","count":4},{"language":"zh-Hans","tag":"客户端 SDK","count":4},{"language":"zh-Hant","tag":"客戶端 SDK","count":4},{"language":"en","tag":"Overview","count":1},{"language":"de","tag":"Überblick","count":1},{"language":"es","tag":"Descripción general","count":1},{"language":"fr","tag":"Aperçu","count":1},{"language":"hi","tag":"अवलोकन","count":1},{"language":"id","tag":"Ikhtisar","count":1},{"language":"it","tag":"Panoramica","count":1},{"language":"ja","tag":"概要","count":1},{"language":"ko","tag":"개요","count":1},{"language":"pt","tag":"Visão geral","count":1},{"language":"ru","tag":"Обзор","count":1},{"language":"tr","tag":"Genel Bakış","count":1},{"language":"zh-Hans","tag":"概述","count":1},{"language":"zh-Hant","tag":"概述","count":1}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#navbar>div>div>div>div>div{border-bottom:0}.codeblock-light{background:#fafafa!important}.dark .codeblock-light{background:#0a0a0a!important}#search-bar-entry>span{font-weight:400!important}#assistant-entry>span{color:#000!important}.dark #assistant-entry>span{color:#fff!important}.rounded-2xl,.rounded-3xl,.rounded-\\[14px\\],.rounded-full,.rounded-lg,.rounded-md,.rounded-sm,.rounded-xl{border-radius:4px!important}"}],"page":{"pagePath":"ko/llm/chat","slug":"/ko/llm/chat","pageMetadata":{"title":"Create a chat completion","api":"POST https://api-llm.sunra.ai/v1/chat/completions","description":null,"href":"/ko/llm/chat"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,..._provideComponents(),...props.components},{Expandable,Heading,ParamField,ResponseField}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`지정된 채팅 대화에 대한 모델 응답 요청을 보냅니다. 스트리밍 및 비스트리밍 모드를 모두 지원합니다. OpenAI Chat Completions API 형식과 호환됩니다.`}),`\n`,_jsx(Heading,{level:`2`,id:`인증`,children:`인증`}),`\n`,_jsxs(ParamField,{header:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:[_jsx(_components.p,{children:`Bearer 토큰. API 키를 Authorization 헤더의 Bearer 토큰으로 사용하세요.`}),_jsxs(_components.p,{children:[`Format: `,_jsx(_components.code,{children:`Bearer \u003cSUNRA_KEY>`})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`요청`,children:`요청`}),`\n`,_jsx(_components.p,{children:`이 엔드포인트는 JSON 객체를 받습니다.`}),`\n`,_jsxs(ParamField,{body:`messages`,type:`object[]`,required:true,id:`param-messages`,children:[_jsx(_components.p,{children:`대화의 메시지 목록.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ParamField,{body:`role`,type:`string`,required:true,id:`param-role`,children:_jsxs(_components.p,{children:[`메시지 작성자의 역할. 지원되는 값: `,_jsx(_components.code,{children:`system`}),`, `,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`assistant`}),`, `,_jsx(_components.code,{children:`tool`}),`.`]})}),_jsx(ParamField,{body:`content`,type:`string | object[]`,required:true,id:`param-content`,children:_jsx(_components.p,{children:`메시지의 내용. 문자열 또는 멀티모달 입력을 위한 콘텐츠 파트 배열을 지정할 수 있습니다.`})}),_jsx(ParamField,{body:`name`,type:`string`,id:`param-name`,children:_jsx(_components.p,{children:`참여자의 선택적 이름. 동일한 역할의 참여자를 구분하기 위해 모델에 정보를 제공합니다.`})}),_jsx(ParamField,{body:`tool_calls`,type:`object[]`,id:`param-tool-calls`,children:_jsxs(_components.p,{children:[`함수 호출 등 모델이 생성한 도구 호출. `,_jsx(_components.code,{children:`assistant`}),` 메시지에만 존재합니다.`]})}),_jsx(ParamField,{body:`tool_call_id`,type:`string`,id:`param-tool-call-id`,children:_jsxs(_components.p,{children:[`이 메시지가 응답하는 도구 호출. `,_jsx(_components.code,{children:`tool`}),` 메시지에만 존재합니다.`]})})]})]}),`\n`,_jsx(ParamField,{body:`model`,type:`string`,required:true,id:`param-model`,children:_jsxs(_components.p,{children:[`완성에 사용할 모델. 사용 가능한 모델은 `,_jsx(_components.a,{href:`https://sunra.ai/models`,children:`sunra.ai/models`}),`에서 확인하세요.`]})}),`\n`,_jsx(ParamField,{body:`stream`,type:`boolean`,default:false,id:`param-stream`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),`로 설정하면 부분 메시지 델타가 서버 전송 이벤트(SSE)로 전송됩니다.`]})}),`\n`,_jsx(ParamField,{body:`max_tokens`,type:`integer`,id:`param-max-tokens`,children:_jsx(_components.p,{children:`완성에서 생성할 최대 토큰 수. 입력 토큰과 생성된 토큰의 총 길이는 모델의 컨텍스트 길이에 의해 제한됩니다.`})}),`\n`,_jsx(ParamField,{body:`temperature`,type:`number`,default:1,id:`param-temperature`,children:_jsx(_components.p,{children:`0에서 2 사이의 샘플링 온도. 0.8과 같은 높은 값은 출력을 더 무작위로 만들고, 0.2와 같은 낮은 값은 더 집중적이고 결정론적으로 만듭니다.`})}),`\n`,_jsx(ParamField,{body:`top_p`,type:`number`,default:1,id:`param-top-p`,children:_jsx(_components.p,{children:`핵 샘플링 매개변수(0-1). temperature 샘플링의 대안으로, 모델이 top_p 확률 질량을 가진 토큰을 고려합니다.`})}),`\n`,_jsx(ParamField,{body:`frequency_penalty`,type:`number`,default:0,id:`param-frequency-penalty`,children:_jsx(_components.p,{children:`-2.0에서 2.0 사이의 숫자. 양수 값은 텍스트에서의 기존 빈도를 기반으로 새 토큰에 페널티를 부과하여, 모델이 같은 문장을 그대로 반복할 가능성을 줄입니다.`})}),`\n`,_jsx(ParamField,{body:`presence_penalty`,type:`number`,default:0,id:`param-presence-penalty`,children:_jsx(_components.p,{children:`-2.0에서 2.0 사이의 숫자. 양수 값은 텍스트에 이미 나타났는지 여부를 기반으로 새 토큰에 페널티를 부과하여, 모델이 새로운 주제에 대해 이야기할 가능성을 높입니다.`})}),`\n`,_jsx(ParamField,{body:`stop`,type:`string | string[]`,id:`param-stop`,children:_jsx(_components.p,{children:`API가 추가 토큰 생성을 중단하는 최대 4개의 시퀀스.`})}),`\n`,_jsx(ParamField,{body:`n`,type:`integer`,default:1,id:`param-n`,children:_jsx(_components.p,{children:`각 입력 메시지에 대해 생성할 채팅 완성 선택지 수.`})}),`\n`,_jsx(ParamField,{body:`logprobs`,type:`boolean`,default:false,id:`param-logprobs`,children:_jsx(_components.p,{children:`출력 토큰의 로그 확률을 반환할지 여부. true인 경우, 메시지 내용에 반환된 각 출력 토큰의 로그 확률을 반환합니다.`})}),`\n`,_jsx(ParamField,{body:`top_logprobs`,type:`integer`,id:`param-top-logprobs`,children:_jsxs(_components.p,{children:[`각 토큰 위치에서 반환할 가장 가능성 높은 토큰 수를 지정하는 0에서 20 사이의 정수. 이 매개변수를 사용하려면 `,_jsx(_components.code,{children:`logprobs`}),`를 `,_jsx(_components.code,{children:`true`}),`로 설정해야 합니다.`]})}),`\n`,_jsxs(ParamField,{body:`response_format`,type:`object`,id:`param-response-format`,children:[_jsx(_components.p,{children:`모델이 출력해야 하는 형식을 지정하는 객체.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type`,children:_jsxs(_components.p,{children:[`응답 형식의 유형. 지원되는 값: `,_jsx(_components.code,{children:`text`}),`, `,_jsx(_components.code,{children:`json_object`}),`, `,_jsx(_components.code,{children:`json_schema`}),`.`]})}),_jsx(ParamField,{body:`json_schema`,type:`object`,id:`param-json-schema`,children:_jsxs(_components.p,{children:[`JSON 스키마 객체. type이 `,_jsx(_components.code,{children:`json_schema`}),`인 경우 필수입니다.`]})})]})]}),`\n`,_jsx(ParamField,{body:`seed`,type:`integer`,id:`param-seed`,children:_jsx(_components.p,{children:`지정된 경우, 시스템은 동일한 seed와 매개변수를 가진 반복 요청이 동일한 결과를 반환하도록 최선의 노력으로 결정론적 샘플링을 수행합니다.`})}),`\n`,_jsxs(ParamField,{body:`tools`,type:`object[]`,id:`param-tools`,children:[_jsx(_components.p,{children:`모델이 호출할 수 있는 도구 목록. 현재 함수만 도구로 지원됩니다.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-1`,children:_jsxs(_components.p,{children:[`도구의 유형. 현재 `,_jsx(_components.code,{children:`function`}),`만 지원됩니다.`]})}),_jsxs(ParamField,{body:`function`,type:`object`,required:true,id:`param-function`,children:[_jsx(_components.p,{children:`함수 정의.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ParamField,{body:`name`,type:`string`,required:true,id:`param-name-1`,children:_jsx(_components.p,{children:`호출할 함수의 이름.`})}),_jsx(ParamField,{body:`description`,type:`string`,id:`param-description`,children:_jsx(_components.p,{children:`함수가 수행하는 작업에 대한 설명.`})}),_jsx(ParamField,{body:`parameters`,type:`object`,id:`param-parameters`,children:_jsx(_components.p,{children:`함수가 허용하는 매개변수로, JSON Schema 객체로 설명됩니다.`})}),_jsx(ParamField,{body:`strict`,type:`boolean`,default:false,id:`param-strict`,children:_jsx(_components.p,{children:`엄격한 스키마 준수를 활성화할지 여부.`})})]})]})]})]}),`\n`,_jsx(ParamField,{body:`tool_choice`,type:`string | object`,id:`param-tool-choice`,children:_jsxs(_components.p,{children:[`모델이 어떤 도구를 호출할지(호출하는 경우) 제어합니다. `,_jsx(_components.code,{children:`none`}),`은 모델이 도구를 호출하지 않음을 의미합니다. `,_jsx(_components.code,{children:`auto`}),`는 모델이 메시지 생성 또는 도구 호출 중에서 선택할 수 있음을 의미합니다. `,_jsx(_components.code,{children:`required`}),`는 모델이 하나 이상의 도구를 호출해야 함을 의미합니다. `,_jsx(_components.code,{children:`{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}`}),`을 통해 특정 함수를 지정할 수도 있습니다.`]})}),`\n`,_jsx(ParamField,{body:`parallel_tool_calls`,type:`boolean`,default:true,id:`param-parallel-tool-calls`,children:_jsx(_components.p,{children:`도구 사용 시 병렬 함수 호출을 활성화할지 여부.`})}),`\n`,_jsx(ParamField,{body:`user`,type:`string`,id:`param-user`,children:_jsx(_components.p,{children:`최종 사용자를 나타내는 고유 식별자로, 남용 모니터링 및 감지에 도움이 될 수 있습니다.`})}),`\n`,_jsx(Heading,{level:`2`,id:`응답`,children:`응답`}),`\n`,_jsx(_components.p,{children:`채팅 완성 성공 응답.`}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id`,children:_jsx(_components.p,{children:`채팅 완성의 고유 식별자.`})}),`\n`,_jsx(ResponseField,{name:`object`,type:`string`,id:`param-object`,children:_jsxs(_components.p,{children:[`객체 유형. 항상 `,_jsx(_components.code,{children:`chat.completion`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`created`,type:`integer`,id:`param-created`,children:_jsx(_components.p,{children:`채팅 완성이 생성된 시점의 Unix 타임스탬프(초 단위).`})}),`\n`,_jsx(ResponseField,{name:`model`,type:`string`,id:`param-model-1`,children:_jsx(_components.p,{children:`채팅 완성에 사용된 모델.`})}),`\n`,_jsxs(ResponseField,{name:`choices`,type:`object[]`,id:`param-choices`,children:[_jsxs(_components.p,{children:[`채팅 완성 선택지 목록. `,_jsx(_components.code,{children:`n`}),`이 1보다 큰 경우 둘 이상일 수 있습니다.`]}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ResponseField,{name:`index`,type:`integer`,id:`param-index`,children:_jsx(_components.p,{children:`선택지 목록에서의 인덱스.`})}),_jsxs(ResponseField,{name:`message`,type:`object`,id:`param-message`,children:[_jsx(_components.p,{children:`모델이 생성한 채팅 완성 메시지.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ResponseField,{name:`role`,type:`string`,id:`param-role-1`,children:_jsxs(_components.p,{children:[`이 메시지 작성자의 역할. 항상 `,_jsx(_components.code,{children:`assistant`}),`.`]})}),_jsx(ResponseField,{name:`content`,type:`string | null`,id:`param-content-1`,children:_jsx(_components.p,{children:`메시지의 내용.`})}),_jsxs(ResponseField,{name:`tool_calls`,type:`object[]`,id:`param-tool-calls-1`,children:[_jsx(_components.p,{children:`함수 호출 등 모델이 생성한 도구 호출.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id-1`,children:_jsx(_components.p,{children:`도구 호출의 ID.`})}),_jsx(ResponseField,{name:`type`,type:`string`,id:`param-type-2`,children:_jsxs(_components.p,{children:[`도구의 유형. 현재 `,_jsx(_components.code,{children:`function`}),`만 지원됩니다.`]})}),_jsxs(ResponseField,{name:`function`,type:`object`,id:`param-function-1`,children:[_jsx(_components.p,{children:`모델이 호출한 함수.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ResponseField,{name:`name`,type:`string`,id:`param-name-2`,children:_jsx(_components.p,{children:`호출할 함수의 이름.`})}),_jsx(ResponseField,{name:`arguments`,type:`string`,id:`param-arguments`,children:_jsx(_components.p,{children:`모델이 JSON 형식으로 생성한 함수 호출 인자.`})})]})]})]})]})]})]}),_jsx(ResponseField,{name:`finish_reason`,type:`string`,id:`param-finish-reason`,children:_jsxs(_components.p,{children:[`모델이 토큰 생성을 중단한 이유. `,_jsx(_components.code,{children:`stop`}),`, `,_jsx(_components.code,{children:`length`}),`, `,_jsx(_components.code,{children:`tool_calls`}),`, 또는 `,_jsx(_components.code,{children:`content_filter`}),`일 수 있습니다.`]})}),_jsx(ResponseField,{name:`logprobs`,type:`object | null`,id:`param-logprobs-1`,children:_jsx(_components.p,{children:`선택지에 대한 로그 확률 정보.`})})]})]}),`\n`,_jsxs(ResponseField,{name:`usage`,type:`object`,id:`param-usage`,children:[_jsx(_components.p,{children:`완성 요청의 사용량 통계.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ResponseField,{name:`prompt_tokens`,type:`integer`,id:`param-prompt-tokens`,children:_jsx(_components.p,{children:`프롬프트의 토큰 수.`})}),_jsx(ResponseField,{name:`completion_tokens`,type:`integer`,id:`param-completion-tokens`,children:_jsx(_components.p,{children:`생성된 완성의 토큰 수.`})}),_jsx(ResponseField,{name:`total_tokens`,type:`integer`,id:`param-total-tokens`,children:_jsx(_components.p,{children:`요청에 사용된 총 토큰 수(프롬프트 + 완성).`})})]})]}),`\n`,_jsx(ResponseField,{name:`system_fingerprint`,type:`string | null`,id:`param-system-fingerprint`,children:_jsxs(_components.p,{children:[`모델이 실행되는 백엔드 구성을 나타내는 핑거프린트. `,_jsx(_components.code,{children:`seed`}),` 매개변수와 함께 사용하여 백엔드 변경 사항을 파악할 수 있습니다.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create a chat completion","api":"POST https://api-llm.sunra.ai/v1/chat/completions","description":null,"href":"/ko/llm/chat"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,ParamField,RequestExample,ResponseExample,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`지정된 채팅 대화에 대한 모델 응답 요청을 보냅니다. 스트리밍 및 비스트리밍 모드를 모두 지원합니다. OpenAI Chat Completions API 형식과 호환됩니다.`}),`\n`,_jsx(Heading,{level:`2`,id:`인증`,children:`인증`}),`\n`,_jsxs(ParamField,{header:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:[_jsx(_components.p,{children:`Bearer 토큰. API 키를 Authorization 헤더의 Bearer 토큰으로 사용하세요.`}),_jsxs(_components.p,{children:[`Format: `,_jsx(_components.code,{children:`Bearer \u003cSUNRA_KEY>`})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`요청`,children:`요청`}),`\n`,_jsx(_components.p,{children:`이 엔드포인트는 JSON 객체를 받습니다.`}),`\n`,_jsxs(ParamField,{body:`messages`,type:`object[]`,required:true,id:`param-messages`,children:[_jsx(_components.p,{children:`대화의 메시지 목록.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ParamField,{body:`role`,type:`string`,required:true,id:`param-role`,children:_jsxs(_components.p,{children:[`메시지 작성자의 역할. 지원되는 값: `,_jsx(_components.code,{children:`system`}),`, `,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`assistant`}),`, `,_jsx(_components.code,{children:`tool`}),`.`]})}),_jsx(ParamField,{body:`content`,type:`string | object[]`,required:true,id:`param-content`,children:_jsx(_components.p,{children:`메시지의 내용. 문자열 또는 멀티모달 입력을 위한 콘텐츠 파트 배열을 지정할 수 있습니다.`})}),_jsx(ParamField,{body:`name`,type:`string`,id:`param-name`,children:_jsx(_components.p,{children:`참여자의 선택적 이름. 동일한 역할의 참여자를 구분하기 위해 모델에 정보를 제공합니다.`})}),_jsx(ParamField,{body:`tool_calls`,type:`object[]`,id:`param-tool-calls`,children:_jsxs(_components.p,{children:[`함수 호출 등 모델이 생성한 도구 호출. `,_jsx(_components.code,{children:`assistant`}),` 메시지에만 존재합니다.`]})}),_jsx(ParamField,{body:`tool_call_id`,type:`string`,id:`param-tool-call-id`,children:_jsxs(_components.p,{children:[`이 메시지가 응답하는 도구 호출. `,_jsx(_components.code,{children:`tool`}),` 메시지에만 존재합니다.`]})})]})]}),`\n`,_jsx(ParamField,{body:`model`,type:`string`,required:true,id:`param-model`,children:_jsxs(_components.p,{children:[`완성에 사용할 모델. 사용 가능한 모델은 `,_jsx(_components.a,{href:`https://sunra.ai/models`,children:`sunra.ai/models`}),`에서 확인하세요.`]})}),`\n`,_jsx(ParamField,{body:`stream`,type:`boolean`,default:false,id:`param-stream`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),`로 설정하면 부분 메시지 델타가 서버 전송 이벤트(SSE)로 전송됩니다.`]})}),`\n`,_jsx(ParamField,{body:`max_tokens`,type:`integer`,id:`param-max-tokens`,children:_jsx(_components.p,{children:`완성에서 생성할 최대 토큰 수. 입력 토큰과 생성된 토큰의 총 길이는 모델의 컨텍스트 길이에 의해 제한됩니다.`})}),`\n`,_jsx(ParamField,{body:`temperature`,type:`number`,default:1,id:`param-temperature`,children:_jsx(_components.p,{children:`0에서 2 사이의 샘플링 온도. 0.8과 같은 높은 값은 출력을 더 무작위로 만들고, 0.2와 같은 낮은 값은 더 집중적이고 결정론적으로 만듭니다.`})}),`\n`,_jsx(ParamField,{body:`top_p`,type:`number`,default:1,id:`param-top-p`,children:_jsx(_components.p,{children:`핵 샘플링 매개변수(0-1). temperature 샘플링의 대안으로, 모델이 top_p 확률 질량을 가진 토큰을 고려합니다.`})}),`\n`,_jsx(ParamField,{body:`frequency_penalty`,type:`number`,default:0,id:`param-frequency-penalty`,children:_jsx(_components.p,{children:`-2.0에서 2.0 사이의 숫자. 양수 값은 텍스트에서의 기존 빈도를 기반으로 새 토큰에 페널티를 부과하여, 모델이 같은 문장을 그대로 반복할 가능성을 줄입니다.`})}),`\n`,_jsx(ParamField,{body:`presence_penalty`,type:`number`,default:0,id:`param-presence-penalty`,children:_jsx(_components.p,{children:`-2.0에서 2.0 사이의 숫자. 양수 값은 텍스트에 이미 나타났는지 여부를 기반으로 새 토큰에 페널티를 부과하여, 모델이 새로운 주제에 대해 이야기할 가능성을 높입니다.`})}),`\n`,_jsx(ParamField,{body:`stop`,type:`string | string[]`,id:`param-stop`,children:_jsx(_components.p,{children:`API가 추가 토큰 생성을 중단하는 최대 4개의 시퀀스.`})}),`\n`,_jsx(ParamField,{body:`n`,type:`integer`,default:1,id:`param-n`,children:_jsx(_components.p,{children:`각 입력 메시지에 대해 생성할 채팅 완성 선택지 수.`})}),`\n`,_jsx(ParamField,{body:`logprobs`,type:`boolean`,default:false,id:`param-logprobs`,children:_jsx(_components.p,{children:`출력 토큰의 로그 확률을 반환할지 여부. true인 경우, 메시지 내용에 반환된 각 출력 토큰의 로그 확률을 반환합니다.`})}),`\n`,_jsx(ParamField,{body:`top_logprobs`,type:`integer`,id:`param-top-logprobs`,children:_jsxs(_components.p,{children:[`각 토큰 위치에서 반환할 가장 가능성 높은 토큰 수를 지정하는 0에서 20 사이의 정수. 이 매개변수를 사용하려면 `,_jsx(_components.code,{children:`logprobs`}),`를 `,_jsx(_components.code,{children:`true`}),`로 설정해야 합니다.`]})}),`\n`,_jsxs(ParamField,{body:`response_format`,type:`object`,id:`param-response-format`,children:[_jsx(_components.p,{children:`모델이 출력해야 하는 형식을 지정하는 객체.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type`,children:_jsxs(_components.p,{children:[`응답 형식의 유형. 지원되는 값: `,_jsx(_components.code,{children:`text`}),`, `,_jsx(_components.code,{children:`json_object`}),`, `,_jsx(_components.code,{children:`json_schema`}),`.`]})}),_jsx(ParamField,{body:`json_schema`,type:`object`,id:`param-json-schema`,children:_jsxs(_components.p,{children:[`JSON 스키마 객체. type이 `,_jsx(_components.code,{children:`json_schema`}),`인 경우 필수입니다.`]})})]})]}),`\n`,_jsx(ParamField,{body:`seed`,type:`integer`,id:`param-seed`,children:_jsx(_components.p,{children:`지정된 경우, 시스템은 동일한 seed와 매개변수를 가진 반복 요청이 동일한 결과를 반환하도록 최선의 노력으로 결정론적 샘플링을 수행합니다.`})}),`\n`,_jsxs(ParamField,{body:`tools`,type:`object[]`,id:`param-tools`,children:[_jsx(_components.p,{children:`모델이 호출할 수 있는 도구 목록. 현재 함수만 도구로 지원됩니다.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-1`,children:_jsxs(_components.p,{children:[`도구의 유형. 현재 `,_jsx(_components.code,{children:`function`}),`만 지원됩니다.`]})}),_jsxs(ParamField,{body:`function`,type:`object`,required:true,id:`param-function`,children:[_jsx(_components.p,{children:`함수 정의.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ParamField,{body:`name`,type:`string`,required:true,id:`param-name-1`,children:_jsx(_components.p,{children:`호출할 함수의 이름.`})}),_jsx(ParamField,{body:`description`,type:`string`,id:`param-description`,children:_jsx(_components.p,{children:`함수가 수행하는 작업에 대한 설명.`})}),_jsx(ParamField,{body:`parameters`,type:`object`,id:`param-parameters`,children:_jsx(_components.p,{children:`함수가 허용하는 매개변수로, JSON Schema 객체로 설명됩니다.`})}),_jsx(ParamField,{body:`strict`,type:`boolean`,default:false,id:`param-strict`,children:_jsx(_components.p,{children:`엄격한 스키마 준수를 활성화할지 여부.`})})]})]})]})]}),`\n`,_jsx(ParamField,{body:`tool_choice`,type:`string | object`,id:`param-tool-choice`,children:_jsxs(_components.p,{children:[`모델이 어떤 도구를 호출할지(호출하는 경우) 제어합니다. `,_jsx(_components.code,{children:`none`}),`은 모델이 도구를 호출하지 않음을 의미합니다. `,_jsx(_components.code,{children:`auto`}),`는 모델이 메시지 생성 또는 도구 호출 중에서 선택할 수 있음을 의미합니다. `,_jsx(_components.code,{children:`required`}),`는 모델이 하나 이상의 도구를 호출해야 함을 의미합니다. `,_jsx(_components.code,{children:`{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}`}),`을 통해 특정 함수를 지정할 수도 있습니다.`]})}),`\n`,_jsx(ParamField,{body:`parallel_tool_calls`,type:`boolean`,default:true,id:`param-parallel-tool-calls`,children:_jsx(_components.p,{children:`도구 사용 시 병렬 함수 호출을 활성화할지 여부.`})}),`\n`,_jsx(ParamField,{body:`user`,type:`string`,id:`param-user`,children:_jsx(_components.p,{children:`최종 사용자를 나타내는 고유 식별자로, 남용 모니터링 및 감지에 도움이 될 수 있습니다.`})}),`\n`,_jsx(Heading,{level:`2`,id:`응답`,children:`응답`}),`\n`,_jsx(_components.p,{children:`채팅 완성 성공 응답.`}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id`,children:_jsx(_components.p,{children:`채팅 완성의 고유 식별자.`})}),`\n`,_jsx(ResponseField,{name:`object`,type:`string`,id:`param-object`,children:_jsxs(_components.p,{children:[`객체 유형. 항상 `,_jsx(_components.code,{children:`chat.completion`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`created`,type:`integer`,id:`param-created`,children:_jsx(_components.p,{children:`채팅 완성이 생성된 시점의 Unix 타임스탬프(초 단위).`})}),`\n`,_jsx(ResponseField,{name:`model`,type:`string`,id:`param-model-1`,children:_jsx(_components.p,{children:`채팅 완성에 사용된 모델.`})}),`\n`,_jsxs(ResponseField,{name:`choices`,type:`object[]`,id:`param-choices`,children:[_jsxs(_components.p,{children:[`채팅 완성 선택지 목록. `,_jsx(_components.code,{children:`n`}),`이 1보다 큰 경우 둘 이상일 수 있습니다.`]}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ResponseField,{name:`index`,type:`integer`,id:`param-index`,children:_jsx(_components.p,{children:`선택지 목록에서의 인덱스.`})}),_jsxs(ResponseField,{name:`message`,type:`object`,id:`param-message`,children:[_jsx(_components.p,{children:`모델이 생성한 채팅 완성 메시지.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ResponseField,{name:`role`,type:`string`,id:`param-role-1`,children:_jsxs(_components.p,{children:[`이 메시지 작성자의 역할. 항상 `,_jsx(_components.code,{children:`assistant`}),`.`]})}),_jsx(ResponseField,{name:`content`,type:`string | null`,id:`param-content-1`,children:_jsx(_components.p,{children:`메시지의 내용.`})}),_jsxs(ResponseField,{name:`tool_calls`,type:`object[]`,id:`param-tool-calls-1`,children:[_jsx(_components.p,{children:`함수 호출 등 모델이 생성한 도구 호출.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id-1`,children:_jsx(_components.p,{children:`도구 호출의 ID.`})}),_jsx(ResponseField,{name:`type`,type:`string`,id:`param-type-2`,children:_jsxs(_components.p,{children:[`도구의 유형. 현재 `,_jsx(_components.code,{children:`function`}),`만 지원됩니다.`]})}),_jsxs(ResponseField,{name:`function`,type:`object`,id:`param-function-1`,children:[_jsx(_components.p,{children:`모델이 호출한 함수.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ResponseField,{name:`name`,type:`string`,id:`param-name-2`,children:_jsx(_components.p,{children:`호출할 함수의 이름.`})}),_jsx(ResponseField,{name:`arguments`,type:`string`,id:`param-arguments`,children:_jsx(_components.p,{children:`모델이 JSON 형식으로 생성한 함수 호출 인자.`})})]})]})]})]})]})]}),_jsx(ResponseField,{name:`finish_reason`,type:`string`,id:`param-finish-reason`,children:_jsxs(_components.p,{children:[`모델이 토큰 생성을 중단한 이유. `,_jsx(_components.code,{children:`stop`}),`, `,_jsx(_components.code,{children:`length`}),`, `,_jsx(_components.code,{children:`tool_calls`}),`, 또는 `,_jsx(_components.code,{children:`content_filter`}),`일 수 있습니다.`]})}),_jsx(ResponseField,{name:`logprobs`,type:`object | null`,id:`param-logprobs-1`,children:_jsx(_components.p,{children:`선택지에 대한 로그 확률 정보.`})})]})]}),`\n`,_jsxs(ResponseField,{name:`usage`,type:`object`,id:`param-usage`,children:[_jsx(_components.p,{children:`완성 요청의 사용량 통계.`}),_jsxs(Expandable,{title:`속성`,children:[_jsx(ResponseField,{name:`prompt_tokens`,type:`integer`,id:`param-prompt-tokens`,children:_jsx(_components.p,{children:`프롬프트의 토큰 수.`})}),_jsx(ResponseField,{name:`completion_tokens`,type:`integer`,id:`param-completion-tokens`,children:_jsx(_components.p,{children:`생성된 완성의 토큰 수.`})}),_jsx(ResponseField,{name:`total_tokens`,type:`integer`,id:`param-total-tokens`,children:_jsx(_components.p,{children:`요청에 사용된 총 토큰 수(프롬프트 + 완성).`})})]})]}),`\n`,_jsx(ResponseField,{name:`system_fingerprint`,type:`string | null`,id:`param-system-fingerprint`,children:_jsxs(_components.p,{children:[`모델이 실행되는 백엔드 구성을 나타내는 핑거프린트. `,_jsx(_components.code,{children:`seed`}),` 매개변수와 함께 사용하여 백엔드 변경 사항을 파악할 수 있습니다.`]})}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`16`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api-llm.sunra.ai/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer \u003cSUNRA_KEY>\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"openai/gpt-4o\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"role\": \"system\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\": \"You are a helpful assistant.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"role\": \"user\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\": \"What is the capital of France?\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`17`,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:`17`,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\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api-llm.sunra.ai/v1/chat/completions\"`}),_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:` 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:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer \u003cSUNRA_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\"`})]}),`\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:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_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:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai/gpt-4o\"`}),_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:` \"messages\"`}),_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\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"system\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"You are a helpful assistant.\"`}),_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\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"What is the capital of France?\"`}),_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`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\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:`(response.json())`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`16`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`16`,children:[_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:` 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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api-llm.sunra.ai/v1/chat/completions\"`}),_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:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POST\"`}),_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:` headers:`}),_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:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Bearer \u003cSUNRA_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\"`})]}),`\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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_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:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"openai/gpt-4o\"`}),_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:` messages:`}),_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\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"system\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"You are a helpful assistant.\"`}),_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\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"What is the capital of France?\"`}),_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`,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\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` data`}),_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:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_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:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})})]}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`200`,numberOfLines:`23`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`23`,children:[_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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chatcmpl-abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chat.completion\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1677652288`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai/gpt-4o\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"choices\"`}),_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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"index\"`}),_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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The capital of France is Paris.\"`})]}),`\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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"finish_reason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stop\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"logprobs\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"system_fingerprint\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"fp_44709d6fcb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"prompt_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`25`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"completion_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"total_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`33`})]}),`\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`]})})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create a chat completion","api":"POST https://api-llm.sunra.ai/v1/chat/completions","description":null,"href":"/ko/llm/chat"}}}},"mdxExtracts":{"tableOfContents":[{"title":"인증","slug":"인증","depth":2,"children":[]},{"title":"요청","slug":"요청","depth":2,"children":[]},{"title":"응답","slug":"응답","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"16\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://api-llm.sunra.ai/v1/chat/completions\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization: Bearer \u0026#x3C;SUNRA_KEY>\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type: application/json\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -d\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"model\": \"openai/gpt-4o\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"messages\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"role\": \"system\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"content\": \"You are a helpful assistant.\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"role\": \"user\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"content\": \"What is the capital of France?\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Python","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"17\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">import\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">response \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests.post(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"https://api-llm.sunra.ai/v1/chat/completions\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> headers\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Bearer \u0026#x3C;SUNRA_KEY>\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"application/json\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> json\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"model\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"openai/gpt-4o\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"messages\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"role\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"system\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"content\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"You are a helpful assistant.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"role\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"user\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"content\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"What is the capital of France?\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">print\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(response.json())\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"JavaScript","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"16\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> response\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> fetch\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://api-llm.sunra.ai/v1/chat/completions\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> method:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"POST\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> headers:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Bearer \u0026#x3C;SUNRA_KEY>\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"application/json\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> body:\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> JSON\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">stringify\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">({\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> model:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"openai/gpt-4o\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> messages:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">role:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"system\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">content:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"You are a helpful assistant.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">role:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"user\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">content:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"What is the capital of France?\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> })\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">});\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> data\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> response\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">json\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">();\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">console\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">log\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">data\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"200","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"23\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"chatcmpl-abc123\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"object\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"chat.completion\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"created\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">1677652288\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"model\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"openai/gpt-4o\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"choices\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"index\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"role\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"assistant\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"content\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"The capital of France is Paris.\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"finish_reason\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"stop\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"logprobs\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"system_fingerprint\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"fp_44709d6fcb\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"usage\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"prompt_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">25\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"completion_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">8\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"total_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">33\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Create a chat completion","path":"/v1/chat/completions","servers":[{"url":"https://api-llm.sunra.ai"}],"method":"post","request":{"security":[],"parameters":{"query":{},"header":{"Authorization":{"schema":[{"type":"string","description":"Bearer 토큰. API 키를 Authorization 헤더의 Bearer 토큰으로 사용하세요. Format: `Bearer \u003cSUNRA_KEY>`","required":true}]}},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"messages":[{"type":"array","items":[{"type":"object","properties":{"role":[{"type":"string","description":"메시지 작성자의 역할. 지원되는 값: `system` , `user` , `assistant` , `tool` .","required":true}],"content":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"메시지의 내용. 문자열 또는 멀티모달 입력을 위한 콘텐츠 파트 배열을 지정할 수 있습니다.","required":true}],"name":[{"type":"string","description":"참여자의 선택적 이름. 동일한 역할의 참여자를 구분하기 위해 모델에 정보를 제공합니다."}],"tool_calls":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"함수 호출 등 모델이 생성한 도구 호출. `assistant` 메시지에만 존재합니다."}],"tool_call_id":[{"type":"string","description":"이 메시지가 응답하는 도구 호출. `tool` 메시지에만 존재합니다."}]}}],"description":"대화의 메시지 목록.","required":true}],"model":[{"type":"string","description":"완성에 사용할 모델. 사용 가능한 모델은 sunra.ai/models 에서 확인하세요.","required":true}],"stream":[{"type":"boolean","description":"`true` 로 설정하면 부분 메시지 델타가 서버 전송 이벤트(SSE)로 전송됩니다."}],"max_tokens":[{"type":"integer","description":"완성에서 생성할 최대 토큰 수. 입력 토큰과 생성된 토큰의 총 길이는 모델의 컨텍스트 길이에 의해 제한됩니다."}],"temperature":[{"type":"number","description":"0에서 2 사이의 샘플링 온도. 0.8과 같은 높은 값은 출력을 더 무작위로 만들고, 0.2와 같은 낮은 값은 더 집중적이고 결정론적으로 만듭니다."}],"top_p":[{"type":"number","description":"핵 샘플링 매개변수(0-1). temperature 샘플링의 대안으로, 모델이 top_p 확률 질량을 가진 토큰을 고려합니다."}],"frequency_penalty":[{"type":"number","description":"-2.0에서 2.0 사이의 숫자. 양수 값은 텍스트에서의 기존 빈도를 기반으로 새 토큰에 페널티를 부과하여, 모델이 같은 문장을 그대로 반복할 가능성을 줄입니다."}],"presence_penalty":[{"type":"number","description":"-2.0에서 2.0 사이의 숫자. 양수 값은 텍스트에 이미 나타났는지 여부를 기반으로 새 토큰에 페널티를 부과하여, 모델이 새로운 주제에 대해 이야기할 가능성을 높입니다."}],"stop":[{"type":"array","items":[{"type":"string"}],"description":"API가 추가 토큰 생성을 중단하는 최대 4개의 시퀀스."}],"n":[{"type":"integer","description":"각 입력 메시지에 대해 생성할 채팅 완성 선택지 수."}],"logprobs":[{"type":"boolean","description":"출력 토큰의 로그 확률을 반환할지 여부. true인 경우, 메시지 내용에 반환된 각 출력 토큰의 로그 확률을 반환합니다."}],"top_logprobs":[{"type":"integer","description":"각 토큰 위치에서 반환할 가장 가능성 높은 토큰 수를 지정하는 0에서 20 사이의 정수. 이 매개변수를 사용하려면 `logprobs` 를 `true` 로 설정해야 합니다."}],"response_format":[{"type":"object","properties":{"type":[{"type":"string","description":"응답 형식의 유형. 지원되는 값: `text` , `json_object` , `json_schema` .","required":true}],"json_schema":[{"type":"object","properties":{},"description":"JSON 스키마 객체. type이 `json_schema` 인 경우 필수입니다."}]},"description":"모델이 출력해야 하는 형식을 지정하는 객체."}],"seed":[{"type":"integer","description":"지정된 경우, 시스템은 동일한 seed와 매개변수를 가진 반복 요청이 동일한 결과를 반환하도록 최선의 노력으로 결정론적 샘플링을 수행합니다."}],"tools":[{"type":"array","items":[{"type":"object","properties":{"type":[{"type":"string","description":"도구의 유형. 현재 `function` 만 지원됩니다.","required":true}],"function":[{"type":"object","properties":{"name":[{"type":"string","description":"호출할 함수의 이름.","required":true}],"description":[{"type":"string","description":"함수가 수행하는 작업에 대한 설명."}],"parameters":[{"type":"object","properties":{},"description":"함수가 허용하는 매개변수로, JSON Schema 객체로 설명됩니다."}],"strict":[{"type":"boolean","description":"엄격한 스키마 준수를 활성화할지 여부."}]},"description":"함수 정의.","required":true}]}}],"description":"모델이 호출할 수 있는 도구 목록. 현재 함수만 도구로 지원됩니다."}],"tool_choice":[{"type":"object","properties":{},"description":"모델이 어떤 도구를 호출할지(호출하는 경우) 제어합니다. `none` 은 모델이 도구를 호출하지 않음을 의미합니다. `auto` 는 모델이 메시지 생성 또는 도구 호출 중에서 선택할 수 있음을 의미합니다. `required` 는 모델이 하나 이상의 도구를 호출해야 함을 의미합니다. `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` 을 통해 특정 함수를 지정할 수도 있습니다."}],"parallel_tool_calls":[{"type":"boolean","description":"도구 사용 시 병렬 함수 호출을 활성화할지 여부."}],"user":[{"type":"string","description":"최종 사용자를 나타내는 고유 식별자로, 남용 모니터링 및 감지에 도움이 될 수 있습니다."}]}}],"examples":{"example":{"value":{"messages":[{"role":"\u003cstring>","content":[{}],"name":"\u003cstring>","tool_calls":[{}],"tool_call_id":"\u003cstring>"}],"model":"\u003cstring>","stream":true,"max_tokens":123,"temperature":123,"top_p":123,"frequency_penalty":123,"presence_penalty":123,"stop":["\u003cstring>"],"n":123,"logprobs":true,"top_logprobs":123,"response_format":{"type":"\u003cstring>","json_schema":{}},"seed":123,"tools":[{"type":"\u003cstring>","function":{"name":"\u003cstring>","description":"\u003cstring>","parameters":{},"strict":true}}],"tool_choice":{},"parallel_tool_calls":true,"user":"\u003cstring>"}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"id":[{"type":"string","description":"채팅 완성의 고유 식별자."}],"object":[{"type":"string","description":"객체 유형. 항상 `chat.completion` ."}],"created":[{"type":"integer","description":"채팅 완성이 생성된 시점의 Unix 타임스탬프(초 단위)."}],"model":[{"type":"string","description":"채팅 완성에 사용된 모델."}],"choices":[{"type":"array","items":[{"type":"object","properties":{"index":[{"type":"integer","description":"선택지 목록에서의 인덱스."}],"message":[{"type":"object","properties":{"role":[{"type":"string","description":"이 메시지 작성자의 역할. 항상 `assistant` ."}],"content":[{"type":"object","properties":{},"description":"메시지의 내용."}],"tool_calls":[{"type":"array","items":[{"type":"object","properties":{"id":[{"type":"string","description":"도구 호출의 ID."}],"type":[{"type":"string","description":"도구의 유형. 현재 `function` 만 지원됩니다."}],"function":[{"type":"object","properties":{"name":[{"type":"string","description":"호출할 함수의 이름."}],"arguments":[{"type":"string","description":"모델이 JSON 형식으로 생성한 함수 호출 인자."}]},"description":"모델이 호출한 함수."}]}}],"description":"함수 호출 등 모델이 생성한 도구 호출."}]},"description":"모델이 생성한 채팅 완성 메시지."}],"finish_reason":[{"type":"string","description":"모델이 토큰 생성을 중단한 이유. `stop` , `length` , `tool_calls` , 또는 `content_filter` 일 수 있습니다."}],"logprobs":[{"type":"object","properties":{},"description":"선택지에 대한 로그 확률 정보."}]}}],"description":"채팅 완성 선택지 목록. `n` 이 1보다 큰 경우 둘 이상일 수 있습니다."}],"usage":[{"type":"object","properties":{"prompt_tokens":[{"type":"integer","description":"프롬프트의 토큰 수."}],"completion_tokens":[{"type":"integer","description":"생성된 완성의 토큰 수."}],"total_tokens":[{"type":"integer","description":"요청에 사용된 총 토큰 수(프롬프트 + 완성)."}]},"description":"완성 요청의 사용량 통계."}],"system_fingerprint":[{"type":"object","properties":{},"description":"모델이 실행되는 백엔드 구성을 나타내는 핑거프린트. `seed` 매개변수와 함께 사용하여 백엔드 변경 사항을 파악할 수 있습니다."}]}}],"examples":{"example":{"value":{"id":"\u003cstring>","object":"\u003cstring>","created":123,"model":"\u003cstring>","choices":[{"index":123,"message":{"role":"\u003cstring>","content":{},"tool_calls":[{"id":"\u003cstring>","type":"\u003cstring>","function":{"name":"\u003cstring>","arguments":"\u003cstring>"}}]},"finish_reason":"\u003cstring>","logprobs":{}}],"usage":{"prompt_tokens":123,"completion_tokens":123,"total_tokens":123},"system_fingerprint":{}}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"sunraai","siteName":"Sunra.ai","title":"Create a chat completion - Sunra.ai","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/llm/chat","matchLevel":1},"zh-Hans":{"href":"/zh-Hans/llm/chat","matchLevel":1},"zh-Hant":{"href":"/zh-Hant/llm/chat","matchLevel":1},"fr":{"href":"/fr/llm/chat","matchLevel":1},"ja":{"href":"/ja/llm/chat","matchLevel":1},"es":{"href":"/es/llm/chat","matchLevel":1},"pt":{"href":"/pt/llm/chat","matchLevel":1},"hi":{"href":"/hi/llm/chat","matchLevel":1},"tr":{"href":"/tr/llm/chat","matchLevel":1},"de":{"href":"/de/llm/chat","matchLevel":1},"id":{"href":"/id/llm/chat","matchLevel":1},"it":{"href":"/it/llm/chat","matchLevel":1},"ko":{"href":"/ko/llm/chat","matchLevel":0},"ru":{"href":"/ru/llm/chat","matchLevel":1}}},"lastModified":"2026-09-19T11:27:31.042Z","originalFileLocation":"ko/llm/chat.mdx","locale":"ko"},"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=\"application-name\" content=\"Sunra.ai\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create a chat completion - Sunra.ai\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Sunra.ai\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.sunra.ai/ko/llm/chat\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://sunraai.mintlify.app/_mintlify/api/og/v2?division=LLM\u0026amp;title=Create+a+chat+completion\u0026amp;theme=bd1a022ff2457f18109208ab\u0026amp;signature=83c1199f4df77e8931a3187c0967ee0b6fbe9aec822103bf1d36a23782043d7a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create a chat completion - Sunra.ai\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://sunraai.mintlify.app/_mintlify/api/og/v2?division=LLM\u0026amp;title=Create+a+chat+completion\u0026amp;theme=bd1a022ff2457f18109208ab\u0026amp;signature=83c1199f4df77e8931a3187c0967ee0b6fbe9aec822103bf1d36a23782043d7a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Sunra.ai\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#ff632f\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.sunra.ai/ko/llm/chat\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/ko/llm/chat.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://docs.sunra.ai/ko/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.sunra.ai/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hans\" href=\"https://docs.sunra.ai/zh-Hans/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hant\" href=\"https://docs.sunra.ai/zh-Hant/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"fr\" href=\"https://docs.sunra.ai/fr/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://docs.sunra.ai/ja/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"es\" href=\"https://docs.sunra.ai/es/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"pt\" href=\"https://docs.sunra.ai/pt/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"hi\" href=\"https://docs.sunra.ai/hi/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"tr\" href=\"https://docs.sunra.ai/tr/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"de\" href=\"https://docs.sunra.ai/de/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"id\" href=\"https://docs.sunra.ai/id/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"it\" href=\"https://docs.sunra.ai/it/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ru\" href=\"https://docs.sunra.ai/ru/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.sunra.ai/llm/chat\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.sunra.ai/#organization\",\"name\":\"Sunra.ai\",\"url\":\"https://docs.sunra.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/sunraai/U2o8uzmv75no70tM/logo/light.svg?fit=max\u0026auto=format\u0026n=U2o8uzmv75no70tM\u0026q=85\u0026s=520c0afb29ad1fddc46fec66c975eb2a\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.sunra.ai#website\",\"name\":\"Sunra.ai\",\"url\":\"https://docs.sunra.ai\",\"publisher\":{\"@id\":\"https://docs.sunra.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.sunra.ai/ko/llm/chat#webpage\",\"url\":\"https://docs.sunra.ai/ko/llm/chat\",\"name\":\"Create a chat completion\",\"dateModified\":\"2026-09-19T11:27:31.042Z\",\"isPartOf\":{\"@id\":\"https://docs.sunra.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.sunra.ai/ko/llm/chat#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.sunra.ai/ko/llm/chat#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"LLM\",\"item\":\"https://docs.sunra.ai/ko/llm/llm-quickstart\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a chat completion\",\"item\":\"https://docs.sunra.ai/ko/llm/chat\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.sunra.ai/ko/llm/chat#apireference\",\"headline\":\"Create a chat completion\",\"name\":\"Create a chat completion\",\"url\":\"https://docs.sunra.ai/ko/llm/chat\",\"mainEntityOfPage\":{\"@id\":\"https://docs.sunra.ai/ko/llm/chat#webpage\"},\"dateModified\":\"2026-09-19T11:27:31.042Z\",\"publisher\":{\"@id\":\"https://docs.sunra.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.sunra.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Sunra.ai\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Sunra.ai","nav":{"global":{"anchors":[{"anchor":"X (Twitter)","icon":"x-twitter","href":"https://x.com/sunra_ai"},{"anchor":"Discord","icon":"discord","href":"https://discord.gg/897qCzvCcU"},{"anchor":"GitHub","icon":"github","href":"https://github.com/sunra-ai"}]},"languages":[{"language":"en","pages":[{"title":"en","href":"/llm/chat"}]},{"language":"zh-Hans","pages":[{"title":"zh-Hans","href":"/zh-Hans/llm/chat"}]},{"language":"zh-Hant","pages":[{"title":"zh-Hant","href":"/zh-Hant/llm/chat"}]},{"language":"fr","pages":[{"title":"fr","href":"/fr/llm/chat"}]},{"language":"ja","pages":[{"title":"ja","href":"/ja/llm/chat"}]},{"language":"es","pages":[{"title":"es","href":"/es/llm/chat"}]},{"language":"pt","pages":[{"title":"pt","href":"/pt/llm/chat"}]},{"language":"hi","pages":[{"title":"hi","href":"/hi/llm/chat"}]},{"language":"tr","pages":[{"title":"tr","href":"/tr/llm/chat"}]},{"language":"de","pages":[{"title":"de","href":"/de/llm/chat"}]},{"language":"id","pages":[{"title":"id","href":"/id/llm/chat"}]},{"language":"it","pages":[{"title":"it","href":"/it/llm/chat"}]},{"language":"ko","groups":[{"group":"개요","pages":[{"title":"소개","href":"/ko"}]},{"group":"Multimodal","pages":[{"title":"빠른 시작","href":"/ko/multimodal/quickstart"},{"title":"텍스트-이미지 변환","href":"/ko/multimodal/text-to-image"},{"title":"텍스트-비디오 변환","href":"/ko/multimodal/text-to-video"},{"title":"이미지-비디오 변환","href":"/ko/multimodal/image-to-video"},{"title":"음성-텍스트 변환","href":"/ko/multimodal/speech-to-text"},{"title":"MCP 서버","href":"/ko/multimodal/mcp-server-setup"},{"title":"대기열","href":"/ko/multimodal/queue"},{"title":"서버 측 통합","href":"/ko/multimodal/server-side-integration"},{"title":"오류","href":"/ko/multimodal/error"}]},{"group":"LLM","pages":[{"title":"LLM 빠른 시작","href":"/ko/llm/llm-quickstart"},{"title":"토큰 사용량","description":null,"href":"/ko/llm/token-usage"},{"title":"Create a chat completion","api":"POST https://api-llm.sunra.ai/v1/chat/completions","href":"/ko/llm/chat"},{"title":"Create a message","api":"POST https://api-llm.sunra.ai/v1/messages","description":null,"href":"/ko/llm/messages"},{"title":"Create a response","api":"POST https://api-llm.sunra.ai/v1/responses","href":"/ko/llm/responses"},{"title":"Create embeddings","api":"POST https://api-llm.sunra.ai/v1/embeddings","href":"/ko/llm/embeddings"}]},{"group":"클라이언트 라이브러리","pages":[{"title":"JavaScript / TypeScript","href":"/ko/client-libraries/javascript"},{"title":"Python","href":"/ko/client-libraries/python"},{"title":"Java","href":"/ko/client-libraries/java"},{"title":"새 클라이언트 요청","href":"/ko/client-libraries/request-new-client"}]}]},{"language":"ru","pages":[{"title":"ru","href":"/ru/llm/chat"}]}]},"basePath":"","title":"Create a chat completion - Sunra.ai","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":["10e4515597","c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["BannerMarkdown-DHaG7hr_.js","dist-DKZWslLH.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-BIWXJmsZ.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","OpenApiReferenceProvider-DCDCdBVX.js","utils-ME8dDnLe.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-0e84ACsd.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-wgRBj-ia.js","snippetPresets-C11Sgb-o.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-C0lapOpP.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-ZeRQV8fF.js","shallow-BupWh095.js","getApiPlaygroundDisplay-BnYQO2Ss.js","CodeSnippet-RKKOc8c_.js","CodeSnippets-Drf_m8wS.js","Page-Bevw23-4.js","getPastedJson-u6QiPzNZ.js","icon-Bb-CBSxO.js","MethodPill-F7l5AI7V.js","DuplicateIcon-IiAXkdSg.js","createIcon-FliI8EBc.js","DynamicMarkdown-B62XqCSI.js","SectionHeading-Dj31pT03.js","axios-vUo_bRtp.js"]}