SecureAI expone una superficie compatible con OpenAI para que pueda integrarse con cualquier SDK de OpenAI cambiando solo la URL base y la clave API, sin cambios de código. La pila de seguridad completa de SecureAI (autenticación de clave API, listas permitidas de modelo/índice, aplicación de políticas SMLTP + derechos, Prompt Shield, PII/DLP, facturación de puntos y el motor de redundancia de modelo) se ejecuta debajo.
Solo conocimiento ceroEsta superficie no admite RAG/bases de conocimiento. Las solicitudes están fijadas en Zero-Knowledge. Si necesita recuperar la base de conocimientos, utilice el endpoint clásico Finalización del chat.
Se admiten campos estándar de OpenAI. Se requiere messages (no hay prompt en esta superficie). max_completion_tokens se acepta como alias para max_tokens.Los siguientes parámetros de OpenAI se pasan al proveedor tal cual:tools, tool_choice, parallel_tool_calls, response_format, stop, top_p, frequency_penalty, presence_penalty, seed, logprobs, top_logprobs, user.
Establezca stream: true. Los marcos son objetos nativos de OpenAI chat.completion.chunk terminados en data: [DONE]. La extensión secureai está adjunta al primer fragmento. choices (incluidos los deltas de tool_calls y finish_reason) pasan intactos.
Los errores de este controlador utilizan el sobre OpenAI:
{ "error": { "message": "you must provide a model parameter", "type": "invalid_request_error", "code": null } }
Cuando falla toda una cadena de redundancia, el error utiliza code: "all_models_failed" y el estado 429 (todos los límites de velocidad) o 502 (de lo contrario). Los rechazos de middleware de seguridad mantienen la forma de SecureAI { "success": false, ... }; ambos siempre llevan un message.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"SecureAI","colors":{"primary":"#0066FF","light":"#0066FF","dark":"#0066FF"},"logo":{"light":"https://mintcdn.com/hiper-ai/OxdQRluHRfLLri8S/img/hiper_ai_official.png?fit=max\u0026auto=format\u0026n=OxdQRluHRfLLri8S\u0026q=85\u0026s=497afb0927d9949816a66f9bb841682b","dark":"https://mintcdn.com/hiper-ai/OxdQRluHRfLLri8S/img/logo-darkmode.png?fit=max\u0026auto=format\u0026n=OxdQRluHRfLLri8S\u0026q=85\u0026s=dd347e4a4b72c2737dbc17a8851c85d6"},"favicon":"https://mintcdn.com/hiper-ai/OxdQRluHRfLLri8S/img/HiperAI-logo-dark.png?fit=max\u0026auto=format\u0026n=OxdQRluHRfLLri8S\u0026q=85\u0026s=aed824f70d135b0e4d35c8a4b7eaac43","api":{"openapi":"openapi.yaml","playground":{"display":"interactive"},"examples":{"languages":["bash","python","javascript"]}},"navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"Support"}]},"footer":{"socials":{"x":"https://twitter.com/hiperai","github":"https://github.com/hiperai","linkedin":"https://linkedin.com/company/hiperai"}},"integrations":{"ga4":{"measurementId":"G-XXXXXXXXXX"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"languages":[{"language":"es","default":true,"navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"Soporte"}]},"href":"intro"},{"language":"en","navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"Support"}]},"href":"en/intro"},{"language":"zh","navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"技术支持"}]},"href":"zh/intro"},{"language":"pt","navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"Suporte"}]},"href":"pt/intro"},{"language":"ja","navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"サポート"}]},"href":"ja/intro"},{"language":"fr","navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"Support"}]},"href":"fr/intro"},{"language":"de","navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"Support"}]},"href":"de/intro"},{"language":"ko","navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"고객지원"}]},"href":"ko/intro"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"hiper-ai","hasAudioNarration":false,"actualSubdomain":"hiper-ai","customDomains":["docs.hiperai.com"],"gitSource":{"type":"github","owner":"hiper-ai","repo":"secureai-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6ad6b4b017d9e3869f145d89","collectionId":"386a397d-7605-4379-a3a6-356107733de6","liveDeploymentHistoryId":"6ad6b4b017d9e3869f145d89","schemaVersion":"v3"},"feedback":{"thumbs":true,"issues":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ad6b4b017d9e3869f145d89","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"es","tag":"Referencia API","count":40},{"language":"de","tag":"API-Referenz","count":40},{"language":"en","tag":"API Reference","count":40},{"language":"fr","tag":"Référence API","count":40},{"language":"ja","tag":"API リファレンス","count":40},{"language":"ko","tag":"API 레퍼런스","count":40},{"language":"pt","tag":"Referência da API","count":40},{"language":"zh","tag":"API 参考","count":40},{"language":"es","tag":"Documentación","count":28},{"language":"de","tag":"Dokumentation","count":28},{"language":"en","tag":"Documentation","count":28},{"language":"fr","tag":"Documentation","count":28},{"language":"ja","tag":"ドキュメント","count":28},{"language":"ko","tag":"문서","count":28},{"language":"pt","tag":"Documentação","count":28},{"language":"zh","tag":"文档","count":28},{"language":"es","tag":"Integraciones","count":20},{"language":"en","tag":"Integrations","count":20},{"language":"de","tag":"Integrationen","count":17},{"language":"fr","tag":"Intégrations","count":17},{"language":"ja","tag":"連携","count":17},{"language":"ko","tag":"연동","count":17},{"language":"pt","tag":"Integrações","count":17},{"language":"zh","tag":"集成","count":17},{"language":"es","tag":"Modelos y Generación AI","count":9},{"language":"de","tag":"Modelle \u0026 KI-Generierung","count":9},{"language":"en","tag":"Models \u0026 AI Generation","count":9},{"language":"fr","tag":"Modèles \u0026 Génération IA","count":9},{"language":"ja","tag":"モデル \u0026 AI 生成","count":9},{"language":"ko","tag":"모델 및 AI 생성","count":9},{"language":"pt","tag":"Modelos \u0026 Geração de IA","count":9},{"language":"zh","tag":"模型与 AI 生成","count":9},{"language":"es","tag":"Seguridad, Guardrails y Auditoría","count":8},{"language":"es","tag":"Usuarios y Acceso (IAM)","count":8},{"language":"de","tag":"Sicherheit, Guardrails \u0026 Auditierung","count":8},{"language":"de","tag":"Benutzer \u0026 Zugriff (IAM)","count":8},{"language":"en","tag":"Security, Guardrails \u0026 Auditing","count":8},{"language":"en","tag":"Users \u0026 Access (IAM)","count":8},{"language":"fr","tag":"Sécurité, Guardrails \u0026 Audit","count":8},{"language":"fr","tag":"Utilisateurs \u0026 Accès (IAM)","count":8},{"language":"ja","tag":"セキュリティ、ガードレール \u0026 監査","count":8},{"language":"ja","tag":"ユーザー \u0026 アクセス (IAM)","count":8},{"language":"ko","tag":"보안, 가드레일 및 감사","count":8},{"language":"ko","tag":"사용자 및 접근 (IAM)","count":8},{"language":"pt","tag":"Segurança, Guardrails \u0026 Auditoria","count":8},{"language":"pt","tag":"Usuários \u0026 Acesso (IAM)","count":8},{"language":"zh","tag":"安全、护栏与审计","count":8},{"language":"zh","tag":"用户与访问 (IAM)","count":8},{"language":"es","tag":"Endpoint Agent","count":7},{"language":"de","tag":"Endpoint Agent","count":7},{"language":"en","tag":"Endpoint Agent","count":7},{"language":"fr","tag":"Agent Endpoint","count":7},{"language":"ja","tag":"エンドポイントエージェント","count":7},{"language":"ko","tag":"엔드포인트 에이전트","count":7},{"language":"pt","tag":"Endpoint Agent","count":7},{"language":"zh","tag":"终端代理 (Endpoint Agent)","count":7},{"language":"es","tag":"Facturación, Cuotas y Webhooks","count":6},{"language":"es","tag":"Knowledge Base y RAG","count":6},{"language":"es","tag":"Cloud, NHI y gestión","count":6},{"language":"de","tag":"Abrechnung, Kontingente \u0026 Webhooks","count":6},{"language":"de","tag":"Knowledge Base \u0026 RAG","count":6},{"language":"en","tag":"Billing, Quotas \u0026 Webhooks","count":6},{"language":"en","tag":"Knowledge Base \u0026 RAG","count":6},{"language":"en","tag":"Cloud, NHI \u0026 Management","count":6},{"language":"fr","tag":"Facturation, Quotas \u0026 Webhooks","count":6},{"language":"fr","tag":"Base de Connaissances \u0026 RAG","count":6},{"language":"ja","tag":"請求、クォータ \u0026 Webhook","count":6},{"language":"ja","tag":"ナレッジベース \u0026 RAG","count":6},{"language":"ko","tag":"청구, 할당량 및 웹훅","count":6},{"language":"ko","tag":"지식 베이스 및 RAG","count":6},{"language":"pt","tag":"Faturamento, Cotas \u0026 Webhooks","count":6},{"language":"pt","tag":"Knowledge Base \u0026 RAG","count":6},{"language":"zh","tag":"计费、配额与 Webhook","count":6},{"language":"zh","tag":"知识库与 RAG","count":6},{"language":"de","tag":"Erste Schritte","count":5},{"language":"fr","tag":"Premiers Pas","count":5},{"language":"ja","tag":"はじめに","count":5},{"language":"ko","tag":"시작하기","count":5},{"language":"pt","tag":"Primeiros Passos","count":5},{"language":"zh","tag":"起步入门","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".dark img[src$=\"/img/icons/openai.svg\"],.dark img[src$=\"/img/icons/anthropic.svg\"],.dark img[src$=\"/img/icons/splunk.svg\"]{filter:invert(1)}"}],"page":{"pagePath":"api/chat/openai-compatible","slug":"/api/chat/openai-compatible","pageMetadata":{"sidebar_position":2,"title":"Compatibilidad con OpenAI","sidebar_label":"Compatible con OpenAI","description":"Superficie de finalización de chat OpenAI directa: apunte cualquier SDK de OpenAI a SecureAI","openapi":"POST /v1/chat/completions","href":"/api/chat/openai-compatible"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Superficie de finalización de chat OpenAI directa: apunte cualquier SDK de OpenAI a SecureAI\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Info,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`1`,id:`endpoint-compatible-con-openai`,children:`Endpoint compatible con OpenAI`}),`\n`,_jsxs(_components.p,{children:[`SecureAI expone una superficie compatible con OpenAI para que pueda integrarse con `,_jsx(_components.strong,{children:`cualquier SDK de OpenAI cambiando solo la URL base y la clave API`}),`, sin cambios de código. La pila de seguridad completa de SecureAI (autenticación de clave API, listas permitidas de modelo/índice, aplicación de políticas SMLTP + derechos, Prompt Shield, PII/DLP, facturación de puntos y el `,_jsx(_components.a,{href:`/api/redundancia`,children:`motor de redundancia de modelo`}),`) se ejecuta debajo.`]}),`\n`,_jsx(Heading,{level:`2`,id:`endpoint`,children:`Endpoint`}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST /api/external/v1/chat/completions`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /api/external/v1/models`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Apunte el `,_jsx(_components.code,{children:`base_url`}),` de su cliente OpenAI a:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://{customer.name}.hiperai.ai/api/external/v1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(Info,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Solo conocimiento cero`})}),_jsxs(_components.p,{children:[`Esta superficie `,_jsx(_components.strong,{children:`no`}),` admite RAG/bases de conocimiento. Las solicitudes están fijadas en `,_jsx(_components.code,{children:`Zero-Knowledge`}),`. Si necesita recuperar la base de conocimientos, utilice el endpoint clásico `,_jsx(_components.a,{href:`/api/chat/completions`,children:`Finalización del chat`}),`.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`autenticación`,children:`Autenticación`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,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:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Authorization:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Bearer`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sk-your-api-key-here`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`usando-un-sdk-de-openai`,children:`Usando un SDK de OpenAI`}),`\n`,_jsxs(Heading,{level:`3`,id:`pitón-openai`,children:[`Pitón (`,_jsx(_components.code,{children:`openai`}),`)`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`18`,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:`18`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sk-your-api-key-here\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{customer.name}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`.hiperai.ai/api/external/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`resp `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.chat.completions.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai/gpt-5-nano\"`}),_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:` messages`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"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:`\"Hello!\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # SecureAI extensions travel via extra_body`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` extra_body`}),_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:` \"smltp_policy\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"internal\"`}),_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:` \"fallback_models\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"anthropic/claude-sonnet-4\"`}),_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:`(resp.choices[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].message.content)`})]}),`\n`,_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:`(resp.model_extra[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"secureai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"served_model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`]})})}),`\n`,_jsxs(Heading,{level:`3`,id:`javascript-openai`,children:[`JavaScript (`,_jsx(_components.code,{children:`openai`}),`)`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,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:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'openai'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_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:` client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'sk-your-api-key-here'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` baseURL:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://{customer.name}.hiperai.ai/api/external/v1'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` resp`}),_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:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\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-5-nano'`}),_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:` [{ `}),_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:` 'Hello!'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // @ts-expect-error — SecureAI extension fields`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` smltp_policy:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'internal'`}),_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:` fallback_models:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'anthropic/claude-sonnet-4'`}),_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:`#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:`resp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choices`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_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:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`cuerpo-de-solicitud`,children:`Cuerpo de solicitud`}),`\n`,_jsxs(_components.p,{children:[`Se admiten campos estándar de OpenAI. Se requiere `,_jsx(_components.code,{children:`messages`}),` (no hay `,_jsx(_components.code,{children:`prompt`}),` en esta superficie). `,_jsx(_components.code,{children:`max_completion_tokens`}),` se acepta como alias para `,_jsx(_components.code,{children:`max_tokens`}),`.`]}),`\n`,_jsx(_components.p,{children:`Los siguientes parámetros de OpenAI se pasan al proveedor tal cual:`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`tools`}),`, `,_jsx(_components.code,{children:`tool_choice`}),`, `,_jsx(_components.code,{children:`parallel_tool_calls`}),`, `,_jsx(_components.code,{children:`response_format`}),`, `,_jsx(_components.code,{children:`stop`}),`, `,_jsx(_components.code,{children:`top_p`}),`, `,_jsx(_components.code,{children:`frequency_penalty`}),`, `,_jsx(_components.code,{children:`presence_penalty`}),`, `,_jsx(_components.code,{children:`seed`}),`, `,_jsx(_components.code,{children:`logprobs`}),`, `,_jsx(_components.code,{children:`top_logprobs`}),`, `,_jsx(_components.code,{children:`user`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`campos-de-extensión-secureai`,children:`Campos de extensión SecureAI`}),`\n`,_jsxs(_components.p,{children:[`Envíelos como campos de cuerpo adicionales (a través de `,_jsx(_components.code,{children:`extra_body`}),` en los SDK de OpenAI):`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Campo`}),_jsx(_components.th,{children:`Descripción`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`smltp_policy`})}),_jsx(_components.td,{children:`Política de seguridad SMLTP para esta llamada.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`prompt_shield`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{ enabled?, policy? }`}),` — anulación del Escudo de aviso por llamada.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`models`}),` / `,_jsx(_components.code,{children:`fallback_models`})]}),_jsxs(_components.td,{children:[`Modelo de cadena `,_jsx(_components.a,{href:`/api/redundancia`,children:`redundancia`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`redundancy`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{ timeout_ms, first_token_timeout_ms, on[] }`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`user_id`})}),_jsx(_components.td,{children:`Facturar a un usuario diferente (controlado por el administrador).`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`respuesta`,children:`Respuesta`}),`\n`,_jsxs(_components.p,{children:[`Forma estándar OpenAI `,_jsx(_components.code,{children:`chat.completion`}),`, más un objeto de extensión `,_jsx(_components.code,{children:`secureai`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`20`,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:`20`,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-1a2b3c...\"`}),_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:`1705312200`}),_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:`\"anthropic/claude-sonnet-4\"`}),_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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`, `}),_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:`\"Hello!\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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`,_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:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`9`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`12`}),_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:` \"secureai\"`}),_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:` \"served_model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"anthropic/claude-sonnet-4\"`}),_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:` \"requested_model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai/gpt-5-nano\"`}),_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:` \"failover\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"occurred\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"attempts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [ `}),_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},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:` \"smltp_policy_used\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"internal\"`}),_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:` \"smltp_policy_source\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"request\"`}),_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:` \"smltp_policy_hash\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"a1b2c3...\"`}),_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_shield_policy\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_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:` \"smltp_bundle_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"bnd_...\"`})]}),`\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`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`secureai.smltp_bundle_id`}),` (cuando esté presente) se puede canjear por un `,_jsx(_components.a,{href:`/api/recibos`,children:`recibo`}),` de cumplimiento firmado.`]}),`\n`,_jsx(Heading,{level:`3`,id:`transmisión`,children:`Transmisión`}),`\n`,_jsxs(_components.p,{children:[`Establezca `,_jsx(_components.code,{children:`stream: true`}),`. Los marcos son objetos nativos de OpenAI `,_jsx(_components.code,{children:`chat.completion.chunk`}),` terminados en `,_jsx(_components.code,{children:`data: [DONE]`}),`. La extensión `,_jsx(_components.code,{children:`secureai`}),` está adjunta al `,_jsx(_components.strong,{children:`primer`}),` fragmento. `,_jsx(_components.code,{children:`choices`}),` (incluidos los deltas de `,_jsx(_components.code,{children:`tool_calls`}),` y `,_jsx(_components.code,{children:`finish_reason`}),`) pasan intactos.`]}),`\n`,_jsx(Heading,{level:`2`,id:`errores`,children:`Errores`}),`\n`,_jsx(_components.p,{children:`Los errores de este controlador utilizan el sobre OpenAI:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,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:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"you must provide a model parameter\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"invalid_request_error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } }`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Cuando falla toda una cadena de redundancia, el error utiliza `,_jsx(_components.code,{children:`code: \"all_models_failed\"`}),` y el estado `,_jsx(_components.code,{children:`429`}),` (todos los límites de velocidad) o `,_jsx(_components.code,{children:`502`}),` (de lo contrario). Los rechazos de middleware de seguridad mantienen la forma de SecureAI `,_jsx(_components.code,{children:`{ \"success\": false, ... }`}),`; ambos siempre llevan un `,_jsx(_components.code,{children:`message`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`relacionado`,children:`Relacionado`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/api/chat/completions`,children:`Finalización del chat`}),`: la superficie clásica (agrega RAG).`]}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/api/redundancy`,children:`Redundancia y conmutación por error`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/api/threat-defense/prompt-shield`,children:`API de protección rápida`})}),`\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":{"sidebar_position":2,"title":"Compatibilidad con OpenAI","sidebar_label":"Compatible con OpenAI","description":"Superficie de finalización de chat OpenAI directa: apunte cualquier SDK de OpenAI a SecureAI","openapi":"POST /v1/chat/completions","href":"/api/chat/openai-compatible"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Endpoint compatible con OpenAI","slug":"endpoint-compatible-con-openai","depth":1,"children":[]},{"title":"Endpoint","slug":"endpoint","depth":2,"children":[]},{"title":"Autenticación","slug":"autenticación","depth":2,"children":[]},{"title":"Usando un SDK de OpenAI","slug":"usando-un-sdk-de-openai","depth":2,"children":[{"title":"Pitón (openai)","slug":"pitón-openai","depth":3,"children":[]},{"title":"JavaScript (openai)","slug":"javascript-openai","depth":3,"children":[]}]},{"title":"Cuerpo de solicitud","slug":"cuerpo-de-solicitud","depth":2,"children":[{"title":"Campos de extensión SecureAI","slug":"campos-de-extensión-secureai","depth":3,"children":[]}]},{"title":"Respuesta","slug":"respuesta","depth":2,"children":[{"title":"Transmisión","slug":"transmisión","depth":3,"children":[]}]},{"title":"Errores","slug":"errores","depth":2,"children":[]},{"title":"Relacionado","slug":"relacionado","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Chat"],"summary":"OpenAI-compatible chat completion","description":"Superficie de finalización de chat OpenAI directa: apunte cualquier SDK de OpenAI a SecureAI","operationId":"openaiCompatibleChatCompletion","security":["c772d6d3-f5e4-4f9d-a74d-847cb7c6659f"],"requestBody":"ca48b0f8-833a-4e67-ad3c-93c551021401","responses":{"200":"88868191-71bf-496b-b015-fe9f8cd3c0e7","400":"24d5fab3-5ce9-41ac-bb76-ef759771c19a","401":"28157540-6fff-4662-b879-9b7d19fadc1f","429":"23f9f10d-016c-499e-ad82-c2ef4d48b58e","502":"2f2b0318-f347-4f40-9b17-1d99dc28b15b"},"method":"post","type":"path","servers":["fbd72946-9886-4e81-9a8d-c4d03a0f013a","c25ed417-4e80-41d3-81a9-ad22193527d3"],"path":"/v1/chat/completions","baseUrlOptions":["https://secureai.hiperai.ai/api/external","http://localhost:3010/api/external"],"title":"OpenAI-compatible chat completion","codeSamples":[],"requestExampleLanguages":["bash","python","javascript"],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","example":"openai/gpt-5-nano","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"],"uniqueKey":"messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"content":{"type":"string","uniqueKey":"messages.items.[INDEX].content","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"temperature":{"type":"number","uniqueKey":"temperature","typeLabel":"number"},"max_tokens":{"type":"integer","uniqueKey":"max_tokens","typeLabel":"integer"},"stream":{"type":"boolean","uniqueKey":"stream","typeLabel":"boolean"},"models":{"type":"array","items":{"type":"string","uniqueKey":"models.items.[INDEX]","typeLabel":"string"},"uniqueKey":"models","typeLabel":"string[]"},"fallback_models":{"type":"array","items":{"type":"string","uniqueKey":"fallback_models.items.[INDEX]","typeLabel":"string"},"uniqueKey":"fallback_models","typeLabel":"string[]"},"redundancy":{"type":"object","description":"{ timeout_ms, first_token_timeout_ms, on[] }","uniqueKey":"redundancy","typeLabel":"object"},"smltp_policy":{"type":"string","uniqueKey":"smltp_policy","typeLabel":"string"},"prompt_shield":{"type":"object","description":"{ enabled?, policy? } per-call Prompt Shield override","uniqueKey":"prompt_shield","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"model":"openai/gpt-5-nano","messages":[{"content":"\u003cstring>"}],"temperature":123,"max_tokens":123,"stream":true,"models":["\u003cstring>"],"fallback_models":["\u003cstring>"],"redundancy":{},"smltp_policy":"\u003cstring>","prompt_shield":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"88868191-71bf-496b-b015-fe9f8cd3c0e7":{"description":"OpenAI chat.completion object plus a `secureai` extension","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"24d5fab3-5ce9-41ac-bb76-ef759771c19a":{"description":"Invalid request (OpenAI error envelope)","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"28157540-6fff-4662-b879-9b7d19fadc1f":{"description":"Invalid API key","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"23f9f10d-016c-499e-ad82-c2ef4d48b58e":{"description":"Rate limited (or all models rate-limited)","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"2f2b0318-f347-4f40-9b17-1d99dc28b15b":{"description":"All model attempts in the redundancy chain failed","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"c772d6d3-f5e4-4f9d-a74d-847cb7c6659f":{"ApiKeyAuth":{"type":"http","scheme":"bearer","description":"API key authentication using Bearer token format.\nExample: `Authorization: Bearer sk-your-api-key-here`\n","scopes":[]}}},"servers":{"fbd72946-9886-4e81-9a8d-c4d03a0f013a":{"url":"https://secureai.hiperai.ai/api/external","description":"Production server"},"c25ed417-4e80-41d3-81a9-ad22193527d3":{"url":"http://localhost:3010/api/external","description":"Development server"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"API key authentication using Bearer token format.\nExample: `Authorization: Bearer sk-your-api-key-here`\n","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"API key authentication using Bearer token format.\nExample: `Authorization: Bearer sk-your-api-key-here`\n","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"ApiKeyAuth","name":"Authorization"}],"title":"ApiKeyAuth"}]},"originalFileLocation":"openapi.yaml"},"subdomain":"hiper-ai","siteName":"SecureAI","title":"Compatibilidad con OpenAI - SecureAI","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"es":{"href":"/api/chat/openai-compatible","matchLevel":0},"en":{"href":"/en/api/chat/openai-compatible","matchLevel":1},"zh":{"href":"/zh/api/chat/openai-compatible","matchLevel":1},"pt":{"href":"/pt/api/chat/openai-compatible","matchLevel":1},"ja":{"href":"/ja/api/chat/openai-compatible","matchLevel":1},"fr":{"href":"/fr/api/chat/openai-compatible","matchLevel":1},"de":{"href":"/de/api/chat/openai-compatible","matchLevel":1},"ko":{"href":"/ko/api/chat/openai-compatible","matchLevel":1}}},"lastModified":"2026-09-04T13:04:56.104Z","originalFileLocation":"api/chat/openai-compatible.md","locale":"es"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Superficie de finalización de chat OpenAI directa: apunte cualquier SDK de OpenAI a SecureAI\">\u003cmeta data-mint-head name=\"application-name\" content=\"SecureAI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/hiper-ai/bbh9RI4BzTPVkV_e/_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/hiper-ai/bbh9RI4BzTPVkV_e/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/hiper-ai/bbh9RI4BzTPVkV_e/_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/hiper-ai/bbh9RI4BzTPVkV_e/_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/hiper-ai/bbh9RI4BzTPVkV_e/_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/hiper-ai/bbh9RI4BzTPVkV_e/_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/hiper-ai/bbh9RI4BzTPVkV_e/_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/hiper-ai/bbh9RI4BzTPVkV_e/_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/hiper-ai/bbh9RI4BzTPVkV_e/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Compatibilidad con OpenAI - SecureAI\">\u003cmeta data-mint-head property=\"og:description\" content=\"Superficie de finalización de chat OpenAI directa: apunte cualquier SDK de OpenAI a SecureAI\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"SecureAI\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.hiperai.com/api/chat/openai-compatible\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://hiper-ai.mintlify.site/_mintlify/api/og/v2?division=Modelos+y+Generaci%C3%B3n+AI\u0026amp;title=Compatibilidad+con+OpenAI\u0026amp;description=Superficie+de+finalizaci%C3%B3n+de+chat+OpenAI+directa%3A+apunte+cualquier+SDK+de+OpenAI+a+SecureAI\u0026amp;theme=626ee05cbd72fa1d2e9fae2a\u0026amp;signature=bae860f57e5960b74e59093e4f343b0ec960d9878aedc4c22dd34cf06a6e98d6\">\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=\"Compatibilidad con OpenAI - SecureAI\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Superficie de finalización de chat OpenAI directa: apunte cualquier SDK de OpenAI a SecureAI\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://hiper-ai.mintlify.site/_mintlify/api/og/v2?division=Modelos+y+Generaci%C3%B3n+AI\u0026amp;title=Compatibilidad+con+OpenAI\u0026amp;description=Superficie+de+finalizaci%C3%B3n+de+chat+OpenAI+directa%3A+apunte+cualquier+SDK+de+OpenAI+a+SecureAI\u0026amp;theme=626ee05cbd72fa1d2e9fae2a\u0026amp;signature=bae860f57e5960b74e59093e4f343b0ec960d9878aedc4c22dd34cf06a6e98d6\">\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/hiper-ai/bbh9RI4BzTPVkV_e/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"SecureAI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0066FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.hiperai.com/api/chat/openai-compatible\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api/chat/openai-compatible.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"es\" href=\"https://docs.hiperai.com/api/chat/openai-compatible\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.hiperai.com/en/api/chat/openai-compatible\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.hiperai.com/zh/api/chat/openai-compatible\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"pt\" href=\"https://docs.hiperai.com/pt/api/chat/openai-compatible\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://docs.hiperai.com/ja/api/chat/openai-compatible\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"fr\" href=\"https://docs.hiperai.com/fr/api/chat/openai-compatible\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"de\" href=\"https://docs.hiperai.com/de/api/chat/openai-compatible\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://docs.hiperai.com/ko/api/chat/openai-compatible\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.hiperai.com/api/chat/openai-compatible\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.hiperai.com/#organization\",\"name\":\"SecureAI\",\"url\":\"https://docs.hiperai.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/hiper-ai/OxdQRluHRfLLri8S/img/hiper_ai_official.png?fit=max\u0026auto=format\u0026n=OxdQRluHRfLLri8S\u0026q=85\u0026s=497afb0927d9949816a66f9bb841682b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.hiperai.com#website\",\"name\":\"SecureAI\",\"url\":\"https://docs.hiperai.com\",\"publisher\":{\"@id\":\"https://docs.hiperai.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.hiperai.com/api/chat/openai-compatible#webpage\",\"url\":\"https://docs.hiperai.com/api/chat/openai-compatible\",\"name\":\"Compatibilidad con OpenAI\",\"description\":\"Superficie de finalización de chat OpenAI directa: apunte cualquier SDK de OpenAI a SecureAI\",\"dateModified\":\"2026-09-04T13:04:56.104Z\",\"isPartOf\":{\"@id\":\"https://docs.hiperai.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.hiperai.com/api/chat/openai-compatible#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.hiperai.com/api/chat/openai-compatible#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Modelos y Generación AI\",\"item\":\"https://docs.hiperai.com/api/chat/completions\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Compatibilidad con OpenAI\",\"item\":\"https://docs.hiperai.com/api/chat/openai-compatible\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.hiperai.com/api/chat/openai-compatible#apireference\",\"headline\":\"Compatibilidad con OpenAI\",\"name\":\"Compatibilidad con OpenAI\",\"description\":\"Superficie de finalización de chat OpenAI directa: apunte cualquier SDK de OpenAI a SecureAI\",\"url\":\"https://docs.hiperai.com/api/chat/openai-compatible\",\"mainEntityOfPage\":{\"@id\":\"https://docs.hiperai.com/api/chat/openai-compatible#webpage\"},\"dateModified\":\"2026-09-04T13:04:56.104Z\",\"publisher\":{\"@id\":\"https://docs.hiperai.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.hiperai.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"SecureAI\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"SecureAI","nav":{"global":null,"languages":[{"language":"es","default":true,"navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"Soporte"}]},"tabs":[{"tab":"Documentación","pages":[{"title":"Documentación","href":"/intro"}]},{"tab":"Integraciones","pages":[{"title":"Integraciones","href":"/integrations/files/google-drive"}]},{"tab":"Referencia API","groups":[{"group":"Primeros Pasos y Configuración","pages":[{"title":"Referencia de la API Externa","href":"/api"},{"title":"Autenticación de la API","href":"/api/auth/overview"},{"title":"Health Check (Estado del Sistema)","openapi":"GET /health","href":"/api/system/health"}]},{"group":"Modelos y Generación AI","pages":[{"title":"Chat Completions","openapi":"POST /chat/completions","description":"The main endpoint for AI chat completions with optional knowledge base retrieval (RAG).\nThis endpoint supports multiple AI models, security policies, and can search your\nknowledge bases for relevant context to enhance responses.\n","href":"/api/chat/completions"},{"title":"Compatibilidad con OpenAI","openapi":"POST /v1/chat/completions","href":"/api/chat/openai-compatible"},{"title":"Redundancia y Failover Automático","description":"Cadenas de conmutación por error de modelos definidas por la persona que llama para la API SecureAI Completions","href":"/api/redundancy"},{"title":"Generación de Imágenes","openapi":"POST /images/generations","href":"/api/images/generations"},{"title":"Edición de Imágenes","openapi":"POST /images/edits","href":"/api/images/edits"},{"title":"Sesión WebRTC Speech-to-Speech","openapi":"POST /speech/s2s/webrtc","href":"/api/speech/webrtc"},{"title":"Estado de Sesión Speech-to-Speech","openapi":"GET /speech/s2s/status","href":"/api/speech/status"},{"title":"Registrar Sesión Speech-to-Speech","openapi":"POST /speech/s2s/log-session","href":"/api/speech/log-session"},{"title":"Modelos Disponibles en la API","openapi":"GET /models","href":"/api/discovery/models"}]},{"group":"Knowledge Base y RAG","pages":[{"title":"Listar Índices RAG","openapi":"GET /indexes/all","href":"/api/indexes/list"},{"title":"Crear Índice RAG","openapi":"POST /indexes/all","href":"/api/indexes/create"},{"title":"Actualizar Índice RAG","openapi":"PUT /indexes/{indexId}","href":"/api/indexes/update"},{"title":"Búsqueda Semántica en Índice","openapi":"GET /indexes/{indexName}/search","href":"/api/indexes/search"},{"title":"Entrenar Índice con Documentos","openapi":"POST /indexes/{indexName}/train","href":"/api/indexes/train"},{"title":"Bases de Conocimiento Disponibles","openapi":"GET /indexes","href":"/api/discovery/indexes"}]},{"group":"Seguridad, Guardrails y Auditoría","pages":[{"title":"Verificación de Políticas","openapi":"POST /policy-check","href":"/api/policy-check"},{"title":"Prompt Shield API","href":"/api/threat-defense/prompt-shield"},{"title":"Políticas SMLTP","openapi":"GET /smltp-policies/all","href":"/api/smltp/policies"},{"title":"Políticas SMLTP Activas","openapi":"GET /smltp-policies/active","href":"/api/smltp/active"},{"title":"Crear Política SMLTP","openapi":"POST /smltp-policies/active","href":"/api/smltp/create"},{"title":"Recibos Criptográficos SMLTP","openapi":"GET /receipts/{bundleId}","href":"/api/receipts"},{"title":"Logs de Auditoría Criptográficos","openapi":"GET /audit-logs","href":"/api/smltp/audit-logs"},{"title":"Políticas de Seguridad Descubiertas","openapi":"GET /smltp-policies","href":"/api/discovery/smltp-policies"}]},{"group":"Usuarios y Acceso (IAM)","pages":[{"title":"Listar Usuarios","openapi":"GET /users","href":"/api/users/list"},{"title":"Crear Usuario","openapi":"POST /users","href":"/api/users/create"},{"title":"Actualizar Usuario","openapi":"PUT /users/{userId}","href":"/api/users/update"},{"title":"Listar Roles","openapi":"GET /roles","href":"/api/roles/list"},{"title":"Crear Rol","openapi":"POST /roles","href":"/api/roles/create"},{"title":"Listar Grupos","openapi":"GET /groups","href":"/api/groups/list"},{"title":"Crear Grupo","openapi":"POST /groups","href":"/api/groups/create"},{"title":"Actualizar Grupo","openapi":"PUT /groups/{groupId}","href":"/api/groups/update"}]},{"group":"Facturación, Cuotas y Webhooks","pages":[{"title":"Métricas de Uso y Consumo","openapi":"GET /usage","href":"/api/usage"},{"title":"Modos de Facturación y Claves API","href":"/api/billing-modes"},{"title":"Referencia Rápida de Facturación","href":"/api/billing-modes/quick-reference"},{"title":"Disponibilidad de Licencias","openapi":"GET /licenses/availability","href":"/api/billing-modes/licenses-availability"},{"title":"Webhooks de Eventos — Visión General","href":"/api/webhooks/overview"},{"title":"Catálogo de Eventos de Webhooks","href":"/api/webhooks/events"}]}]}]},{"language":"en","navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"Support"}]},"pages":[{"title":"en","href":"/en/api/chat/openai-compatible"}]},{"language":"zh","navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"技术支持"}]},"pages":[{"title":"zh","href":"/zh/api/chat/openai-compatible"}]},{"language":"pt","navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"Suporte"}]},"pages":[{"title":"pt","href":"/pt/api/chat/openai-compatible"}]},{"language":"ja","navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"サポート"}]},"pages":[{"title":"ja","href":"/ja/api/chat/openai-compatible"}]},{"language":"fr","navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"Support"}]},"pages":[{"title":"fr","href":"/fr/api/chat/openai-compatible"}]},{"language":"de","navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"Support"}]},"pages":[{"title":"de","href":"/de/api/chat/openai-compatible"}]},{"language":"ko","navbar":{"links":[{"href":"https://hiperai.com/contacts","label":"고객지원"}]},"pages":[{"title":"ko","href":"/ko/api/chat/openai-compatible"}]}]},"basePath":"","title":"Compatibilidad con OpenAI - SecureAI","buildId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","deploymentId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-i2a3QZ8E.js","utils-ChLwp8m0.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DRktVTDc.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-CA2pEs4T.js","snippetPresets-ClQ6XrKD.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Ct_Lv36y.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-Cn2PYw9e.js","shallow-rkyymjXQ.js","getApiPlaygroundDisplay-BB9vkXtE.js","CodeSnippet-Bm5RU7m1.js","CodeSnippets-BgU9Deuz.js","Page-BUDYNlhG.js","getPastedJson-BD-6NNum.js","icon-8Z6tud2e.js","MethodPill-Tuzr4g3V.js","DuplicateIcon-0ceWFYhN.js","createIcon-FBXow_ST.js","DynamicMarkdown-CD8713Yy.js","SectionHeading-7zgzQbH-.js","axios-vUo_bRtp.js","Markdown-D7Ofw1oz.js","clsx-eKJ4rcii.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CwjSCXIK.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-9EK5IAXV.js"]}