Create vector embeddings through the AI Gateway with any supported embedding model. Generate embeddings for semantic search, clustering, and RAG ingestion.
Use Cases
Semantic search and retrieval over a collection of documents.
Clustering, classification, and anomaly detection on text.
Ingesting vectors into a custom or third-party vector database.
Building RAG pipelines where retrieval happens outside the gateway.
The AI Gateway exposes POST /embeddings on the OpenAI-compatible API base URL (https://my.orq.ai/v3/router). Send text and receive vector embeddings from any enabled embedding model, with the same request and response format as the OpenAI Embeddings API. Fallbacks, budgets, caching, and observability apply to embedding calls exactly as they do to chat completions.
Providers that support embeddings include AWS Bedrock, Azure, Cohere, Vertex AI, Google AI, Jina AI, Mistral, Nebius, OpenAI, Scaleway, Tencent, and TensorX. See Supported Models for the full embedding model catalog.
Choose a model based on which languages it supports, cost, and output quality. For content in multiple languages, use a multilingual model such as cohere/embed-multilingual-v3.0 or jina/jina-embeddings-v3. For English-only content, openai/text-embedding-3-small is smaller and cheaper.Pass dimensions to request a specific number of output dimensions:
{ "model": "openai/text-embedding-3-small", "input": "The food was delicious", "dimensions": 256}
Models that support configurable output sizes (for example openai/text-embedding-3-small and openai/text-embedding-3-large) return vectors of the requested size, which reduces storage and compute cost with a small loss in retrieval quality. Models with a fixed output size return vectors of their fixed dimension.
Set encoding_format to base64 to receive embeddings as base64-encoded strings instead of JSON float arrays, which makes the response smaller:
{ "model": "openai/text-embedding-3-small", "input": "The food was delicious", "encoding_format": "base64"}
The input field accepts a single string, an array of strings, or token arrays. Batch related texts in one request instead of sending one request per text. One round trip is faster than many:
curl -X POST https://my.orq.ai/v3/router/embeddings \ -H "Authorization: Bearer $ORQ_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/text-embedding-3-small", "input": [ "The food was delicious", "And the waiter was friendly" ] }'
import OpenAI from "openai";const client = new OpenAI({ apiKey: process.env.ORQ_API_KEY, baseURL: "https://my.orq.ai/v3/router",});const batch = await client.embeddings.create({ model: "openai/text-embedding-3-small", input: [ "The food was delicious", "And the waiter was friendly", ],});console.log(batch.data.map((item) => item.embedding.length));
from openai import OpenAIimport osclient = OpenAI( api_key=os.environ.get("ORQ_API_KEY"), base_url="https://my.orq.ai/v3/router",)batch = client.embeddings.create( model="openai/text-embedding-3-small", input=[ "The food was delicious", "And the waiter was friendly", ],)print([len(item.embedding) for item in batch.data])
The response returns one embedding per input in the data array, ordered to match the input. Token usage follows the OpenAI format: usage.prompt_tokens reports the input tokens consumed and usage.total_tokens the total for the request.
Knowledge Bases handle embedding and retrieval internally: chunk the source documents, embed them with a configured embedding model, and inject the retrieved context into the model call. Prefer a Knowledge Base when the goal is RAG inside the gateway, because it handles ingestion and retrieval automatically.Call the embeddings endpoint directly when the pipeline needs control that a Knowledge Base does not offer:
Embedding calls support the same gateway controls as chat completions:
Fallbacks: pass an array of fallbacks to route to backup models when the primary model fails. See Fallbacks.
Caching: identical embedding requests can be served from cache. See Cache.
Budgets: embedding traffic counts against Budgets, with limits applied per workspace, API key, or provider.
Observability: embedding calls appear in Traces with model, token usage, and latency. Pass the top-level name field, for example "name": "semantic-search-embed", to label the call on the trace.
Was this page helpful?
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Orq.ai Documentation","description":"Documentation for Orq.ai, the EU-built control plane for enterprise AI: govern every LLM and MCP call with the AI Gateway, and ship backlog work with the Software Factory.","colors":{"primary":"#027f6b","light":"#00d2b5","dark":"#027f6b"},"logo":{"light":"https://mintcdn.com/orqai/OG_14djpK9Yasgfk/images/Orq_ai_Symbol_Dark.svg?fit=max\u0026auto=format\u0026n=OG_14djpK9Yasgfk\u0026q=85\u0026s=d01651850182afdbc6309808b688d470","dark":"https://mintcdn.com/orqai/BYq_L5I_ZDBWL_Pf/images/Orq_ai_Symbol_Light.svg?fit=max\u0026auto=format\u0026n=BYq_L5I_ZDBWL_Pf\u0026q=85\u0026s=3e372f93174202f20c31d2c045af92b9","href":"/ai-gateway/get-started/introduction"},"favicon":"https://mintcdn.com/orqai/rmwcfFw4PPljHRCz/favicon.svg?fit=max\u0026auto=format\u0026n=rmwcfFw4PPljHRCz\u0026q=85\u0026s=1827beca4e1fb46e074d8bda067f3fb1","api":{"openapi":"openapi.json","examples":{"languages":["curl","typescript","python"]}},"background":{"color":{"light":"#f7f6f5","dark":"#171717"}},"navbar":{"links":[],"primary":{"type":"button","label":"Get Started","href":"https://my.orq.ai/auth/signup"}},"footer":{"socials":{"github":"https://github.com/orq-ai","x":"https://x.com/orq_ai","linkedin":"https://www.linkedin.com/company/orqai","website":"https://orq.ai"}},"seo":{"metatags":{"author":"Orq.ai","og:type":"website","og:site_name":"Orq.ai Documentation","og:locale":"en_US","twitter:card":"summary_large_image","twitter:site":"@orq_ai","twitter:creator":"@orq_ai","viewport":"width=device-width, initial-scale=1.0","robots":"index, follow","language":"English"},"organization":{"id":"https://docs.orq.ai/#organization","name":"Orq.ai","legalName":"Orq.AI Holding B.V.","url":"https://orq.ai","logo":"https://docs.orq.ai/images/Orq_ai_Symbol_Dark.svg","sameAs":["https://github.com/orq-ai","https://x.com/orq_ai","https://www.linkedin.com/company/orqai/"]},"indexing":"all"},"fonts":{"heading":{"family":"ES Klarheit Kurrent Semibold","weight":600,"source":"https://framerusercontent.com/assets/HiovZWjG27S5NQhE8dyeECDMc.woff2","format":"woff2"},"body":{"family":"Inter","weight":400,"source":"fonts/inter-latin-400-normal.woff2","format":"woff2"}},"styling":{"codeblocks":{"theme":{"light":"github-light","dark":"github-dark"}},"latex":true},"contextual":{"options":["copy","download-spec","chatgpt","claude","view"],"display":"header"},"interaction":{"drilldown":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"orqai","hasAudioNarration":false,"actualSubdomain":"orqai","customDomains":["docs.orq.ai"],"gitSource":{"type":"github","owner":"orq-ai","repo":"orquesta-web","deployBranch":"main","contentDirectory":"documentation/mintlify","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6aec613bada4d37850e27e55","collectionId":"97d33066-b9a1-4280-87e1-bbb0adeceadf","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aec613bada4d37850e27e55"},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aec613bada4d37850e27e55","clientVersion":"0.0.4071","searchFilterCounts":[{"language":"default","tag":"API Reference","count":404},{"language":"default","tag":"Platform APIs","count":258},{"language":"default","tag":"Integrations","count":93},{"language":"default","tag":"Orq SDK","count":70},{"language":"default","tag":"AI Gateway","count":69},{"language":"default","tag":"Management APIs","count":68},{"language":"default","tag":"SDK Reference","count":67},{"language":"default","tag":"Cookbooks","count":34},{"language":"default","tag":"Model Providers","count":31},{"language":"default","tag":"Frameworks \u0026 SDKs","count":30}],"searchSettings":{"maxResults":15}},"assistantConfig":{"enableStarterQuestions":true,"enableContextualStarterQuestions":true,"deflection":{"enabled":true,"email":"support@orq.ai","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"vite-origin","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}],"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":".nav-anchor img{border-radius:50%}.ig-root{scroll-margin-top:6rem}.ig-search{width:100%;padding:10px 14px 10px 38px;border-radius:8px;border:1px solid rgba(0, 0, 0, 0.15);font-size:14px;outline:none;margin-bottom:20px;background:transparent;box-sizing:border-box;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%23999' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m21 21-4.35-4.35M17 11A6 6 0 1 1 5 11a6 6 0 0 1 12 0Z'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:12px center}.dark .ig-search{border-color:rgba(255, 255, 255, 0.15)}.ig-search:focus{border-color:#027f6b}.ig-tabs{display:flex;border-bottom:1px solid rgba(0, 0, 0, 0.1);margin-bottom:20px;gap:0}.dark .ig-tabs{border-bottom-color:rgba(255, 255, 255, 0.1)}.ig-tab{padding:8px 16px;background:none;border:none;border-bottom:2px solid transparent;margin-bottom:-1px;cursor:pointer;font-size:14px;font-weight:500;color:#888;white-space:nowrap}.ig-tab:hover{color:#027f6b}.dark .ig-tab:hover{color:#677F78}.ig-tab-active{border-bottom-color:#027f6b!important;color:#027f6b!important}.dark .ig-tab-active{border-bottom-color:#677F78!important;color:#677F78!important}.ig-grid{display:grid;grid-template-columns:repeat(4, 1fr);gap:6px}@media (max-width: 768px){.ig-grid{grid-template-columns:repeat(3, 1fr)}}@media (max-width: 480px){.ig-grid{grid-template-columns:repeat(2, 1fr)}}.ig-card{display:flex;align-items:center;gap:8px;padding:10px 14px;border:1px solid rgba(0, 0, 0, 0.1);border-radius:6px;text-decoration:none!important;color:inherit!important;font-size:14px;font-weight:500;transition:background 0.12s, border-color 0.12s}.ig-card:hover{background:rgba(2, 127, 107, 0.05);border-color:rgba(2, 127, 107, 0.25)}.dark .ig-card{border-color:rgba(255, 255, 255, 0.1)}.dark .ig-card:hover{background:rgba(103, 127, 120, 0.1);border-color:rgba(103, 127, 120, 0.3)}.ig-card-icon{width:20px;height:20px;object-fit:contain;flex-shrink:0}.ig-tab-count{display:inline-flex;align-items:center;justify-content:center;margin-left:6px;padding:0 5px;min-width:18px;height:18px;border-radius:9px;font-size:11px;font-weight:600;background:rgba(0, 0, 0, 0.08);color:inherit}.dark .ig-tab-count{background:rgba(255, 255, 255, 0.12)}.ig-tab-active .ig-tab-count{background:rgba(2, 127, 107, 0.15)}.dark .ig-tab-active .ig-tab-count{background:rgba(103, 127, 120, 0.25)}.ig-empty{text-align:center;padding:48px 24px;color:#999;font-size:14px;grid-column:1 / -1}kbd.key,kbd.key *{color:#fff!important}kbd.key{background:#242424;border-radius:5px;padding:2px 8px;font-size:0.85em;display:inline-flex;align-items:center;gap:6px;border:1px solid #3a3a3a;font-family:inherit;white-space:nowrap}#sidebar-content .flex-1:has(>svg.flex-shrink-0){flex:none!important}#sidebar-content{width:16rem!important;min-width:16rem!important}@media (min-width: 1024px){.lg\\:pl-56{padding-left:16rem!important}}.topbar-right-container nav[aria-label=\"Main\"] .navbar-link a,.topbar-right-container nav[aria-label=\"Main\"] .navbar-link a:hover{background-color:transparent!important}@media (min-width: 1024px){.topbar-right-container nav[aria-label=\"Main\"] ul{gap:1rem!important}.topbar-right-container nav[aria-label=\"Main\"] .navbar-link a{padding-left:0!important;padding-right:0!important}#page-title{font-size:2rem!important;line-height:1.2!important}}.nav-tabs-item:has(a[href^=\"/reference\"]){display:none!important}#navbar .nav-tabs-item[href=\"/ai-studio/integrations/overview\"]{position:relative}#navbar .nav-tabs-item[href=\"/ai-studio/integrations/overview\"]::before{content:'';position:absolute;top:50%;left:-12px;transform:translateY(-50%);height:55%;width:1px;background:rgba(0, 0, 0, 0.15)}.dark #navbar .nav-tabs-item[href=\"/ai-studio/integrations/overview\"]::before{background:rgba(255, 255, 255, 0.15)}@media (min-width: 1280px){#content-container{padding-left:3rem!important;padding-right:2rem!important}#content-side-layout{max-width:20rem!important}#content-area{width:calc(100% - 20rem)!important}}.md-export-list{display:none}@font-face{font-family:'Inter';src:url('/fonts/inter-latin-400-normal.woff2') format('woff2');font-style:normal;font-weight:400;font-display:optional}"}],"page":{"pagePath":"ai-gateway/features/embeddings","slug":"/ai-gateway/features/embeddings","pageMetadata":{"title":"Embeddings","sidebarTitle":"Embeddings","description":"Create vector embeddings through the AI Gateway with any supported embedding model. Generate embeddings for semantic search, clustering, and RAG ingestion.","href":"/ai-gateway/features/embeddings"},"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: \"Create vector embeddings through the AI Gateway with any supported embedding model. Generate embeddings for semantic search, clustering, and RAG ingestion.\"\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`,hr:`hr`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Use Cases`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Semantic search and retrieval over a collection of documents.`}),`\n`,_jsx(_components.li,{children:`Clustering, classification, and anomaly detection on text.`}),`\n`,_jsx(_components.li,{children:`Ingesting vectors into a custom or third-party vector database.`}),`\n`,_jsx(_components.li,{children:`Building RAG pipelines where retrieval happens outside the gateway.`}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`AI Gateway`}),` exposes `,_jsx(_components.code,{children:`POST /embeddings`}),` on the `,_jsx(_components.a,{href:`/ai-gateway/features/openai-compatible-api`,children:`OpenAI-compatible API`}),` base URL (`,_jsx(_components.code,{children:`https://my.orq.ai/v3/router`}),`). Send text and receive vector embeddings from any enabled embedding model, with the same request and response format as the OpenAI Embeddings API. Fallbacks, budgets, caching, and observability apply to embedding calls exactly as they do to chat completions.`]}),`\n`,_jsx(Heading,{level:`2`,id:`quick-start`,children:`Quick Start`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`7`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`curl`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -X`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` POST`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` https://my.orq.ai/v3/router/embeddings`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`$ORQ_API_KEY`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"model\": \"openai/text-embedding-3-small\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"input\": \"The food was delicious\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`13`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` OpenAI `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`from`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"openai\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` client`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` new`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` apiKey: process.env.`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`ORQ_API_KEY`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` baseURL: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"https://my.orq.ai/v3/router\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` embedding`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` await`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` client.embeddings.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`create`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` model: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"openai/text-embedding-3-small\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` input: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"The food was delicious\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`console.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`log`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(embedding.data[`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`].embedding);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`14`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`from`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` openai `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` OpenAI`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` os`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`client `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` OpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` api_key`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`os.environ.get(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"ORQ_API_KEY\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"https://my.orq.ai/v3/router\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`embedding `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` client.embeddings.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` model`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"openai/text-embedding-3-small\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` input`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"The food was delicious\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`print`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(embedding.data[`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`].embedding)`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`providers-and-models`,children:`Providers and Models`}),`\n`,_jsxs(_components.p,{children:[`Providers that support embeddings include AWS Bedrock, Azure, Cohere, Vertex AI, Google AI, Jina AI, Mistral, Nebius, OpenAI, Scaleway, Tencent, and TensorX. See `,_jsx(_components.a,{href:`/ai-gateway/supported-models`,children:`Supported Models`}),` for the full embedding model catalog.`]}),`\n`,_jsx(Heading,{level:`2`,id:`model-selection-and-dimensions`,children:`Model Selection and Dimensions`}),`\n`,_jsxs(_components.p,{children:[`Choose a model based on which languages it supports, cost, and output quality. For content in multiple languages, use a multilingual model such as `,_jsx(_components.code,{children:`cohere/embed-multilingual-v3.0`}),` or `,_jsx(_components.code,{children:`jina/jina-embeddings-v3`}),`. For English-only content, `,_jsx(_components.code,{children:`openai/text-embedding-3-small`}),` is smaller and cheaper.`]}),`\n`,_jsxs(_components.p,{children:[`Pass `,_jsx(_components.code,{children:`dimensions`}),` to request a specific number of output dimensions:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"openai/text-embedding-3-small\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"input\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"The food was delicious\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"dimensions\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`256`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Models that support configurable output sizes (for example `,_jsx(_components.code,{children:`openai/text-embedding-3-small`}),` and `,_jsx(_components.code,{children:`openai/text-embedding-3-large`}),`) return vectors of the requested size, which reduces storage and compute cost with a small loss in retrieval quality. Models with a fixed output size return vectors of their fixed dimension.`]})}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`encoding_format`}),` to `,_jsx(_components.code,{children:`base64`}),` to receive embeddings as base64-encoded strings instead of JSON float arrays, which makes the response smaller:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"openai/text-embedding-3-small\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"input\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"The food was delicious\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"encoding_format\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"base64\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`batching-and-token-usage`,children:`Batching and Token Usage`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`input`}),` field accepts a single string, an array of strings, or token arrays. Batch related texts in one request instead of sending one request per text. One round trip is faster than many:`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`10`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`curl`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -X`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` POST`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` https://my.orq.ai/v3/router/embeddings`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`$ORQ_API_KEY`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"model\": \"openai/text-embedding-3-small\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"input\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"The food was delicious\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"And the waiter was friendly\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`16`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` OpenAI `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`from`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"openai\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` client`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` new`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` apiKey: process.env.`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`ORQ_API_KEY`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` baseURL: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"https://my.orq.ai/v3/router\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`const`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` batch`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` await`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` client.embeddings.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`create`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` model: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"openai/text-embedding-3-small\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` input: [`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"The food was delicious\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"And the waiter was friendly\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`console.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`log`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(batch.data.`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`map`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`((`}),_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:`item`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`) `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=>`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` item.embedding.`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`length`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`));`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`17`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`from`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` openai `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` OpenAI`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` os`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`client `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` OpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` api_key`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`os.environ.get(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"ORQ_API_KEY\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"https://my.orq.ai/v3/router\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`batch `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` client.embeddings.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` model`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"openai/text-embedding-3-small\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` input`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`[`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"The food was delicious\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"And the waiter was friendly\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`print`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`([`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`len`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(item.embedding) `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`for`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` item `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`in`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` batch.data])`})]}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`The response returns one embedding per input in the `,_jsx(_components.code,{children:`data`}),` array, ordered to match the input. Token usage follows the OpenAI format: `,_jsx(_components.code,{children:`usage.prompt_tokens`}),` reports the input tokens consumed and `,_jsx(_components.code,{children:`usage.total_tokens`}),` the total for the request.`]}),`\n`,_jsx(Heading,{level:`2`,id:`embeddings-and-knowledge-bases`,children:`Embeddings and Knowledge Bases`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/ai-gateway/features/knowledge-bases`,children:`Knowledge Bases`}),` handle embedding and retrieval internally: chunk the source documents, embed them with a configured `,_jsx(_components.a,{href:`/ai-studio/ai-engineering/knowledge-bases#embedding-models`,children:`embedding model`}),`, and inject the retrieved context into the model call. Prefer a Knowledge Base when the goal is RAG inside the gateway, because it handles ingestion and retrieval automatically.`]}),`\n`,_jsx(_components.p,{children:`Call the embeddings endpoint directly when the pipeline needs control that a Knowledge Base does not offer:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Storing vectors in an external vector database such as `,_jsx(_components.a,{href:`/ai-studio/cookbooks/integrations-tooling/using-thirdparty-vectordbs-with-orq`,children:`Pinecone or a custom vector DB`}),`.`]}),`\n`,_jsx(_components.li,{children:`Using custom chunking, a custom embedding model, or embeddings for non-retrieval tasks such as clustering and classification.`}),`\n`,_jsx(_components.li,{children:`Running retrieval outside the gateway while keeping generation inside it.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`fallbacks-caching-budgets-and-observability`,children:`Fallbacks, Caching, Budgets, and Observability`}),`\n`,_jsx(_components.p,{children:`Embedding calls support the same gateway controls as chat completions:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Fallbacks`}),`: pass an array of `,_jsx(_components.code,{children:`fallbacks`}),` to route to backup models when the primary model fails. See `,_jsx(_components.a,{href:`/ai-gateway/features/retries#fallbacks`,children:`Fallbacks`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Caching`}),`: identical embedding requests can be served from cache. See `,_jsx(_components.a,{href:`/ai-gateway/features/cache`,children:`Cache`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Budgets`}),`: embedding traffic counts against `,_jsx(_components.a,{href:`/ai-gateway/budgets`,children:`Budgets`}),`, with limits applied per workspace, API key, or provider.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Observability`}),`: embedding calls appear in `,_jsx(_components.a,{href:`/ai-gateway/traces`,children:`Traces`}),` with model, token usage, and latency. Pass the top-level `,_jsx(_components.code,{children:`name`}),` field, for example `,_jsx(_components.code,{children:`\"name\": \"semantic-search-embed\"`}),`, to label the call on the trace.`]}),`\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":{"codeStyling":{"theme":{"light":"github-light","dark":"github-dark"}},"config":{},"pageMetadata":{"title":"Embeddings","sidebarTitle":"Embeddings","description":"Create vector embeddings through the AI Gateway with any supported embedding model. Generate embeddings for semantic search, clustering, and RAG ingestion.","href":"/ai-gateway/features/embeddings"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[]},{"title":"Quick Start","slug":"quick-start","depth":2,"children":[]},{"title":"Providers and Models","slug":"providers-and-models","depth":2,"children":[]},{"title":"Model Selection and Dimensions","slug":"model-selection-and-dimensions","depth":2,"children":[]},{"title":"Batching and Token Usage","slug":"batching-and-token-usage","depth":2,"children":[]},{"title":"Embeddings and Knowledge Bases","slug":"embeddings-and-knowledge-bases","depth":2,"children":[]},{"title":"Fallbacks, Caching, Budgets, and Observability","slug":"fallbacks-caching-budgets-and-observability","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/orqai/19ee3574279bbaa0/gtm.js","/_mintlify/custom/orqai/1f1a49b99957b631/commonroom-signals.js"],"subdomain":"orqai","siteName":"Orq.ai Documentation","title":"Embeddings - Orq.ai Documentation","contextualStarterQuestions":[{"_id":"6ab7db9904e7bafd503406f2","deploymentId":"68c9bcd7a1b07562da8b036b","questionText":"Can I use embeddings for RAG?","status":"active","generatedBy":"contextual","path":"ai-gateway/features/embeddings","createdAt":"2026-09-26T14:50:01.350Z","updatedAt":"2026-09-26T14:50:01.350Z","__v":0},{"_id":"6ab7db9904e7bafd503406f1","deploymentId":"68c9bcd7a1b07562da8b036b","questionText":"What models are supported?","status":"active","generatedBy":"contextual","path":"ai-gateway/features/embeddings","createdAt":"2026-09-26T14:50:01.350Z","updatedAt":"2026-09-26T14:50:01.350Z","__v":0},{"_id":"6ab7db9904e7bafd503406f0","deploymentId":"68c9bcd7a1b07562da8b036b","questionText":"How do I create embeddings?","status":"active","generatedBy":"contextual","path":"ai-gateway/features/embeddings","createdAt":"2026-09-26T14:50:01.350Z","updatedAt":"2026-09-26T14:50:01.350Z","__v":0}],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-26T14:49:02.854Z","originalFileLocation":"ai-gateway/features/embeddings.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create vector embeddings through the AI Gateway with any supported embedding model. Generate embeddings for semantic search, clustering, and RAG ingestion.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Orq.ai Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/orqai/5zquLIiRlftT1q7X/_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/orqai/5zquLIiRlftT1q7X/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/orqai/5zquLIiRlftT1q7X/_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/orqai/5zquLIiRlftT1q7X/_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/orqai/5zquLIiRlftT1q7X/_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/orqai/5zquLIiRlftT1q7X/_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/orqai/5zquLIiRlftT1q7X/_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/orqai/5zquLIiRlftT1q7X/_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/orqai/5zquLIiRlftT1q7X/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Embeddings - Orq.ai Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create vector embeddings through the AI Gateway with any supported embedding model. Generate embeddings for semantic search, clustering, and RAG ingestion.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Orq.ai Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.orq.ai/ai-gateway/features/embeddings\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://orqai.mintlify.app/_mintlify/api/og/v2?division=Model+Capabilities\u0026amp;title=Embeddings\u0026amp;description=Create+vector+embeddings+through+the+AI+Gateway+with+any+supported+embedding+model.+Generate+embeddings+for+semantic+search%2C+clustering%2C+and+RAG+ingestion.\u0026amp;theme=0116d0baa6ba6403f431e631\u0026amp;signature=3128841c30ff7f27528067e9ba200a4b9f1fc30395ec0d72c82db31e17148a23\">\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=\"Embeddings - Orq.ai Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create vector embeddings through the AI Gateway with any supported embedding model. Generate embeddings for semantic search, clustering, and RAG ingestion.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://orqai.mintlify.app/_mintlify/api/og/v2?division=Model+Capabilities\u0026amp;title=Embeddings\u0026amp;description=Create+vector+embeddings+through+the+AI+Gateway+with+any+supported+embedding+model.+Generate+embeddings+for+semantic+search%2C+clustering%2C+and+RAG+ingestion.\u0026amp;theme=0116d0baa6ba6403f431e631\u0026amp;signature=3128841c30ff7f27528067e9ba200a4b9f1fc30395ec0d72c82db31e17148a23\">\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/orqai/5zquLIiRlftT1q7X/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Orq.ai Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#027f6b\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003cmeta data-mint-head name=\"author\" content=\"Orq.ai\">\u003cmeta data-mint-head name=\"twitter:creator\" content=\"@orq_ai\">\u003cmeta data-mint-head name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\u003cmeta data-mint-head name=\"language\" content=\"English\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.orq.ai/ai-gateway/features/embeddings\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/ai-gateway/features/embeddings.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.orq.ai/#organization\",\"name\":\"Orq.ai\",\"legalName\":\"Orq.AI Holding B.V.\",\"url\":\"https://orq.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://docs.orq.ai/images/Orq_ai_Symbol_Dark.svg\"},\"sameAs\":[\"https://github.com/orq-ai\",\"https://x.com/orq_ai\",\"https://www.linkedin.com/company/orqai/\"]},{\"@type\":\"WebSite\",\"@id\":\"https://docs.orq.ai#website\",\"name\":\"Orq.ai Documentation\",\"url\":\"https://docs.orq.ai\",\"publisher\":{\"@id\":\"https://docs.orq.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.orq.ai/ai-gateway/features/embeddings#webpage\",\"url\":\"https://docs.orq.ai/ai-gateway/features/embeddings\",\"name\":\"Embeddings\",\"description\":\"Create vector embeddings through the AI Gateway with any supported embedding model. Generate embeddings for semantic search, clustering, and RAG ingestion.\",\"dateModified\":\"2026-09-26T14:49:02.854Z\",\"isPartOf\":{\"@id\":\"https://docs.orq.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.orq.ai/ai-gateway/features/embeddings#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.orq.ai/ai-gateway/features/embeddings#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Model Capabilities\",\"item\":\"https://docs.orq.ai/ai-gateway/features/streaming\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Embeddings\",\"item\":\"https://docs.orq.ai/ai-gateway/features/embeddings\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.orq.ai/ai-gateway/features/embeddings#article\",\"headline\":\"Embeddings\",\"name\":\"Embeddings\",\"description\":\"Create vector embeddings through the AI Gateway with any supported embedding model. Generate embeddings for semantic search, clustering, and RAG ingestion.\",\"url\":\"https://docs.orq.ai/ai-gateway/features/embeddings\",\"mainEntityOfPage\":{\"@id\":\"https://docs.orq.ai/ai-gateway/features/embeddings#webpage\"},\"dateModified\":\"2026-09-26T14:49:02.854Z\",\"publisher\":{\"@id\":\"https://docs.orq.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.orq.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Orq.ai Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Orq.ai Documentation","nav":{"global":null,"tabs":[{"tab":"AI Gateway","groups":[{"group":"Overview","icon":"compass","pages":[{"title":"AI Gateway","sidebarTitle":"Quick Start","href":"/ai-gateway/get-started/introduction"},{"title":"Migrate from OpenAI, Anthropic, OpenRouter, LiteLLM","sidebarTitle":"Migrate","href":"/ai-gateway/get-started/migrate"},{"title":"API Keys and Management Keys","sidebarTitle":"API Keys \u0026 Management Keys","href":"/ai-gateway/configuration/api-keys"},{"title":"Budgets","sidebarTitle":"Budgets","href":"/ai-gateway/budgets"},{"title":"Models","sidebarTitle":"Manage Models","href":"/ai-gateway/using-the-router"},{"title":"Supported models in AI Gateway","sidebarTitle":"Supported Models","href":"/ai-gateway/supported-models"},{"title":"Model Arena","href":"/ai-gateway/model-arena"},{"title":"Request metadata","sidebarTitle":"Request Metadata","href":"/ai-gateway/request-metadata"}]},{"group":"APIs","icon":"code","pages":[{"title":"Responses API","sidebarTitle":"Responses API","href":"/ai-gateway/features/responses-api"},{"title":"OpenAI-compatible API","sidebarTitle":"OpenAI-Compatible API","href":"/ai-gateway/features/openai-compatible-api"},{"title":"Anthropic Messages API","sidebarTitle":"Anthropic Messages API","href":"/ai-gateway/features/anthropic-messages-api"},{"title":"Connect agents through the AI Gateway","sidebarTitle":"Agents Gateway","href":"/ai-gateway/features/agents-gateway"}]},{"group":"MCP Portal","icon":"plug","pages":[{"title":"MCP Servers","sidebarTitle":"MCP Servers","href":"/ai-gateway/mcp-portal/mcp-servers"},{"title":"MCP Gateway","sidebarTitle":"MCP Gateway","href":"/ai-gateway/mcp-portal/mcp-gateways"}]},{"group":"Routing","icon":"route","pages":[{"title":"BYOK","sidebarTitle":"Bring Your Own Key (BYOK)","href":"/ai-gateway/providers-overview"},{"title":"Provider integrations","sidebarTitle":"Provider integrations","href":"/ai-gateway/features/provider-integrations"},{"title":"Smart Router","sidebarTitle":"Smart Router","href":"/ai-gateway/smart-router"},{"title":"Model Fusion","sidebarTitle":"Model Fusion","href":"/ai-gateway/model-fusion"},{"title":"Session Affinity","sidebarTitle":"Session Affinity","href":"/ai-gateway/session-affinity"},{"title":"Fallbacks and retries in the AI Gateway","sidebarTitle":"Fallbacks \u0026 Retries","href":"/ai-gateway/features/retries"},{"title":"Load balancing across providers","sidebarTitle":"Load Balancing","href":"/ai-gateway/features/load-balancing"},{"title":"Routing Rules","sidebarTitle":"Routing Rules","href":"/ai-gateway/configuration/routing-rules"},{"title":"LLM response caching","sidebarTitle":"Cache","href":"/ai-gateway/features/cache"},{"title":"Request timeouts","sidebarTitle":"Timeouts","href":"/ai-gateway/features/timeouts"},{"title":"Rate limits and quotas","sidebarTitle":"Rate limits \u0026 quotas","href":"/ai-gateway/features/rate-limits"},{"title":"Service tiers","sidebarTitle":"Service Tiers","href":"/ai-gateway/features/service-tiers"},{"title":"Response Healing","sidebarTitle":"Response Healing","tag":"Beta","href":"/ai-gateway/features/plugins/response-healing"},{"title":"Managed Prompts in router requests","sidebarTitle":"Using Prompts","href":"/ai-gateway/features/using-prompts"},{"title":"Knowledge bases via AI Gateway","sidebarTitle":"Knowledge Bases","href":"/ai-gateway/features/knowledge-bases"}]},{"group":"Security \u0026 Privacy","icon":"shield-halved","pages":[{"title":"EU data residency and model routing","sidebarTitle":"EU Routing \u0026 Data Residency","href":"/enterprise/eu-regions-faq"},{"title":"Sovereign AI and zero data retention (ZDR)","sidebarTitle":"Sovereign AI \u0026 ZDR","href":"/enterprise/sovereign-ai"},{"title":"Guardrails","sidebarTitle":"Guardrails","href":"/ai-gateway/configuration/guardrails"},{"title":"Guardrail Rules","sidebarTitle":"Guardrail Rules","href":"/ai-gateway/configuration/guardrail-rules"},{"title":"External Guardrails","sidebarTitle":"External Guardrails","href":"/ai-gateway/configuration/external-guardrails"},{"title":"Mask sensitive content in traces","sidebarTitle":"Trace Data Masking","href":"/ai-gateway/features/security"},{"title":"PII Redaction","sidebarTitle":"PII Redaction","tag":"Beta","href":"/ai-gateway/features/plugins/pii-redaction"},{"title":"Trace Scrubbing","sidebarTitle":"Trace Scrubbing","href":"/ai-gateway/features/plugins/trace-scrubbing"},{"title":"Bring Your Own Model","sidebarTitle":"Bring Your Own Model","href":"/ai-gateway/private-models"}]},{"group":"Model Capabilities","icon":"bolt","pages":[{"title":"LLM response streaming","sidebarTitle":"Streaming","href":"/ai-gateway/features/streaming"},{"title":"Structured outputs with JSON schema","sidebarTitle":"Structured Outputs","href":"/ai-gateway/features/structured-outputs"},{"title":"Image, PDF and audio generation","sidebarTitle":"Multimodal","href":"/ai-gateway/features/multimodal"},{"title":"OCR via AI Gateway","sidebarTitle":"OCR","href":"/ai-gateway/features/ocr"},{"title":"Sending files to models","sidebarTitle":"Files","href":"/ai-gateway/features/files"},{"title":"Batches","sidebarTitle":"Batches","href":"/ai-gateway/features/batches"},{"title":"Prompt caching for reduced token costs","sidebarTitle":"Prompt Caching","href":"/ai-gateway/features/prompt-caching"},{"title":"Context compaction for long conversations","sidebarTitle":"Context Compaction","href":"/ai-gateway/features/context-compaction"},{"title":"Tool calling and function execution","sidebarTitle":"Tool Calling","href":"/ai-gateway/features/tool-calling"},{"title":"Background Responses","sidebarTitle":"Background Responses","href":"/ai-gateway/features/background-responses"},{"title":"Reasoning models","sidebarTitle":"Reasoning","href":"/ai-gateway/features/reasoning"},{"title":"Web search in Responses API","sidebarTitle":"Web Search","href":"/ai-gateway/features/web-search"},{"title":"Dynamic inputs for runtime configuration","sidebarTitle":"Inputs","description":"Pass dynamic inputs to LLM prompts at runtime. Configure variables, context, and parameters through the AI Gateway for flexible prompt execution.","href":"/ai-gateway/features/inputs"},{"title":"Embeddings","sidebarTitle":"Embeddings","href":"/ai-gateway/features/embeddings"},{"title":"Rerank and Moderations","sidebarTitle":"Rerank \u0026 Moderations","description":"Rerank documents by relevance to a query and moderate text against safety categories through the AI Gateway rerank and moderations endpoints.","href":"/ai-gateway/features/rerank-and-moderations"},{"title":"Decisions","sidebarTitle":"Decisions","href":"/ai-gateway/features/decisions"},{"title":"Model FAQ","sidebarTitle":"Model FAQ","href":"/ai-gateway/model-faq"}]},{"group":"Server Tools","icon":"toolbox","pages":[{"title":"Server tools","sidebarTitle":"Overview","href":"/ai-gateway/features/server-tools"},{"title":"Web search server tool","sidebarTitle":"Web Search","href":"/ai-gateway/features/server-tools/web-search"},{"title":"Web fetch server tool","sidebarTitle":"Web Fetch","href":"/ai-gateway/features/server-tools/web-fetch"},{"title":"Datetime server tool","sidebarTitle":"Datetime","href":"/ai-gateway/features/server-tools/datetime"},{"title":"Image generation server tool","sidebarTitle":"Image Generation","href":"/ai-gateway/features/server-tools/image-generation"},{"title":"Code interpreter server tool","sidebarTitle":"Code Interpreter","href":"/ai-gateway/features/server-tools/code-interpreter"},{"title":"Shell server tool","sidebarTitle":"Shell","href":"/ai-gateway/features/server-tools/shell"},{"title":"Apply patch server tool","sidebarTitle":"Apply Patch","href":"/ai-gateway/features/server-tools/apply-patch"},{"title":"Knowledge-base server tools","sidebarTitle":"Knowledge Bases","href":"/ai-gateway/features/server-tools/knowledge-bases"},{"title":"Search models server tool","sidebarTitle":"Search Models","href":"/ai-gateway/features/server-tools/search-models"},{"title":"Tool search server tool","sidebarTitle":"Tool Search","href":"/ai-gateway/features/server-tools/tool-search"},{"title":"Subagent server tool","sidebarTitle":"Subagent","href":"/ai-gateway/features/server-tools/subagent"},{"title":"Advisor server tool","sidebarTitle":"Advisor","href":"/ai-gateway/features/server-tools/advisor"},{"title":"Fusion server tool","sidebarTitle":"Fusion","href":"/ai-gateway/features/server-tools/fusion"}]},{"group":"Common Scenarios","icon":"book-open","pages":[{"title":"Multi-tenant setup","sidebarTitle":"Multi-tenant setup","href":"/ai-gateway/multi-tenant-setup"}]}]},{"tab":"AI Observability","pages":[{"title":"AI Observability","href":"/ai-studio/observability/quickstart"}]},{"tab":"Managed agents","pages":[{"title":"Managed agents","href":"/ai-studio/ai-engineering/quickstart"}]},{"tab":"Administration","pages":[{"title":"Administration","href":"/ai-studio/organization/workspace-settings"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/ai-studio/integrations/overview"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/reference/client-libraries"}]},{"tab":"Cookbooks","hidden":true,"pages":[{"title":"Cookbooks","href":"/ai-studio/cookbooks/cookbooks"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/release-4-17"}]}]},"basePath":"","title":"Embeddings - Orq.ai Documentation","buildId":"dpl_GZsjphRpnhWkstV12jxWNcMHFyox","deploymentId":"dpl_GZsjphRpnhWkstV12jxWNcMHFyox","dynamics":[],"chunks":[]}