import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["NAGA_API_KEY"],
base_url="https://api.naga.ac/v1",
)
result = client.embeddings.create(
model="google/gemini-embedding-2",
input="The quick brown fox jumps over the lazy dog",
)
print(result)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.NAGA_API_KEY,
baseURL: "https://api.naga.ac/v1",
});
const result = await client.embeddings.create({
model: "google/gemini-embedding-2",
input: "The quick brown fox jumps over the lazy dog",
});
console.log(result);
curl https://api.naga.ac/v1/embeddings \
-H "Authorization: Bearer $NAGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-embedding-2",
"input": "The quick brown fox jumps over the lazy dog"
}'
{
"error": {
"type": "invalid_api_key",
"message": "The provided API key is invalid. Please ensure your API key is correct and active. You can find more information about obtaining a key on our website: https://naga.ac If you just created this key, wait a few minutes and try again."
}
}
{
"error": {
"type": "insufficient_quota",
"message": "More credits required to process this request. Visit https://naga.ac/dashboard/credits to add credits."
}
}
{
"error": {
"type": "rate_limit_exceeded",
"message": "Free model limit reached (100 requests per day and 10 per minute). Try again in 3s, or add credits at https://naga.ac/dashboard/credits to use paid models, which have no request limit."
}
}
Creates an embedding vector for the input and charges the account for the tokens it counted. Requires an API key.
POST
https://api.naga.ac
/
v1
/
embeddings
openai-python
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["NAGA_API_KEY"],
base_url="https://api.naga.ac/v1",
)
result = client.embeddings.create(
model="google/gemini-embedding-2",
input="The quick brown fox jumps over the lazy dog",
)
print(result)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.NAGA_API_KEY,
baseURL: "https://api.naga.ac/v1",
});
const result = await client.embeddings.create({
model: "google/gemini-embedding-2",
input: "The quick brown fox jumps over the lazy dog",
});
console.log(result);
curl https://api.naga.ac/v1/embeddings \
-H "Authorization: Bearer $NAGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-embedding-2",
"input": "The quick brown fox jumps over the lazy dog"
}'
{
"error": {
"type": "invalid_api_key",
"message": "The provided API key is invalid. Please ensure your API key is correct and active. You can find more information about obtaining a key on our website: https://naga.ac If you just created this key, wait a few minutes and try again."
}
}
{
"error": {
"type": "insufficient_quota",
"message": "More credits required to process this request. Visit https://naga.ac/dashboard/credits to add credits."
}
}
{
"error": {
"type": "rate_limit_exceeded",
"message": "Free model limit reached (100 requests per day and 10 per minute). Try again in 3s, or add credits at https://naga.ac/dashboard/credits to use paid models, which have no request limit."
}
}
An account API key. Send it as Authorization: Bearer <key>.
Body
application/json
The request body of POST /v1/embeddings.
model
string
required
The model to embed with, named by its id or alias. An entry without the embeddings capability draws a refusal.
input
stringstring[]integer<int64>[]integer<int64>[][]
required
What to embed: strings, token ids, or arrays of either.
models
string[] | null
Fallback models, tried in order when model cannot answer: none of its providers served it. At most 3, and only the model that answered is billed. A NagaAI extension in OpenRouter's shape.
Maximum array length: 3
routing
object
How NagaAI picks the providers for this request: max_price removes the dearer ones and can fail the request. Takes no strategy. A NagaAI extension.
Hide child attributes
routing.max_price
object
The most one unit of each named meter may cost. Absent: no price limit.
Hide child attributes
routing.max_price.token
stringnumber
Credits per token, either direction, without a meter of its own. A non-negative decimal, as a string or a number.
routing.max_price.input_token
stringnumber
Credits per prompt token without a meter of its own. A non-negative decimal, as a string or a number.
routing.max_price.output_token
stringnumber
Credits per output token without a meter of its own. A non-negative decimal, as a string or a number.
routing.max_price.cached_input_token
stringnumber
Credits per prompt token read from cache. A non-negative decimal, as a string or a number.
routing.max_price.cache_write_input_token
stringnumber
Credits per prompt token written to cache. A non-negative decimal, as a string or a number.
routing.max_price.cache_write_1h_input_token
stringnumber
Credits per prompt token cached for one hour. A non-negative decimal, as a string or a number.
routing.max_price.input_text_token
stringnumber
Credits per prompt text token. A non-negative decimal, as a string or a number.
routing.max_price.output_text_token
stringnumber
Credits per output text token. A non-negative decimal, as a string or a number.
routing.max_price.input_audio_token
stringnumber
Credits per input audio token. A non-negative decimal, as a string or a number.
routing.max_price.output_audio_token
stringnumber
Credits per output audio token. A non-negative decimal, as a string or a number.
routing.max_price.input_image_token
stringnumber
Credits per input image token. A non-negative decimal, as a string or a number.
routing.max_price.output_image_token
stringnumber
Credits per output image token. A non-negative decimal, as a string or a number.
routing.max_price.input_audio_hour
stringnumber
Credits per hour of input audio. A non-negative decimal, as a string or a number.
routing.max_price.output_audio_hour
stringnumber
Credits per hour of output audio. A non-negative decimal, as a string or a number.
routing.max_price.input_text_character
stringnumber
Credits per input text character. A non-negative decimal, as a string or a number.
routing.max_price.output_text_character
stringnumber
Credits per output text character. A non-negative decimal, as a string or a number.
routing.max_price.input_text_search
stringnumber
Credits per rerank search. A non-negative decimal, as a string or a number.
routing.max_price.output_image_image
stringnumber
Credits per delivered picture. A non-negative decimal, as a string or a number.
routing.max_price.request
stringnumber
Credits per request: the fee a request pays once. A non-negative decimal, as a string or a number.
routing.max_price.output_video_second
stringnumber
Credits per second of video. A non-negative decimal, as a string or a number.
routing.max_price.output_video_megapixel_second
stringnumber
Credits per megapixel-second of upscaled video. A non-negative decimal, as a string or a number.
Example:
{ "output_token": "0.000005" }
routing.precision
enum<string>[]
The weight precisions the model may be served in. Absent: any.
Minimum array length: 1
A weight precision a provider serves a model in, as it publishes it.
Available options:
int4,
int8,
fp4,
mxfp4,
nvfp4,
fp6,
fp8,
mxfp8,
fp16,
bf16,
fp32
dimensions
integer<int64> | null
The vector length to ask for. The gateway bounds nothing and drops the key where the provider has no such parameter.
encoding_format
enum<string>
default:float
How the vectors come back. base64 costs precision, since the gateway holds them as 64-bit.
Available options:
float,
base64
Response
The vectors. data carries one row per input, each with its index; usage carries the token count behind the charge.
The answer to POST /v1/embeddings: one vector per input.
model
string
required
The catalog id of the model that answered, after alias resolution.
data
object[]
required
The vectors, one entry per embedded input, each carrying its own index.
Hide child attributes
data.index
integer<int64>
required
Which of the request's inputs this vector belongs to, counted from zero.
data.embedding
number<double>[]string
required
The vector: an array of numbers, or base64 when the request asked for it.
data.object
enum<string>
Always embedding.
Available options:
embedding
usage
object
required
The token count this request bills on.
Hide child attributes
usage.prompt_tokens
integer<int64>
required
The tokens of the input, and what the request bills on.
usage.total_tokens
integer<int64>
required
The same number as prompt_tokens; embeddings produce no output tokens.
object
enum<string>
Always list.
Available options:
list
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"NagaAI Documentation","colors":{"primary":"#5a5ae5","light":"#8893fa","dark":"#5351da"},"logo":{"light":"https://mintcdn.com/nagaai-60f8697b/3Tc2Ajidq18FPFoC/static/img/logo-light.svg?fit=max\u0026auto=format\u0026n=3Tc2Ajidq18FPFoC\u0026q=85\u0026s=18d579338bd90baa596e41e2e2322393","dark":"https://mintcdn.com/nagaai-60f8697b/3Tc2Ajidq18FPFoC/static/img/logo-dark.svg?fit=max\u0026auto=format\u0026n=3Tc2Ajidq18FPFoC\u0026q=85\u0026s=f4927df5611f5a22c6984a3e7b91b6a0"},"favicon":"https://mintcdn.com/nagaai-60f8697b/nbl1KDrtw3_cqedh/static/img/favicon.ico?fit=max\u0026auto=format\u0026n=nbl1KDrtw3_cqedh\u0026q=85\u0026s=a8361945277b5cce4de483745aa5c21c","api":{"params":{"expanded":"all"},"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["python","javascript","curl","go"],"prefill":true},"url":"full"},"appearance":{"default":"system"},"background":{"color":{"light":"#ffffff","dark":"#09090b"}},"navbar":{"links":[{"href":"https://naga.ac/models","label":"Models"},{"href":"https://naga.ac/pricing","label":"Pricing"},{"href":"https://naga.ac/playground","label":"Playground"}],"primary":{"type":"button","label":"Dashboard","href":"https://naga.ac/dashboard"}},"footer":{"socials":{"discord":"https://discord.naga.ac","github":"https://github.com/naga-ai-hub","x":"https://x.com/NagaAIProject","reddit":"https://www.reddit.com/r/NagaAI"},"links":[{"header":"Community","items":[{"label":"Status","href":"https://status.naga.ac"},{"label":"Blog","href":"https://naga.ac/blog"},{"label":"Support","href":"https://discord.naga.ac"}]},{"header":"Resources","items":[{"label":"Models","href":"https://naga.ac/models"},{"label":"Playground","href":"https://naga.ac/playground"},{"label":"Chat","href":"https://chat.naga.ac"}]},{"header":"Legal","items":[{"label":"Privacy","href":"https://naga.ac/legal/privacy"},{"label":"Terms","href":"https://naga.ac/legal/terms"}]}]},"fonts":{"family":"Geist"},"styling":{"codeblocks":{"theme":{"light":"github-light-default","dark":"github-dark-dimmed"}},"latex":true},"contextual":{"options":["copy","view","download-spec","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"nagaai-60f8697b","hasAudioNarration":false,"actualSubdomain":"nagaai-60f8697b","customDomains":["docs.naga.ac"],"gitSource":{"type":"github","owner":"naga-ai-hub","repo":"naga-ai","deployBranch":"master","contentDirectory":"docs-site","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6afff8e862a3bc10271d2724","clientVersion":"0.0.4248","searchFilterCounts":[{"language":"default","tag":"Docs","count":35},{"language":"default","tag":"API Reference","count":25},{"language":"default","tag":"Endpoints","count":24},{"language":"default","tag":"Guides","count":17},{"language":"default","tag":"Integrations","count":13},{"language":"default","tag":"Account","count":11},{"language":"default","tag":"Coding agents","count":8},{"language":"default","tag":"How NagaAI works","count":5},{"language":"default","tag":"API Keys","count":5},{"language":"default","tag":"Get started","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","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":"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":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[]}
{"page":{"pagePath":"api-reference/embeddings/create-embeddings","slug":"/api-reference/embeddings/create-embeddings","pageMetadata":{"title":"Create embeddings","description":"Creates an embedding vector for the input and charges the account for the tokens it counted. Requires an API key.","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/embeddings","href":"/api-reference/embeddings/create-embeddings","autogeneratedByOpenApi":true},"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: \"Creates an embedding vector for the input and charges the account for the tokens it counted. Requires an API key.\"\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}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-light-default","dark":"github-dark-dimmed"}},"config":{},"pageMetadata":{"title":"Create embeddings","description":"Creates an embedding vector for the input and charges the account for the tokens it counted. Requires an API key.","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/embeddings","href":"/api-reference/embeddings/create-embeddings","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Embeddings"],"summary":"Create embeddings","description":"Creates an embedding vector for the input and charges the account for the tokens it counted. Requires an API key.","operationId":"create_embedding","externalDocs":{"url":"https://platform.openai.com/docs/api-reference/embeddings","description":"The OpenAI reference for this route."},"requestBody":"4bbda0f2-691f-4548-bf74-38b7dd626ccd","responses":{"200":"7af6e4e9-d26f-46e6-af05-9d3ccac8f536","400":"784b6398-fbc8-42c1-98cf-6c7c64d62333","401":"baec6e43-2bae-4d38-9b74-31a14b863a5a","402":"4cf4f6b7-8515-43d8-acd7-09e8ebba4e93","403":"92e2b98b-3984-4af4-a707-64ab0d9536ba","408":"05c4fa58-7190-4398-9846-058cb79db8bb","410":"13777e89-030b-4145-97c4-17967c90a016","413":"c95850e8-361f-4a3f-b8fb-51d220abd7fe","422":"241a985d-180b-4cbb-af2b-1cb3386eaced","429":"5b84ebca-49b2-4d1a-89ed-3a00c50861e2","500":"0d384ad9-aee3-47ce-a18d-49a499382114","503":"96382427-b87f-4619-9b7b-d60fcdc2fbd5"},"security":["0766b7b0-4a0f-4203-8b28-16fe9487fe2d","3ed32aee-fe6a-45bc-9547-4ba0d5c603ec"],"x-codeSamples":[{"lang":"bash","label":"curl","source":"curl https://api.naga.ac/v1/embeddings \\\n -H \"Authorization: Bearer $NAGA_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"google/gemini-embedding-2\",\n \"input\": \"The quick brown fox jumps over the lazy dog\"\n}'"},{"lang":"python","label":"openai-python","source":"import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ[\"NAGA_API_KEY\"],\n base_url=\"https://api.naga.ac/v1\",\n)\n\nresult = client.embeddings.create(\n model=\"google/gemini-embedding-2\",\n input=\"The quick brown fox jumps over the lazy dog\",\n)\nprint(result)\n"},{"lang":"javascript","label":"openai-node","source":"import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n apiKey: process.env.NAGA_API_KEY,\n baseURL: \"https://api.naga.ac/v1\",\n});\n\nconst result = await client.embeddings.create({\n model: \"google/gemini-embedding-2\",\n input: \"The quick brown fox jumps over the lazy dog\",\n});\nconsole.log(result);\n"}],"x-mcp":{"name":"naga_create_embedding","annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":true}},"method":"post","type":"path","servers":["ddee1100-762b-4028-ac39-d54cdb9aa21e"],"path":"/v1/embeddings","baseUrlOptions":["https://api.naga.ac"],"title":"Create embeddings","codeSamples":[{"label":"curl","lang":"bash","source":"curl https://api.naga.ac/v1/embeddings \\\n -H \"Authorization: Bearer $NAGA_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"google/gemini-embedding-2\",\n \"input\": \"The quick brown fox jumps over the lazy dog\"\n}'"},{"label":"openai-python","lang":"python","source":"import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ[\"NAGA_API_KEY\"],\n base_url=\"https://api.naga.ac/v1\",\n)\n\nresult = client.embeddings.create(\n model=\"google/gemini-embedding-2\",\n input=\"The quick brown fox jumps over the lazy dog\",\n)\nprint(result)\n"},{"label":"openai-node","lang":"javascript","source":"import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n apiKey: process.env.NAGA_API_KEY,\n baseURL: \"https://api.naga.ac/v1\",\n});\n\nconst result = await client.embeddings.create({\n model: \"google/gemini-embedding-2\",\n input: \"The quick brown fox jumps over the lazy dog\",\n});\nconsole.log(result);\n"}],"requestExampleLanguages":["python","javascript","bash","go"],"requiredOnlyExamples":true,"requestExampleType":"codeSamples","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.model":"google/gemini-embedding-2","body.input.oneOf.0":"The quick brown fox jumps over the lazy dog"}],"urlDisplay":"full"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"The request body of `POST /v1/embeddings`.","required":["model","input"],"properties":{"model":{"type":"string","description":"The model to embed with, named by its id or alias. An entry without the `embeddings` capability draws a refusal.","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"input":{"oneOf":[{"type":"string","title":"Plain text","description":"What to embed: strings, token ids, or arrays of either.","isRequired":true,"uniqueKey":"input.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"input.oneOf.1.items.[INDEX]","typeLabel":"string"},"title":"List of texts","description":"What to embed: strings, token ids, or arrays of either.","isRequired":true,"uniqueKey":"input.oneOf.1","typeLabel":"string[]"},{"type":"array","items":{"type":"integer","format":"int64","uniqueKey":"input.oneOf.2.items.[INDEX]","typeLabel":"integer\u003cint64>"},"title":"List of token ids","description":"What to embed: strings, token ids, or arrays of either.","isRequired":true,"uniqueKey":"input.oneOf.2","typeLabel":"integer\u003cint64>[]"},{"type":"array","items":{"type":"array","items":{"type":"integer","format":"int64","uniqueKey":"input.oneOf.3.items.[INDEX].items.[INDEX]","typeLabel":"integer\u003cint64>"},"uniqueKey":"input.oneOf.3.items.[INDEX]","typeLabel":"integer\u003cint64>[]"},"title":"List of token-id sequences","description":"What to embed: strings, token ids, or arrays of either.","isRequired":true,"uniqueKey":"input.oneOf.3","typeLabel":"integer\u003cint64>[][]"}],"isRequired":true,"uniqueKey":"input","typeLabel":"string | string[] | integer\u003cint64>[] | integer\u003cint64>[][]"},"models":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"models.oneOf.0.items.[INDEX]","typeLabel":"string"},"description":"Fallback models, tried in order when `model` cannot answer: none of its providers served it. At most 3, and only the model that answered is billed. A NagaAI extension in OpenRouter's shape.","maxItems":3,"uniqueKey":"models.oneOf.0","typeLabel":"string[]"},{"type":"null","items":{"type":"string"},"description":"Fallback models, tried in order when `model` cannot answer: none of its providers served it. At most 3, and only the model that answered is billed. A NagaAI extension in OpenRouter's shape.","maxItems":3,"uniqueKey":"models.oneOf.1","typeLabel":"null"}],"uniqueKey":"models","typeLabel":"string[] | null"},"routing":{"type":"object","description":"How NagaAI picks the providers for this request: `max_price` removes the dearer ones and can fail the request. Takes no `strategy`. A NagaAI extension.","properties":{"max_price":{"type":"object","description":"The most one unit of each named meter may cost. Absent: no price limit.","example":{"output_token":"0.000005"},"properties":{"token":{"oneOf":[{"type":"string","description":"Credits per token, either direction, without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per token, either direction, without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.token","typeLabel":"string | number"},"input_token":{"oneOf":[{"type":"string","description":"Credits per prompt token without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt token without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_token","typeLabel":"string | number"},"output_token":{"oneOf":[{"type":"string","description":"Credits per output token without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output token without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_token","typeLabel":"string | number"},"cached_input_token":{"oneOf":[{"type":"string","description":"Credits per prompt token read from cache. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cached_input_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt token read from cache. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cached_input_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.cached_input_token","typeLabel":"string | number"},"cache_write_input_token":{"oneOf":[{"type":"string","description":"Credits per prompt token written to cache. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cache_write_input_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt token written to cache. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cache_write_input_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.cache_write_input_token","typeLabel":"string | number"},"cache_write_1h_input_token":{"oneOf":[{"type":"string","description":"Credits per prompt token cached for one hour. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cache_write_1h_input_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt token cached for one hour. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cache_write_1h_input_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.cache_write_1h_input_token","typeLabel":"string | number"},"input_text_token":{"oneOf":[{"type":"string","description":"Credits per prompt text token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt text token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_text_token","typeLabel":"string | number"},"output_text_token":{"oneOf":[{"type":"string","description":"Credits per output text token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_text_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output text token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_text_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_text_token","typeLabel":"string | number"},"input_audio_token":{"oneOf":[{"type":"string","description":"Credits per input audio token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_audio_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per input audio token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_audio_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_audio_token","typeLabel":"string | number"},"output_audio_token":{"oneOf":[{"type":"string","description":"Credits per output audio token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_audio_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output audio token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_audio_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_audio_token","typeLabel":"string | number"},"input_image_token":{"oneOf":[{"type":"string","description":"Credits per input image token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_image_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per input image token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_image_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_image_token","typeLabel":"string | number"},"output_image_token":{"oneOf":[{"type":"string","description":"Credits per output image token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_image_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output image token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_image_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_image_token","typeLabel":"string | number"},"input_audio_hour":{"oneOf":[{"type":"string","description":"Credits per hour of input audio. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_audio_hour.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per hour of input audio. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_audio_hour.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_audio_hour","typeLabel":"string | number"},"output_audio_hour":{"oneOf":[{"type":"string","description":"Credits per hour of output audio. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_audio_hour.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per hour of output audio. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_audio_hour.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_audio_hour","typeLabel":"string | number"},"input_text_character":{"oneOf":[{"type":"string","description":"Credits per input text character. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_character.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per input text character. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_character.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_text_character","typeLabel":"string | number"},"output_text_character":{"oneOf":[{"type":"string","description":"Credits per output text character. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_text_character.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output text character. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_text_character.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_text_character","typeLabel":"string | number"},"input_text_search":{"oneOf":[{"type":"string","description":"Credits per rerank search. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_search.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per rerank search. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_search.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_text_search","typeLabel":"string | number"},"output_image_image":{"oneOf":[{"type":"string","description":"Credits per delivered picture. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_image_image.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per delivered picture. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_image_image.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_image_image","typeLabel":"string | number"},"request":{"oneOf":[{"type":"string","description":"Credits per request: the fee a request pays once. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.request.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per request: the fee a request pays once. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.request.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.request","typeLabel":"string | number"},"output_video_second":{"oneOf":[{"type":"string","description":"Credits per second of video. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_video_second.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per second of video. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_video_second.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_video_second","typeLabel":"string | number"},"output_video_megapixel_second":{"oneOf":[{"type":"string","description":"Credits per megapixel-second of upscaled video. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_video_megapixel_second.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per megapixel-second of upscaled video. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_video_megapixel_second.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_video_megapixel_second","typeLabel":"string | number"}},"additionalProperties":false,"uniqueKey":"routing.max_price","typeLabel":"object"},"precision":{"type":"array","items":{"type":"string","description":"A weight precision a provider serves a model in, as it publishes it.","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32"],"uniqueKey":"routing.precision.items.[INDEX]","typeLabel":"enum\u003cstring>"},"description":"The weight precisions the model may be served in. Absent: any.","minItems":1,"uniqueKey":"routing.precision","typeLabel":"enum\u003cstring>[]"}},"additionalProperties":false,"uniqueKey":"routing","typeLabel":"object"},"dimensions":{"oneOf":[{"type":"integer","format":"int64","description":"The vector length to ask for. The gateway bounds nothing and drops the key where the provider has no such parameter.","uniqueKey":"dimensions.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"The vector length to ask for. The gateway bounds nothing and drops the key where the provider has no such parameter.","uniqueKey":"dimensions.oneOf.1","typeLabel":"null"}],"uniqueKey":"dimensions","typeLabel":"integer\u003cint64> | null"},"encoding_format":{"type":"string","description":"How the vectors come back. `base64` costs precision, since the gateway holds them as 64-bit.","default":"float","enum":["float","base64"],"uniqueKey":"encoding_format","typeLabel":"enum\u003cstring>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"basic":{"title":"basic","summary":"Embed one string","value":{"model":"google/gemini-embedding-2","input":"The quick brown fox jumps over the lazy dog"}}},"exampleType":"examples"}},"required":true,"exampleType":"examples"},"responses":{"7af6e4e9-d26f-46e6-af05-9d3ccac8f536":{"description":"The vectors. `data` carries one row per input, each with its index; `usage` carries the token count behind the charge.","content":{"application/json":{"schema":{"type":"object","description":"The answer to `POST /v1/embeddings`: one vector per input.","required":["model","data","usage"],"properties":{"model":{"type":"string","description":"The catalog id of the model that answered, after alias resolution.","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"data":{"type":"array","items":{"type":"object","description":"One embedded input: its place, and the vector it produced.","required":["index","embedding"],"properties":{"index":{"type":"integer","format":"int64","description":"Which of the request's inputs this vector belongs to, counted from zero.","isRequired":true,"uniqueKey":"data.items.[INDEX].index","typeLabel":"integer\u003cint64>"},"embedding":{"oneOf":[{"type":"array","items":{"type":"number","format":"double","uniqueKey":"data.items.[INDEX].embedding.oneOf.0.items.[INDEX]","typeLabel":"number\u003cdouble>"},"title":"Float vector","description":"The vector: an array of numbers, or base64 when the request asked for it.","isRequired":true,"uniqueKey":"data.items.[INDEX].embedding.oneOf.0","typeLabel":"number\u003cdouble>[]"},{"type":"string","title":"Base64 string","description":"The vector: an array of numbers, or base64 when the request asked for it.","isRequired":true,"uniqueKey":"data.items.[INDEX].embedding.oneOf.1","typeLabel":"string"}],"isRequired":true,"uniqueKey":"data.items.[INDEX].embedding","typeLabel":"number\u003cdouble>[] | string"},"object":{"type":"string","description":"Always `embedding`.","enum":["embedding"],"uniqueKey":"data.items.[INDEX].object","typeLabel":"enum\u003cstring>"}},"uniqueKey":"data.items.[INDEX]","typeLabel":"object"},"description":"The vectors, one entry per embedded input, each carrying its own `index`.","isRequired":true,"uniqueKey":"data","typeLabel":"object[]"},"usage":{"type":"object","description":"The token count this request bills on.","required":["prompt_tokens","total_tokens"],"properties":{"prompt_tokens":{"type":"integer","format":"int64","description":"The tokens of the input, and what the request bills on.","isRequired":true,"uniqueKey":"usage.prompt_tokens","typeLabel":"integer\u003cint64>"},"total_tokens":{"type":"integer","format":"int64","description":"The same number as `prompt_tokens`; embeddings produce no output tokens.","isRequired":true,"uniqueKey":"usage.total_tokens","typeLabel":"integer\u003cint64>"}},"isRequired":true,"uniqueKey":"usage","typeLabel":"object"},"object":{"type":"string","description":"Always `list`.","enum":["list"],"uniqueKey":"object","typeLabel":"enum\u003cstring>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"basic":{"title":"basic","summary":"One vector, floats by default","value":{"object":"list","model":"google/gemini-embedding-2","data":[{"object":"embedding","index":0,"embedding":[0.0023124,-0.0091187,0.0157021]}],"usage":{"prompt_tokens":9,"total_tokens":9}}}},"exampleType":"examples"}},"x-retry-safe":false,"exampleType":"examples"},"784b6398-fbc8-42c1-98cf-6c7c64d62333":{"description":"The request is malformed: a field failed its constraint, the body is not valid JSON, the model name is unknown, or no provider serves it within its price limit.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"baec6e43-2bae-4d38-9b74-31a14b863a5a":{"description":"The API key is missing, malformed, disabled, or does not belong to an account that may call this route.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"invalid-api-key":{"title":"invalid-api-key","summary":"401 — the key is not one this gateway serves","value":{"error":{"type":"invalid_api_key","message":"The provided API key is invalid. Please ensure your API key is correct and active. You can find more information about obtaining a key on our website: https://naga.ac If you just created this key, wait a few minutes and try again."}}}},"exampleType":"examples"}},"x-retry-safe":false,"exampleType":"examples"},"4cf4f6b7-8515-43d8-acd7-09e8ebba4e93":{"description":"The account has run out of credits. Top up the balance and retry.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"insufficient-credits":{"title":"insufficient-credits","summary":"402 — the account has no credits left","value":{"error":{"type":"insufficient_quota","message":"More credits required to process this request. Visit https://naga.ac/dashboard/credits to add credits."}}}},"exampleType":"examples"}},"x-retry-safe":false,"exampleType":"examples"},"92e2b98b-3984-4af4-a707-64ab0d9536ba":{"description":"The model policy of the organization or of the key's workspace does not allow this model, a spending limit is reached, or the content was blocked by the moderation policy.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"05c4fa58-7190-4398-9846-058cb79db8bb":{"description":"The request body did not finish arriving within 15 minutes, or stalled for 60 seconds.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":true,"exampleType":"generated"},"13777e89-030b-4145-97c4-17967c90a016":{"description":"The model is deprecated and no longer served. Pick a current one.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"c95850e8-361f-4a3f-b8fb-51d220abd7fe":{"description":"The request body is larger than the 32 MiB this gateway accepts.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"241a985d-180b-4cbb-af2b-1cb3386eaced":{"description":"The request was understood but its usage could not be metered, so it was not served.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"5b84ebca-49b2-4d1a-89ed-3a00c50861e2":{"description":"The account exceeded its rate limit. `Retry-After` carries the wait in seconds.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"How long to wait before retrying, in seconds."}},"content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"rate-limited":{"title":"rate-limited","summary":"429 — too many requests; `Retry-After` carries the wait","value":{"error":{"type":"rate_limit_exceeded","message":"Free model limit reached (100 requests per day and 10 per minute). Try again in 3s, or add credits at https://naga.ac/dashboard/credits to use paid models, which have no request limit."}}}},"exampleType":"examples"}},"x-retry-safe":true,"exampleType":"examples"},"0d384ad9-aee3-47ce-a18d-49a499382114":{"description":"The gateway failed for a reason of its own. Report it — this status marks NagaAI's own bugs, never an upstream verdict.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":true,"exampleType":"generated"},"96382427-b87f-4619-9b7b-d60fcdc2fbd5":{"description":"No upstream is available, or the gateway is shedding load. `Retry-After` carries the suggested wait.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"How long to wait before retrying, in seconds."}},"content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":true,"exampleType":"generated"}},"security":{"0766b7b0-4a0f-4203-8b28-16fe9487fe2d":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An account API key. Send it as `Authorization: Bearer \u003ckey>`.","scopes":[],"schemeName":"bearerAuth"}},"3ed32aee-fe6a-45bc-9547-4ba0d5c603ec":{"xApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"An account API key. Send it as `x-api-key: \u003ckey>`, the header Anthropic-style clients use.","scopes":[],"schemeName":"xApiKeyAuth"}}},"servers":{"ddee1100-762b-4028-ac39-d54cdb9aa21e":{"url":"https://api.naga.ac","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"An account API key. Send it as `Authorization: Bearer \u003ckey>`.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"An account API key. Send it as `Authorization: Bearer \u003ckey>`.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"},{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","description":"An account API key. Send it as `x-api-key: \u003ckey>`, the header Anthropic-style clients use.","scopes":[],"schemeName":"xApiKeyAuth"},"schema":{"title":"x-api-key","type":"string","description":"An account API key. Send it as `x-api-key: \u003ckey>`, the header Anthropic-style clients use.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"xApiKeyAuth","name":"x-api-key"}],"title":"xApiKeyAuth"}]},"originalFileLocation":"openapi/naga-api.json"},"subdomain":"nagaai-60f8697b","siteName":"NagaAI Documentation","title":"Create embeddings - NagaAI Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-19T16:54:45.287Z","originalFileLocation":"api-reference/embeddings/create-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=\"Creates an embedding vector for the input and charges the account for the tokens it counted. Requires an API key.\">\u003cmeta data-mint-head name=\"application-name\" content=\"NagaAI Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create embeddings - NagaAI Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Creates an embedding vector for the input and charges the account for the tokens it counted. Requires an API key.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"NagaAI Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.naga.ac/api-reference/embeddings/create-embeddings\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://nagaai-60f8697b.mintlify.site/_mintlify/api/og/v2?division=Embeddings\u0026amp;title=Create+embeddings\u0026amp;description=Creates+an+embedding+vector+for+the+input+and+charges+the+account+for+the+tokens+it+counted.+Requires+an+API+key.\u0026amp;theme=53b53c58c5b757ba80c9164d\u0026amp;signature=fe841ee491c8d54a7da2c49bb7ecc34e682337cbad98f3c53e98f3f4a85ee268\">\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 - NagaAI Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Creates an embedding vector for the input and charges the account for the tokens it counted. Requires an API key.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://nagaai-60f8697b.mintlify.site/_mintlify/api/og/v2?division=Embeddings\u0026amp;title=Create+embeddings\u0026amp;description=Creates+an+embedding+vector+for+the+input+and+charges+the+account+for+the+tokens+it+counted.+Requires+an+API+key.\u0026amp;theme=53b53c58c5b757ba80c9164d\u0026amp;signature=fe841ee491c8d54a7da2c49bb7ecc34e682337cbad98f3c53e98f3f4a85ee268\">\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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"NagaAI Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5a5ae5\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.naga.ac/api-reference/embeddings/create-embeddings\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/embeddings/create-embeddings.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.naga.ac/#organization\",\"name\":\"NagaAI Documentation\",\"url\":\"https://docs.naga.ac\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/nagaai-60f8697b/3Tc2Ajidq18FPFoC/static/img/logo-light.svg?fit=max\u0026auto=format\u0026n=3Tc2Ajidq18FPFoC\u0026q=85\u0026s=18d579338bd90baa596e41e2e2322393\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.naga.ac#website\",\"name\":\"NagaAI Documentation\",\"url\":\"https://docs.naga.ac\",\"publisher\":{\"@id\":\"https://docs.naga.ac/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.naga.ac/api-reference/embeddings/create-embeddings#webpage\",\"url\":\"https://docs.naga.ac/api-reference/embeddings/create-embeddings\",\"name\":\"Create embeddings\",\"description\":\"Creates an embedding vector for the input and charges the account for the tokens it counted. Requires an API key.\",\"dateModified\":\"2026-11-19T16:54:45.287Z\",\"isPartOf\":{\"@id\":\"https://docs.naga.ac#website\"},\"breadcrumb\":{\"@id\":\"https://docs.naga.ac/api-reference/embeddings/create-embeddings#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.naga.ac/api-reference/embeddings/create-embeddings#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.naga.ac/api-reference/responses/create-a-response\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create embeddings\",\"item\":\"https://docs.naga.ac/api-reference/embeddings/create-embeddings\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.naga.ac/api-reference/embeddings/create-embeddings#apireference\",\"headline\":\"Create embeddings\",\"name\":\"Create embeddings\",\"description\":\"Creates an embedding vector for the input and charges the account for the tokens it counted. Requires an API key.\",\"url\":\"https://docs.naga.ac/api-reference/embeddings/create-embeddings\",\"mainEntityOfPage\":{\"@id\":\"https://docs.naga.ac/api-reference/embeddings/create-embeddings#webpage\"},\"dateModified\":\"2026-11-19T16:54:45.287Z\",\"publisher\":{\"@id\":\"https://docs.naga.ac/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.naga.ac#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"NagaAI Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"NagaAI Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/embeddings/create-embeddings.md","siteName":"NagaAI Documentation","nav":{"global":null,"tabs":[{"tab":"Docs","pages":[{"title":"Docs","href":"/get-started/quickstart"}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"API reference","sidebarTitle":"Overview","icon":"book","href":"/api-reference/overview"}]},{"group":"Endpoints","pages":[{"group":"Responses","expanded":false,"pages":[{"title":"Create a response","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/responses","href":"/api-reference/responses/create-a-response"}]},{"group":"Chat Completions","expanded":false,"pages":[{"title":"Create a chat completion","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/chat/completions","href":"/api-reference/chat-completions/create-a-chat-completion"}]},{"group":"Messages","expanded":false,"pages":[{"title":"Create a message","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/messages","href":"/api-reference/messages/create-a-message"}]},{"group":"Models","expanded":false,"pages":[{"title":"List models","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/models","href":"/api-reference/models/list-models"}]},{"group":"Startups","expanded":false,"pages":[{"title":"List startups","description":"Returns the organizations whose models NagaAI serves. Requires no key, and presenting one changes nothing.","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/startups","href":"/api-reference/startups/list-startups"}]},{"group":"Embeddings","expanded":false,"pages":[{"title":"Create embeddings","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/embeddings","href":"/api-reference/embeddings/create-embeddings"}]},{"group":"Moderations","expanded":false,"pages":[{"title":"Classify content","description":"Classifies text and images against a moderation model's categories and charges the account for the tokens it counted. Requires an API key.","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/moderations","href":"/api-reference/moderations/classify-content"}]},{"group":"Rerank","expanded":false,"pages":[{"title":"Rerank documents","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/rerank","href":"/api-reference/rerank/rerank-documents"}]},{"group":"Audio","expanded":false,"pages":[{"title":"Create speech","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/audio/speech","href":"/api-reference/audio/create-speech"},{"title":"Create a transcription","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/audio/transcriptions","href":"/api-reference/audio/create-a-transcription"},{"title":"Create a translation","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/audio/translations","href":"/api-reference/audio/create-a-translation"}]},{"group":"Images","expanded":false,"pages":[{"title":"Create an image","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/images/generations","href":"/api-reference/images/create-an-image"},{"title":"Edit an image","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/images/edits","href":"/api-reference/images/edit-an-image"}]},{"group":"Videos","expanded":false,"pages":[{"title":"Create a video","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/videos","href":"/api-reference/videos/create-a-video"},{"title":"Get a video job","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/videos/{id}","href":"/api-reference/videos/get-a-video-job"},{"title":"Download a video","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/videos/{id}/content","href":"/api-reference/videos/download-a-video"}]},{"group":"Requests","expanded":false,"pages":[{"title":"Get a request","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/requests/{id}","href":"/api-reference/requests/get-a-request"}]},{"group":"Account","expanded":false,"pages":[{"title":"Get the account balance","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/balance","href":"/api-reference/account/get-the-account-balance"},{"title":"Get account activity","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/activity","href":"/api-reference/account/get-account-activity"},{"group":"API Keys","expanded":false,"pages":[{"title":"List API keys","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/keys","href":"/api-reference/api-keys/list-api-keys"},{"title":"Create an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/account/keys","href":"/api-reference/api-keys/create-an-api-key"},{"title":"Get an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/keys/{key_id}","href":"/api-reference/api-keys/get-an-api-key"},{"title":"Update an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json patch /v1/account/keys/{key_id}","href":"/api-reference/api-keys/update-an-api-key"},{"title":"Delete an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json delete /v1/account/keys/{key_id}","href":"/api-reference/api-keys/delete-an-api-key"}]}]}]}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/agents/claude-code"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Create embeddings - NagaAI Documentation","deploymentId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","buildId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-BtG4DSkw.js","snippetPresets-C1k1xDhp.js","utils-PMJoEt4Y.js","style-to-object-BY3JEAdk.js","utils-DW3Pr7Jq.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-DIISLO2w.js","conditional-requirements-CFM0id0Q.js","cloneDeep-BErNCZCm.js","_Uint8Array-f0PCu9f_.js","isObject-FP1Yky1u.js","ApiExamples-OjY-8mqu.js","usePlaygroundInputsStore-B2HS2hUb.js","shallow-DVFuuIDQ.js","isEqual-DG0UKiQC.js","CodeSnippets-Cy6FBgwN.js","CodeSnippet-D1PtG8ed.js","getApiPlaygroundDisplay-Dkx2eNtL.js","Page-C8Cg25if.js","DynamicMarkdown-BvJIe00T.js","SectionHeading-B0rKYV8d.js","icon-yclzBff4.js","MethodPill-DxA11cCF.js","getPastedJson-CpkIDpMk.js","DuplicateIcon-CFCQNJ-D.js","axios-CsQoIw0U.js","Markdown-CK5C-fmV.js","AssistantPageLink-Cw134Dd-.js","dist-3xM3Qrc7.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}