curl -X POST https://api-llm.sunra.ai/v1/embeddings \ -H "Authorization: Bearer <SUNRA_KEY>" \ -H "Content-Type: application/json" \ -d '{ "model": "google/gemini-embedding-2", "input": [ "The quick brown fox jumps over the lazy dog.", "Sunra is a platform for AI models." ], "dimensions": 768 }'
import requestsresponse = requests.post( "https://api-llm.sunra.ai/v1/embeddings", headers={ "Authorization": "Bearer <SUNRA_KEY>", "Content-Type": "application/json" }, json={ "model": "google/gemini-embedding-2", "input": [ "The quick brown fox jumps over the lazy dog.", "Sunra is a platform for AI models." ], "dimensions": 768 })print(response.json())
const response = await fetch("https://api-llm.sunra.ai/v1/embeddings", { method: "POST", headers: { "Authorization": "Bearer <SUNRA_KEY>", "Content-Type": "application/json" }, body: JSON.stringify({ model: "google/gemini-embedding-2", input: [ "The quick brown fox jumps over the lazy dog.", "Sunra is a platform for AI models." ], dimensions: 768 })});const data = await response.json();console.log(data);
curl -X POST https://api-llm.sunra.ai/v1/embeddings \ -H "Authorization: Bearer <SUNRA_KEY>" \ -H "Content-Type: application/json" \ -d '{ "model": "google/gemini-embedding-2", "input": [ "The quick brown fox jumps over the lazy dog.", "Sunra is a platform for AI models." ], "dimensions": 768 }'
import requestsresponse = requests.post( "https://api-llm.sunra.ai/v1/embeddings", headers={ "Authorization": "Bearer <SUNRA_KEY>", "Content-Type": "application/json" }, json={ "model": "google/gemini-embedding-2", "input": [ "The quick brown fox jumps over the lazy dog.", "Sunra is a platform for AI models." ], "dimensions": 768 })print(response.json())
const response = await fetch("https://api-llm.sunra.ai/v1/embeddings", { method: "POST", headers: { "Authorization": "Bearer <SUNRA_KEY>", "Content-Type": "application/json" }, body: JSON.stringify({ model: "google/gemini-embedding-2", input: [ "The quick brown fox jumps over the lazy dog.", "Sunra is a platform for AI models." ], dimensions: 768 })});const data = await response.json();console.log(data);
Creates embedding vectors from text or media inputs. Text-only requests return one vector per input, useful for retrieval, semantic search, clustering, classification, and RAG. Requests containing media (images, audio, or video as base64 data URIs) fuse all inputs into a single cross-modal vector — embed each asset in its own request when you need one vector per asset. Compatible with the OpenAI Embeddings API format. Streaming is not supported on this endpoint.
Authentication
string
required
Bearer token. Use your API key as the bearer token in the Authorization header.Format: Bearer <SUNRA_KEY>
Request
This endpoint expects an object.
string
required
ID of the embedding model to use, e.g. google/gemini-embedding-2. See the models page for available embedding models.
object
Optional provider routing preferences. Omit for automatic routing. See Provider routing for supported fields and provider discovery.
string | string[]
required
Inputs to embed, as a single string or an array of strings. Text-only inputs are embedded independently, returning one vector per input in input order. Media inputs are passed as base64 data URIs (data:image/png;base64,…, data:audio/mpeg;base64,…, data:video/mp4;base64,…) and may be mixed with text — but any request containing media returns a single fused vector for all inputs combined. Limits (upstream): at most 6 images per request, video up to 120 seconds, and a combined budget of 8,192 tokens across all modalities (text tokens; images count 258 tokens each, audio 25 tokens/second, video 66 tokens/second).
integer
The number of dimensions for the output embeddings. Only supported by models with flexible output dimensions (Matryoshka Representation Learning). For google/gemini-embedding-2 the default is 3072, and values from 128 to 3072 are supported. Smaller values truncate the vector while preserving most semantic quality.
string
The format of the returned embeddings. Either float (default) or base64.
Response
Unlike Chat Completions, Messages, and Responses, the Embeddings response has no id field — the protocol has never had one. To track or look up a specific embeddings request, use the x-sunra-prediction-id response header.
string
Always list.
object[]
A list of embedding objects, one per input, in input order.
Show embedding object
string
Always embedding.
integer
The index of the corresponding input.
number[]
The embedding vector.
string
The model used to create the embeddings.
object
Token usage for the request. Embeddings are billed on input tokens only, with modality-specific rates (see the model page for pricing). Media requests include per-modality token counts.
Show usage object
integer
Number of text input tokens.
integer
Image input tokens (258 per image). Present only when the request contains images.
integer
Audio input tokens (25 per second). Present only when the request contains audio.
integer
Video input tokens (66 per second). Present only when the request contains video.
integer
Total input tokens across all modalities (embeddings produce no output tokens).
curl -X POST https://api-llm.sunra.ai/v1/embeddings \ -H "Authorization: Bearer <SUNRA_KEY>" \ -H "Content-Type: application/json" \ -d '{ "model": "google/gemini-embedding-2", "input": [ "The quick brown fox jumps over the lazy dog.", "Sunra is a platform for AI models." ], "dimensions": 768 }'
import requestsresponse = requests.post( "https://api-llm.sunra.ai/v1/embeddings", headers={ "Authorization": "Bearer <SUNRA_KEY>", "Content-Type": "application/json" }, json={ "model": "google/gemini-embedding-2", "input": [ "The quick brown fox jumps over the lazy dog.", "Sunra is a platform for AI models." ], "dimensions": 768 })print(response.json())
const response = await fetch("https://api-llm.sunra.ai/v1/embeddings", { method: "POST", headers: { "Authorization": "Bearer <SUNRA_KEY>", "Content-Type": "application/json" }, body: JSON.stringify({ model: "google/gemini-embedding-2", input: [ "The quick brown fox jumps over the lazy dog.", "Sunra is a platform for AI models." ], dimensions: 768 })});const data = await response.json();console.log(data);
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Sunra.ai","colors":{"primary":"#ff632f","light":"#ff632f","dark":"#ff632f"},"logo":{"light":"https://mintcdn.com/sunraai/U2o8uzmv75no70tM/logo/light.svg?fit=max\u0026auto=format\u0026n=U2o8uzmv75no70tM\u0026q=85\u0026s=520c0afb29ad1fddc46fec66c975eb2a","dark":"https://mintcdn.com/sunraai/U2o8uzmv75no70tM/logo/dark.svg?fit=max\u0026auto=format\u0026n=U2o8uzmv75no70tM\u0026q=85\u0026s=16e2ed4856376448550627daa81544b9"},"favicon":"https://mintcdn.com/sunraai/U2o8uzmv75no70tM/favicon.svg?fit=max\u0026auto=format\u0026n=U2o8uzmv75no70tM\u0026q=85\u0026s=c47b7db8e76fb19f94de55c161e2fcd1","api":{},"navbar":{"links":[{"href":"https://sunra.ai/about","label":"About"}],"primary":{"type":"button","label":"Go to sunra.ai","href":"https://sunra.ai"}},"footer":{"socials":{"x":"https://x.com/sunra_ai","discord":"https://discord.gg/897qCzvCcU","github":"https://github.com/sunra-ai"}},"integrations":{"amplitude":{"apiKey":"94a6621e5239157d3f0a392f6d5f8a21"}},"banner":{"content":"The developer site has moved to **platform.sunra.ai**. API endpoints, SDKs and keys are unchanged — you may just need to sign in again.","dismissible":true},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"X (Twitter)","icon":"x-twitter","href":"https://x.com/sunra_ai"},{"anchor":"Discord","icon":"discord","href":"https://discord.gg/897qCzvCcU"},{"anchor":"GitHub","icon":"github","href":"https://github.com/sunra-ai"}]},"languages":[{"language":"en","href":""},{"language":"zh-Hans","href":"zh-Hans"},{"language":"zh-Hant","href":"zh-Hant"},{"language":"fr","href":"fr"},{"language":"ja","href":"ja"},{"language":"es","href":"es"},{"language":"pt","href":"pt"},{"language":"hi","href":"hi"},{"language":"tr","href":"tr"},{"language":"de","href":"de"},{"language":"id","href":"id"},{"language":"it","href":"it"},{"language":"ko","href":"ko"},{"language":"ru","href":"ru"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"sunraai","hasAudioNarration":false,"actualSubdomain":"sunraai","customDomains":["docs.sunra.ai"],"gitSource":{"type":"github","owner":"sunra-ai","repo":"sunra-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10b5f99ffae5051c400b38"},"entitlements":{},"buildId":"6b0173620081ff9d8e91581e","clientVersion":"0.0.4428","searchFilterCounts":[{"language":"en","tag":"Multimodal","count":10},{"language":"en","tag":"LLM","count":9},{"language":"de","tag":"Multimodal","count":9},{"language":"es","tag":"Multimodal","count":9},{"language":"fr","tag":"Multimodal","count":9},{"language":"hi","tag":"Multimodal","count":9},{"language":"id","tag":"Multimodal","count":9},{"language":"it","tag":"Multimodal","count":9},{"language":"ja","tag":"Multimodal","count":9},{"language":"ko","tag":"Multimodal","count":9},{"language":"pt","tag":"Multimodal","count":9},{"language":"ru","tag":"Multimodal","count":9},{"language":"tr","tag":"Multimodal","count":9},{"language":"zh-Hans","tag":"Multimodal","count":9},{"language":"zh-Hant","tag":"Multimodal","count":9},{"language":"zh-Hans","tag":"LLM","count":8},{"language":"en","tag":"Platform","count":6},{"language":"de","tag":"LLM","count":6},{"language":"es","tag":"LLM","count":6},{"language":"fr","tag":"LLM","count":6},{"language":"hi","tag":"LLM","count":6},{"language":"id","tag":"LLM","count":6},{"language":"it","tag":"LLM","count":6},{"language":"ja","tag":"LLM","count":6},{"language":"ko","tag":"LLM","count":6},{"language":"pt","tag":"LLM","count":6},{"language":"ru","tag":"LLM","count":6},{"language":"tr","tag":"LLM","count":6},{"language":"zh-Hant","tag":"LLM","count":6},{"language":"zh-Hans","tag":"平台","count":5},{"language":"en","tag":"Client Libraries","count":4},{"language":"de","tag":"Client-Bibliotheken","count":4},{"language":"es","tag":"Bibliotecas de cliente","count":4},{"language":"fr","tag":"Bibliothèques clientes","count":4},{"language":"hi","tag":"क्लाइंट लाइब्रेरी","count":4},{"language":"id","tag":"Pustaka Klien","count":4},{"language":"it","tag":"Librerie client","count":4},{"language":"ja","tag":"クライアントライブラリ","count":4},{"language":"ko","tag":"클라이언트 라이브러리","count":4},{"language":"pt","tag":"Bibliotecas de cliente","count":4},{"language":"ru","tag":"Клиентские библиотеки","count":4},{"language":"tr","tag":"İstemci Kütüphaneleri","count":4},{"language":"zh-Hans","tag":"客户端 SDK","count":4},{"language":"zh-Hant","tag":"客戶端 SDK","count":4},{"language":"en","tag":"Overview","count":1},{"language":"de","tag":"Überblick","count":1},{"language":"es","tag":"Descripción general","count":1},{"language":"fr","tag":"Aperçu","count":1},{"language":"hi","tag":"अवलोकन","count":1},{"language":"id","tag":"Ikhtisar","count":1},{"language":"it","tag":"Panoramica","count":1},{"language":"ja","tag":"概要","count":1},{"language":"ko","tag":"개요","count":1},{"language":"pt","tag":"Visão geral","count":1},{"language":"ru","tag":"Обзор","count":1},{"language":"tr","tag":"Genel Bakış","count":1},{"language":"zh-Hans","tag":"概述","count":1},{"language":"zh-Hant","tag":"概述","count":1}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#navbar>div>div>div>div>div{border-bottom:0}.codeblock-light{background:#fafafa!important}.dark .codeblock-light{background:#0a0a0a!important}#search-bar-entry>span{font-weight:400!important}#assistant-entry>span{color:black!important}.dark #assistant-entry>span{color:white!important}.rounded-sm,.rounded-md,.rounded-lg,.rounded-xl,.rounded-2xl,.rounded-3xl,.rounded-full,.rounded-\\[14px\\]{border-radius:4px!important}"}]}
{"page":{"pagePath":"llm/embeddings","slug":"/llm/embeddings","pageMetadata":{"title":"Create embeddings","api":"POST https://api-llm.sunra.ai/v1/embeddings","description":null,"href":"/llm/embeddings"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,strong:`strong`,..._provideComponents(),...props.components},{Expandable,Heading,Note,ParamField,ResponseField}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Creates embedding vectors from text or media inputs. Text-only requests return one vector per input, useful for retrieval, semantic search, clustering, classification, and RAG. Requests containing media (images, audio, or video as base64 data URIs) fuse `,_jsx(_components.strong,{children:`all`}),` inputs into a `,_jsx(_components.strong,{children:`single`}),` cross-modal vector — embed each asset in its own request when you need one vector per asset. Compatible with the OpenAI Embeddings API format. Streaming is not supported on this endpoint.`]}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsxs(ParamField,{header:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:[_jsx(_components.p,{children:`Bearer token. Use your API key as the bearer token in the Authorization header.`}),_jsxs(_components.p,{children:[`Format: `,_jsx(_components.code,{children:`Bearer \u003cSUNRA_KEY>`})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`request`,children:`Request`}),`\n`,_jsx(_components.p,{children:`This endpoint expects an object.`}),`\n`,_jsx(ParamField,{body:`model`,type:`string`,required:true,id:`param-model`,children:_jsxs(_components.p,{children:[`ID of the embedding model to use, e.g. `,_jsx(_components.code,{children:`google/gemini-embedding-2`}),`. See the `,_jsx(_components.a,{href:`https://sunra.ai/models`,children:`models page`}),` for available embedding models.`]})}),`\n`,_jsx(ParamField,{body:`provider`,type:`object`,id:`param-provider`,children:_jsxs(_components.p,{children:[`Optional provider routing preferences. Omit for automatic routing. See `,_jsx(_components.a,{href:`/llm/provider-routing`,children:`Provider routing`}),` for supported fields and provider discovery.`]})}),`\n`,_jsx(ParamField,{body:`input`,type:`string | string[]`,required:true,id:`param-input`,children:_jsxs(_components.p,{children:[`Inputs to embed, as a single string or an array of strings. Text-only inputs are embedded independently, returning one vector per input in input order. Media inputs are passed as base64 data URIs (`,_jsx(_components.code,{children:`data:image/png;base64,…`}),`, `,_jsx(_components.code,{children:`data:audio/mpeg;base64,…`}),`, `,_jsx(_components.code,{children:`data:video/mp4;base64,…`}),`) and may be mixed with text — but any request containing media returns a single fused vector for all inputs combined. Limits (upstream): at most 6 images per request, video up to 120 seconds, and a combined budget of 8,192 tokens across all modalities (text tokens; images count 258 tokens each, audio 25 tokens/second, video 66 tokens/second).`]})}),`\n`,_jsx(ParamField,{body:`dimensions`,type:`integer`,id:`param-dimensions`,children:_jsxs(_components.p,{children:[`The number of dimensions for the output embeddings. Only supported by models with flexible output dimensions (Matryoshka Representation Learning). For `,_jsx(_components.code,{children:`google/gemini-embedding-2`}),` the default is `,_jsx(_components.code,{children:`3072`}),`, and values from `,_jsx(_components.code,{children:`128`}),` to `,_jsx(_components.code,{children:`3072`}),` are supported. Smaller values truncate the vector while preserving most semantic quality.`]})}),`\n`,_jsx(ParamField,{body:`encoding_format`,type:`string`,id:`param-encoding-format`,children:_jsxs(_components.p,{children:[`The format of the returned embeddings. Either `,_jsx(_components.code,{children:`float`}),` (default) or `,_jsx(_components.code,{children:`base64`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Unlike Chat Completions, Messages, and Responses, the Embeddings response has no `,_jsx(_components.code,{children:`id`}),` field — the protocol has never had one. To track or look up a specific embeddings request, use the `,_jsxs(_components.a,{href:`/llm/response-tracking#the-x-sunra-prediction-id-header`,children:[_jsx(_components.code,{children:`x-sunra-prediction-id`}),` response header`]}),`.`]})}),`\n`,_jsx(ResponseField,{name:`object`,type:`string`,id:`param-object`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`list`}),`.`]})}),`\n`,_jsxs(ResponseField,{name:`data`,type:`object[]`,id:`param-data`,children:[_jsx(_components.p,{children:`A list of embedding objects, one per input, in input order.`}),_jsxs(Expandable,{title:`embedding object`,children:[_jsx(ResponseField,{name:`object`,type:`string`,id:`param-object-1`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`embedding`}),`.`]})}),_jsx(ResponseField,{name:`index`,type:`integer`,id:`param-index`,children:_jsx(_components.p,{children:`The index of the corresponding input.`})}),_jsx(ResponseField,{name:`embedding`,type:`number[]`,id:`param-embedding`,children:_jsx(_components.p,{children:`The embedding vector.`})})]})]}),`\n`,_jsx(ResponseField,{name:`model`,type:`string`,id:`param-model-1`,children:_jsx(_components.p,{children:`The model used to create the embeddings.`})}),`\n`,_jsxs(ResponseField,{name:`usage`,type:`object`,id:`param-usage`,children:[_jsx(_components.p,{children:`Token usage for the request. Embeddings are billed on input tokens only, with modality-specific rates (see the model page for pricing). Media requests include per-modality token counts.`}),_jsxs(Expandable,{title:`usage object`,children:[_jsx(ResponseField,{name:`prompt_tokens`,type:`integer`,id:`param-prompt-tokens`,children:_jsx(_components.p,{children:`Number of text input tokens.`})}),_jsx(ResponseField,{name:`input_image_tokens`,type:`integer`,id:`param-input-image-tokens`,children:_jsx(_components.p,{children:`Image input tokens (258 per image). Present only when the request contains images.`})}),_jsx(ResponseField,{name:`input_audio_tokens`,type:`integer`,id:`param-input-audio-tokens`,children:_jsx(_components.p,{children:`Audio input tokens (25 per second). Present only when the request contains audio.`})}),_jsx(ResponseField,{name:`input_video_tokens`,type:`integer`,id:`param-input-video-tokens`,children:_jsx(_components.p,{children:`Video input tokens (66 per second). Present only when the request contains video.`})}),_jsx(ResponseField,{name:`total_tokens`,type:`integer`,id:`param-total-tokens`,children:_jsx(_components.p,{children:`Total input tokens across all modalities (embeddings produce no output tokens).`})})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create embeddings","api":"POST https://api-llm.sunra.ai/v1/embeddings","description":null,"href":"/llm/embeddings"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Note,ParamField,RequestExample,ResponseExample,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Creates embedding vectors from text or media inputs. Text-only requests return one vector per input, useful for retrieval, semantic search, clustering, classification, and RAG. Requests containing media (images, audio, or video as base64 data URIs) fuse `,_jsx(_components.strong,{children:`all`}),` inputs into a `,_jsx(_components.strong,{children:`single`}),` cross-modal vector — embed each asset in its own request when you need one vector per asset. Compatible with the OpenAI Embeddings API format. Streaming is not supported on this endpoint.`]}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsxs(ParamField,{header:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:[_jsx(_components.p,{children:`Bearer token. Use your API key as the bearer token in the Authorization header.`}),_jsxs(_components.p,{children:[`Format: `,_jsx(_components.code,{children:`Bearer \u003cSUNRA_KEY>`})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`request`,children:`Request`}),`\n`,_jsx(_components.p,{children:`This endpoint expects an object.`}),`\n`,_jsx(ParamField,{body:`model`,type:`string`,required:true,id:`param-model`,children:_jsxs(_components.p,{children:[`ID of the embedding model to use, e.g. `,_jsx(_components.code,{children:`google/gemini-embedding-2`}),`. See the `,_jsx(_components.a,{href:`https://sunra.ai/models`,children:`models page`}),` for available embedding models.`]})}),`\n`,_jsx(ParamField,{body:`provider`,type:`object`,id:`param-provider`,children:_jsxs(_components.p,{children:[`Optional provider routing preferences. Omit for automatic routing. See `,_jsx(_components.a,{href:`/llm/provider-routing`,children:`Provider routing`}),` for supported fields and provider discovery.`]})}),`\n`,_jsx(ParamField,{body:`input`,type:`string | string[]`,required:true,id:`param-input`,children:_jsxs(_components.p,{children:[`Inputs to embed, as a single string or an array of strings. Text-only inputs are embedded independently, returning one vector per input in input order. Media inputs are passed as base64 data URIs (`,_jsx(_components.code,{children:`data:image/png;base64,…`}),`, `,_jsx(_components.code,{children:`data:audio/mpeg;base64,…`}),`, `,_jsx(_components.code,{children:`data:video/mp4;base64,…`}),`) and may be mixed with text — but any request containing media returns a single fused vector for all inputs combined. Limits (upstream): at most 6 images per request, video up to 120 seconds, and a combined budget of 8,192 tokens across all modalities (text tokens; images count 258 tokens each, audio 25 tokens/second, video 66 tokens/second).`]})}),`\n`,_jsx(ParamField,{body:`dimensions`,type:`integer`,id:`param-dimensions`,children:_jsxs(_components.p,{children:[`The number of dimensions for the output embeddings. Only supported by models with flexible output dimensions (Matryoshka Representation Learning). For `,_jsx(_components.code,{children:`google/gemini-embedding-2`}),` the default is `,_jsx(_components.code,{children:`3072`}),`, and values from `,_jsx(_components.code,{children:`128`}),` to `,_jsx(_components.code,{children:`3072`}),` are supported. Smaller values truncate the vector while preserving most semantic quality.`]})}),`\n`,_jsx(ParamField,{body:`encoding_format`,type:`string`,id:`param-encoding-format`,children:_jsxs(_components.p,{children:[`The format of the returned embeddings. Either `,_jsx(_components.code,{children:`float`}),` (default) or `,_jsx(_components.code,{children:`base64`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Unlike Chat Completions, Messages, and Responses, the Embeddings response has no `,_jsx(_components.code,{children:`id`}),` field — the protocol has never had one. To track or look up a specific embeddings request, use the `,_jsxs(_components.a,{href:`/llm/response-tracking#the-x-sunra-prediction-id-header`,children:[_jsx(_components.code,{children:`x-sunra-prediction-id`}),` response header`]}),`.`]})}),`\n`,_jsx(ResponseField,{name:`object`,type:`string`,id:`param-object`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`list`}),`.`]})}),`\n`,_jsxs(ResponseField,{name:`data`,type:`object[]`,id:`param-data`,children:[_jsx(_components.p,{children:`A list of embedding objects, one per input, in input order.`}),_jsxs(Expandable,{title:`embedding object`,children:[_jsx(ResponseField,{name:`object`,type:`string`,id:`param-object-1`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`embedding`}),`.`]})}),_jsx(ResponseField,{name:`index`,type:`integer`,id:`param-index`,children:_jsx(_components.p,{children:`The index of the corresponding input.`})}),_jsx(ResponseField,{name:`embedding`,type:`number[]`,id:`param-embedding`,children:_jsx(_components.p,{children:`The embedding vector.`})})]})]}),`\n`,_jsx(ResponseField,{name:`model`,type:`string`,id:`param-model-1`,children:_jsx(_components.p,{children:`The model used to create the embeddings.`})}),`\n`,_jsxs(ResponseField,{name:`usage`,type:`object`,id:`param-usage`,children:[_jsx(_components.p,{children:`Token usage for the request. Embeddings are billed on input tokens only, with modality-specific rates (see the model page for pricing). Media requests include per-modality token counts.`}),_jsxs(Expandable,{title:`usage object`,children:[_jsx(ResponseField,{name:`prompt_tokens`,type:`integer`,id:`param-prompt-tokens`,children:_jsx(_components.p,{children:`Number of text input tokens.`})}),_jsx(ResponseField,{name:`input_image_tokens`,type:`integer`,id:`param-input-image-tokens`,children:_jsx(_components.p,{children:`Image input tokens (258 per image). Present only when the request contains images.`})}),_jsx(ResponseField,{name:`input_audio_tokens`,type:`integer`,id:`param-input-audio-tokens`,children:_jsx(_components.p,{children:`Audio input tokens (25 per second). Present only when the request contains audio.`})}),_jsx(ResponseField,{name:`input_video_tokens`,type:`integer`,id:`param-input-video-tokens`,children:_jsx(_components.p,{children:`Video input tokens (66 per second). Present only when the request contains video.`})}),_jsx(ResponseField,{name:`total_tokens`,type:`integer`,id:`param-total-tokens`,children:_jsx(_components.p,{children:`Total input tokens across all modalities (embeddings produce no output tokens).`})})]})]}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`11`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api-llm.sunra.ai/v1/embeddings`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer \u003cSUNRA_KEY>\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"google/gemini-embedding-2\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"The quick brown fox jumps over the lazy dog.\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Sunra is a platform for AI models.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"dimensions\": 768`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,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:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api-llm.sunra.ai/v1/embeddings\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer \u003cSUNRA_KEY>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"google/gemini-embedding-2\"`}),_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:` \"input\"`}),_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:` \"The quick brown fox jumps over the lazy dog.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Sunra is a platform for AI models.\"`})}),`\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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"dimensions\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`768`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(response.json())`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`17`,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:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api-llm.sunra.ai/v1/embeddings\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Bearer \u003cSUNRA_KEY>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"application/json\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"google/gemini-embedding-2\"`}),_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:` input:`}),_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:` \"The quick brown fox jumps over the lazy dog.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Sunra is a platform for AI models.\"`})}),`\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:` dimensions:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 768`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})})]}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`200`,numberOfLines:`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:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"list\"`}),_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:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_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:`\"embedding\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"index\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"embedding\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.011253`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`-0.020551`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.049236`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#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:`\"embedding\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"index\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_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:` \"embedding\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.031744`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.008122`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`-0.014307`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#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:`\"google/gemini-embedding-2\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"prompt_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`18`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"total_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`18`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create embeddings","api":"POST https://api-llm.sunra.ai/v1/embeddings","description":null,"href":"/llm/embeddings"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"Request","slug":"request","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"11\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://api-llm.sunra.ai/v1/embeddings\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization: Bearer \u0026#x3C;SUNRA_KEY>\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type: application/json\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -d\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"model\": \"google/gemini-embedding-2\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"input\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"The quick brown fox jumps over the lazy dog.\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Sunra is a platform for AI models.\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"dimensions\": 768\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Python","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"18\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">import\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">response \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests.post(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"https://api-llm.sunra.ai/v1/embeddings\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> headers\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Bearer \u0026#x3C;SUNRA_KEY>\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"application/json\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> json\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"model\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"google/gemini-embedding-2\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"input\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"The quick brown fox jumps over the lazy dog.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Sunra is a platform for AI models.\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"dimensions\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">768\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">print\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(response.json())\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"JavaScript","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"17\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> response\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> fetch\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://api-llm.sunra.ai/v1/embeddings\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> method:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"POST\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> headers:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Bearer \u0026#x3C;SUNRA_KEY>\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"application/json\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> body:\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> JSON\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">stringify\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">({\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> model:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"google/gemini-embedding-2\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> input:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"The quick brown fox jumps over the lazy dog.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Sunra is a platform for AI models.\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> dimensions:\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\"> 768\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> })\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">});\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> data\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> response\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">json\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">();\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">console\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">log\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">data\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"200","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"20\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"object\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"list\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"data\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"object\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"embedding\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"index\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"embedding\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0.011253\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">-0.020551\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0.049236\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"...\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"object\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"embedding\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"index\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">1\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"embedding\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0.031744\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0.008122\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">-0.014307\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"...\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"model\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"google/gemini-embedding-2\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"usage\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"prompt_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">18\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"total_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">18\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Create embeddings","path":"/v1/embeddings","servers":[{"url":"https://api-llm.sunra.ai"}],"method":"post","request":{"security":[],"parameters":{"query":{},"header":{"Authorization":{"schema":[{"type":"string","description":"Bearer token. Use your API key as the bearer token in the Authorization header. Format: `Bearer \u003cSUNRA_KEY>`","required":true}]}},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"model":[{"type":"string","description":"ID of the embedding model to use, e.g. `google/gemini-embedding-2` . See the models page for available embedding models.","required":true}],"provider":[{"type":"object","properties":{},"description":"Optional provider routing preferences. Omit for automatic routing. See Provider routing for supported fields and provider discovery."}],"input":[{"type":"array","items":[{"type":"string"}],"description":"Inputs to embed, as a single string or an array of strings. Text-only inputs are embedded independently, returning one vector per input in input order. Media inputs are passed as base64 data URIs ( `data:image/png;base64,…` , `data:audio/mpeg;base64,…` , `data:video/mp4;base64,…` ) and may be mixed with text — but any request containing media returns a single fused vector for all inputs combined. Limits (upstream): at most 6 images per request, video up to 120 seconds, and a combined budget of 8,192 tokens across all modalities (text tokens; images count 258 tokens each, audio 25 tokens/second, video 66 tokens/second).","required":true}],"dimensions":[{"type":"integer","description":"The number of dimensions for the output embeddings. Only supported by models with flexible output dimensions (Matryoshka Representation Learning). For `google/gemini-embedding-2` the default is `3072` , and values from `128` to `3072` are supported. Smaller values truncate the vector while preserving most semantic quality."}],"encoding_format":[{"type":"string","description":"The format of the returned embeddings. Either `float` (default) or `base64` ."}]}}],"examples":{"example":{"value":{"model":"\u003cstring>","provider":{},"input":["\u003cstring>"],"dimensions":123,"encoding_format":"\u003cstring>"}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"object":[{"type":"string","description":"Always `list` ."}],"data":[{"type":"array","items":[{"type":"object","properties":{"object":[{"type":"string","description":"Always `embedding` ."}],"index":[{"type":"integer","description":"The index of the corresponding input."}],"embedding":[{"type":"array","items":[{"type":"number"}],"description":"The embedding vector."}]}}],"description":"A list of embedding objects, one per input, in input order."}],"model":[{"type":"string","description":"The model used to create the embeddings."}],"usage":[{"type":"object","properties":{"prompt_tokens":[{"type":"integer","description":"Number of text input tokens."}],"input_image_tokens":[{"type":"integer","description":"Image input tokens (258 per image). Present only when the request contains images."}],"input_audio_tokens":[{"type":"integer","description":"Audio input tokens (25 per second). Present only when the request contains audio."}],"input_video_tokens":[{"type":"integer","description":"Video input tokens (66 per second). Present only when the request contains video."}],"total_tokens":[{"type":"integer","description":"Total input tokens across all modalities (embeddings produce no output tokens)."}]},"description":"Token usage for the request. Embeddings are billed on input tokens only, with modality-specific rates (see the model page for pricing). Media requests include per-modality token counts."}]}}],"examples":{"example":{"value":{"object":"\u003cstring>","data":[{"object":"\u003cstring>","index":123,"embedding":[123]}],"model":"\u003cstring>","usage":{"prompt_tokens":123,"input_image_tokens":123,"input_audio_tokens":123,"input_video_tokens":123,"total_tokens":123}}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"sunraai","siteName":"Sunra.ai","title":"Create embeddings - Sunra.ai","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/llm/embeddings","matchLevel":0},"zh-Hans":{"href":"/zh-Hans/llm/embeddings","matchLevel":1},"zh-Hant":{"href":"/zh-Hant/llm/embeddings","matchLevel":1},"fr":{"href":"/fr/llm/embeddings","matchLevel":1},"ja":{"href":"/ja/llm/embeddings","matchLevel":1},"es":{"href":"/es/llm/embeddings","matchLevel":1},"pt":{"href":"/pt/llm/embeddings","matchLevel":1},"hi":{"href":"/hi/llm/embeddings","matchLevel":1},"tr":{"href":"/tr/llm/embeddings","matchLevel":1},"de":{"href":"/de/llm/embeddings","matchLevel":1},"id":{"href":"/id/llm/embeddings","matchLevel":1},"it":{"href":"/it/llm/embeddings","matchLevel":1},"ko":{"href":"/ko/llm/embeddings","matchLevel":1},"ru":{"href":"/ru/llm/embeddings","matchLevel":1}}},"lastModified":"2026-09-19T11:27:30.131Z","originalFileLocation":"llm/embeddings.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Sunra.ai\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create embeddings - Sunra.ai\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Sunra.ai\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.sunra.ai/llm/embeddings\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://sunraai.mintlify.site/_mintlify/api/og/v2?division=LLM\u0026amp;title=Create+embeddings\u0026amp;theme=92a2872f0bfcc950cc6cb718\u0026amp;signature=d003b8a1edab462a76dba4b4b9238a1996f71b5cb12314a47cdb865ebf6dcef8\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create embeddings - Sunra.ai\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://sunraai.mintlify.site/_mintlify/api/og/v2?division=LLM\u0026amp;title=Create+embeddings\u0026amp;theme=92a2872f0bfcc950cc6cb718\u0026amp;signature=d003b8a1edab462a76dba4b4b9238a1996f71b5cb12314a47cdb865ebf6dcef8\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Sunra.ai\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#ff632f\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.sunra.ai/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/llm/embeddings.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.sunra.ai/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hans\" href=\"https://docs.sunra.ai/zh-Hans/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hant\" href=\"https://docs.sunra.ai/zh-Hant/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"fr\" href=\"https://docs.sunra.ai/fr/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://docs.sunra.ai/ja/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"es\" href=\"https://docs.sunra.ai/es/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"pt\" href=\"https://docs.sunra.ai/pt/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"hi\" href=\"https://docs.sunra.ai/hi/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"tr\" href=\"https://docs.sunra.ai/tr/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"de\" href=\"https://docs.sunra.ai/de/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"id\" href=\"https://docs.sunra.ai/id/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"it\" href=\"https://docs.sunra.ai/it/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://docs.sunra.ai/ko/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ru\" href=\"https://docs.sunra.ai/ru/llm/embeddings\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.sunra.ai/llm/embeddings\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.sunra.ai/#organization\",\"name\":\"Sunra.ai\",\"url\":\"https://docs.sunra.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/sunraai/U2o8uzmv75no70tM/logo/light.svg?fit=max\u0026auto=format\u0026n=U2o8uzmv75no70tM\u0026q=85\u0026s=520c0afb29ad1fddc46fec66c975eb2a\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.sunra.ai#website\",\"name\":\"Sunra.ai\",\"url\":\"https://docs.sunra.ai\",\"publisher\":{\"@id\":\"https://docs.sunra.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.sunra.ai/llm/embeddings#webpage\",\"url\":\"https://docs.sunra.ai/llm/embeddings\",\"name\":\"Create embeddings\",\"dateModified\":\"2026-09-19T11:27:30.131Z\",\"isPartOf\":{\"@id\":\"https://docs.sunra.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.sunra.ai/llm/embeddings#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.sunra.ai/llm/embeddings#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"LLM\",\"item\":\"https://docs.sunra.ai/llm/llm-quickstart\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create embeddings\",\"item\":\"https://docs.sunra.ai/llm/embeddings\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.sunra.ai/llm/embeddings#apireference\",\"headline\":\"Create embeddings\",\"name\":\"Create embeddings\",\"url\":\"https://docs.sunra.ai/llm/embeddings\",\"mainEntityOfPage\":{\"@id\":\"https://docs.sunra.ai/llm/embeddings#webpage\"},\"dateModified\":\"2026-09-19T11:27:30.131Z\",\"publisher\":{\"@id\":\"https://docs.sunra.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.sunra.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Sunra.ai\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Sunra.ai\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/llm/embeddings.md","siteName":"Sunra.ai","nav":{"global":{"anchors":[{"anchor":"X (Twitter)","icon":"x-twitter","href":"https://x.com/sunra_ai"},{"anchor":"Discord","icon":"discord","href":"https://discord.gg/897qCzvCcU"},{"anchor":"GitHub","icon":"github","href":"https://github.com/sunra-ai"}]},"languages":[{"language":"en","groups":[{"group":"Overview","pages":[{"title":"Documentation","href":""}]},{"group":"Platform","pages":[{"title":"Authentication","href":"/platform/authentication"},{"title":"Budget keys","href":"/platform/budget-keys"},{"title":"Shared budget pools","href":"/platform/budget-pools"},{"title":"File Upload","href":"/platform/file-upload"},{"title":"Pricing","href":"/platform/pricing"},{"title":"Errors","href":"/platform/errors"}]},{"group":"Multimodal","pages":[{"title":"Quickstart","href":"/multimodal/quickstart"},{"title":"Text to Image","href":"/multimodal/text-to-image"},{"title":"Text to Video","href":"/multimodal/text-to-video"},{"title":"Image to Video","href":"/multimodal/image-to-video"},{"title":"Speech to Text","href":"/multimodal/speech-to-text"},{"title":"ElevenLabs Voices","href":"/multimodal/elevenlabs-voices"},{"title":"Canonical Model Endpoints","href":"/multimodal/canonical-model-endpoints"},{"title":"MCP Server","href":"/multimodal/mcp-server-setup"},{"title":"Queue","href":"/multimodal/queue"},{"title":"Server-Side Integration","href":"/multimodal/server-side-integration"}]},{"group":"LLM","pages":[{"title":"LLM Quickstart","href":"/llm/llm-quickstart"},{"title":"Provider routing","href":"/llm/provider-routing"},{"title":"Token usage","href":"/llm/token-usage"},{"title":"Output limits and stream lifetime","href":"/llm/limits"},{"title":"Response identifiers and tracking","href":"/llm/response-tracking"},{"title":"Create a chat completion","api":"POST https://api-llm.sunra.ai/v1/chat/completions","href":"/llm/chat"},{"title":"Create a message","api":"POST https://api-llm.sunra.ai/v1/messages","href":"/llm/messages"},{"title":"Create a response","api":"POST https://api-llm.sunra.ai/v1/responses","description":null,"href":"/llm/responses"},{"title":"Create embeddings","api":"POST https://api-llm.sunra.ai/v1/embeddings","href":"/llm/embeddings"}]},{"group":"Client Libraries","pages":[{"title":"JavaScript / TypeScript","description":null,"href":"/client-libraries/javascript"},{"title":"Python","href":"/client-libraries/python"},{"title":"Java","href":"/client-libraries/java"},{"title":"Request New Client","href":"/client-libraries/request-new-client"}]}]},{"language":"zh-Hans","pages":[{"title":"zh-Hans","href":"/zh-Hans/llm/embeddings"}]},{"language":"zh-Hant","pages":[{"title":"zh-Hant","href":"/zh-Hant/llm/embeddings"}]},{"language":"fr","pages":[{"title":"fr","href":"/fr/llm/embeddings"}]},{"language":"ja","pages":[{"title":"ja","href":"/ja/llm/embeddings"}]},{"language":"es","pages":[{"title":"es","href":"/es/llm/embeddings"}]},{"language":"pt","pages":[{"title":"pt","href":"/pt/llm/embeddings"}]},{"language":"hi","pages":[{"title":"hi","href":"/hi/llm/embeddings"}]},{"language":"tr","pages":[{"title":"tr","href":"/tr/llm/embeddings"}]},{"language":"de","pages":[{"title":"de","href":"/de/llm/embeddings"}]},{"language":"id","pages":[{"title":"id","href":"/id/llm/embeddings"}]},{"language":"it","pages":[{"title":"it","href":"/it/llm/embeddings"}]},{"language":"ko","pages":[{"title":"ko","href":"/ko/llm/embeddings"}]},{"language":"ru","pages":[{"title":"ru","href":"/ru/llm/embeddings"}]}]},"basePath":"","title":"Create embeddings - Sunra.ai","deploymentId":"dpl_4dgnk6TA5fUgboKHTvWWyeqm3idh","buildId":"dpl_4dgnk6TA5fUgboKHTvWWyeqm3idh","dynamics":["10e4515597","c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["BannerMarkdown-gMqjY6PA.js","dist-Bp7AI3M8.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js","OpenApiReferenceProvider-5zXlUUV6.js","snippetPresets-D3m2eL-0.js","utils-u8TSWPiZ.js","style-to-object-BY3JEAdk.js","utils-D3TDKJCH.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-Om0Y4Ijd.js","conditional-requirements-CFM0id0Q.js","cloneDeep-Cyl7LOol.js","_Uint8Array-BuOv0f5_.js","isObject-FP1Yky1u.js","ApiExamples-BnqLE2Kf.js","usePlaygroundInputsStore-DhQKVH9n.js","shallow-BOCfJNQU.js","isEqual-BrbSa25D.js","CodeSnippets-DUGBlB-S.js","CodeSnippet-CuGpPhIN.js","use-playground-group-access-DYZiRN3l.js","Page-DdEXfHxg.js","api-description-markdown-DDasI_tu.js","DynamicMarkdown-DoPsKgYC.js","SectionHeading-CKObOTcn.js","MethodPill-D_DqPuJw.js","getPastedJson-DWfa7n0M.js","Check2Icon-CEquKboc.js","axios-CsQoIw0U.js"]}