This endpoint creates numerical vector representations (embeddings) of text using specified embedding models. Embeddings are useful for semantic search, clustering, similarity comparisons, and RAG applications.
Request Body:
model: Model ID (required). Use your aligned model id (e.g. model_01kmqm4nrn9fw6r)
input: Text or list of texts to embed (required) - Single string or array of strings. Cannot be empty and must not exceed max input tokens for the model
dimensions (optional): Number of dimensions for output embeddings (only applicable for Resizable Matryoshka Embedding models)
Returns:
id: Unique identifier for the response
object: Object type (always embedding)
data: List of embedding objects, each containing:
object: Object type (always embedding)
embedding: Vector of floats representing the text (length depends on the model)
index: Position in the input array
model: Model ID used for generation
created: Unix timestamp (seconds) when response was generated
usage: Token usage statistics containing:
total_tokens: Total number of tokens used by the request
Example Request (Single Text):
POST /api/v3/inference/embeddingsHeaders: {"Authorization": "Bearer <api_key>"}{ "model": "text-embedding-xyz", "input": "The quick brown fox jumps over the lazy dog"}
Example Request (Multiple Texts):
POST /api/v3/inference/embeddingsHeaders: {"Authorization": "Bearer <api_key>"}{ "model": "model_01kmqm4nrn9fw6r", "input": [ "First document for semantic search", "Second document for clustering", "Third document for similarity comparison" ]}
Example Request (With Dimensions):
POST /api/v3/inference/embeddingsHeaders: {"Authorization": "Bearer <api_key>"}{ "model": "model_01kmqm4nrn9fw6r", "input": "Sample text to embed", "dimensions": 512}
Input text to embed, encoded as a string or a list of strings. To embed multiple inputs in a single request, pass a list of strings. The input must not exceed the max input tokens for the model, cannot be an empty string.
Use your aligned model id (e.g. model_01kmqm4nrn9fw6r). The same aligned id serves chat completions, completions, embeddings and reranking. Alignment shapes the model's representation space, so aligned embeddings are recommended for domain retrieval.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Nugen API Reference Docs","colors":{"primary":"#005b96","light":"#6497b1","dark":"#005b96"},"logo":{"light":"https://mintcdn.com/courteasy/YYugGl8ZAoQlnBYp/logo/light.svg?fit=max\u0026auto=format\u0026n=YYugGl8ZAoQlnBYp\u0026q=85\u0026s=f5f462b08161252f94dca4827e8055a0","dark":"https://mintcdn.com/courteasy/YYugGl8ZAoQlnBYp/logo/dark.svg?fit=max\u0026auto=format\u0026n=YYugGl8ZAoQlnBYp\u0026q=85\u0026s=c1f31d3028b6ad46f4c22208d402733e"},"favicon":"https://mintcdn.com/courteasy/YYugGl8ZAoQlnBYp/favicon.png?fit=max\u0026auto=format\u0026n=YYugGl8ZAoQlnBYp\u0026q=85\u0026s=74a9985970701685cc9f798a5bed86fe","api":{"openapi":"https://api.nugen.in/openapi-public.json","mdx":{"auth":{"method":"bearer"},"server":"https://api.nugen.in/"}},"navbar":{"links":[{"href":"https://github.com/nugen-in/nugen-cookbook","label":"Cookbook"}],"primary":{"type":"button","label":"Get API Key","href":"https://nugen.in/signup"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/nugen-in"}},"contextual":{"options":["copy","vscode","claude","chatgpt","perplexity","cursor"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"API Status","icon":"bolt-lightning","href":"https://status.nugen.in"},{"anchor":"Nugen Intelligence","icon":"earth-asia","href":"https://nugen.in"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"courteasy","hasAudioNarration":false,"actualSubdomain":"courteasy","customDomains":["docs.nugen.in"],"gitSource":{"type":"github","owner":"nugen-in","repo":"nugen-docs-test","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6ae488e3c69c99d3b7d10d90","clientVersion":"0.0.4111","searchFilterCounts":[{"language":"default","tag":"API Reference","count":43},{"language":"default","tag":"Models","count":10},{"language":"default","tag":"Alignment Projects","count":7},{"language":"default","tag":"Benchmarks","count":7},{"language":"default","tag":"Evaluations","count":6},{"language":"default","tag":"Documents","count":5},{"language":"default","tag":"Inference","count":5},{"language":"default","tag":"BYOC","count":2},{"language":"default","tag":"Health","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":"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":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/inference/generate-embeddings","slug":"/api-reference/inference/generate-embeddings","pageMetadata":{"title":"Generate Embeddings","description":"Generate dense vector embeddings for input text.\n\n\nThis endpoint creates numerical vector representations (embeddings) of text using specified embedding models. Embeddings are useful for semantic search, clustering, similarity comparisons, and RAG applications.\n\n\n**Request Body:**\n\n- `model`: Model ID (required). Use your aligned model id (e.g. `model_01kmqm4nrn9fw6r`)\n- `input`: Text or list of texts to embed (required) - Single string or array of strings. Cannot be empty and must not exceed max input tokens for the model\n- `dimensions` (optional): Number of dimensions for output embeddings (only applicable for Resizable Matryoshka Embedding models)\n\n\n**Returns:**\n\n- `id`: Unique identifier for the response\n- `object`: Object type (always `embedding`)\n- `data`: List of embedding objects, each containing:\n - `object`: Object type (always `embedding`)\n - `embedding`: Vector of floats representing the text (length depends on the model)\n - `index`: Position in the input array\n- `model`: Model ID used for generation\n- `created`: Unix timestamp (seconds) when response was generated\n- `usage`: Token usage statistics containing:\n - `total_tokens`: Total number of tokens used by the request\n\n\n**Example Request (Single Text):**\n\n```json\nPOST /api/v3/inference/embeddings\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"text-embedding-xyz\",\n \"input\": \"The quick brown fox jumps over the lazy dog\"\n}\n```\n\n\n**Example Request (Multiple Texts):**\n\n```json\nPOST /api/v3/inference/embeddings\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"input\": [\n \"First document for semantic search\",\n \"Second document for clustering\",\n \"Third document for similarity comparison\"\n ]\n}\n```\n\n\n**Example Request (With Dimensions):**\n\n```json\nPOST /api/v3/inference/embeddings\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"input\": \"Sample text to embed\",\n \"dimensions\": 512\n}\n```\n\n\n**Example Response:**\n\n```json\n{\n \"id\": \"embed-abc123xyz\",\n \"object\": \"embedding\",\n \"data\": [\n {\n \"object\": \"embedding\",\n \"embedding\": [0.00658765, -0.008665467, -0.007653789, 0.0023, -0.0091, 0.0125],\n \"index\": 0\n }\n ],\n \"model\": \"text-embedding-ada-002\",\n \"created\": 1705329600.0,\n \"usage\": {\n \"total_tokens\": 10\n }\n}\n```\n\n\n**Notes:**\n\n- Input must not exceed the maximum input tokens supported by the model\n- Input cannot be an empty string\n- For batch processing, pass multiple texts as an array to the `input` field\n- The embedding vector length varies by model - check model documentation for specifics\n- Use `dimensions` parameter only with Matryoshka embedding models that support resizing","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/inference/embeddings","href":"/api-reference/inference/generate-embeddings","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n li: \"li\",\n p: \"p\",\n pre: \"pre\",\n span: \"span\",\n strong: \"strong\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n }, {CodeBlock} = _components;\n if (!CodeBlock) _missingMdxReference(\"CodeBlock\", true);\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Generate dense vector embeddings for input text.\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"This endpoint creates numerical vector representations (embeddings) of text using specified embedding models. Embeddings are useful for semantic search, clustering, similarity comparisons, and RAG applications.\"\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Request Body:\"\n })\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"model\"\n }), \": Model ID (required). Use your aligned model id (e.g. \", _jsx(_components.code, {\n children: \"model_01kmqm4nrn9fw6r\"\n }), \")\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"input\"\n }), \": Text or list of texts to embed (required) - Single string or array of strings. Cannot be empty and must not exceed max input tokens for the model\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"dimensions\"\n }), \" (optional): Number of dimensions for output embeddings (only applicable for Resizable Matryoshka Embedding models)\"]\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Returns:\"\n })\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"id\"\n }), \": Unique identifier for the response\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"object\"\n }), \": Object type (always \", _jsx(_components.code, {\n children: \"embedding\"\n }), \")\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"data\"\n }), \": List of embedding objects, each containing:\", \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"object\"\n }), \": Object type (always \", _jsx(_components.code, {\n children: \"embedding\"\n }), \")\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"embedding\"\n }), \": Vector of floats representing the text (length depends on the model)\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"index\"\n }), \": Position in the input array\"]\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"model\"\n }), \": Model ID used for generation\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"created\"\n }), \": Unix timestamp (seconds) when response was generated\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"usage\"\n }), \": Token usage statistics containing:\", \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"total_tokens\"\n }), \": Total number of tokens used by the request\"]\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Example Request (Single Text):\"\n })\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"7\",\n language: \"json\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"json\",\n children: _jsxs(_components.code, {\n language: \"json\",\n numberOfLines: \"7\",\n children: [_jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"POST /api/v\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"3\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"/inference/embeddings\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"Headers: {\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"Authorization\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"Bearer \u003capi_key>\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\"\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"{\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"model\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"text-embedding-xyz\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"input\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"The quick brown fox jumps over the lazy dog\\\"\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })\n }), \"\\n\"]\n })\n })\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Example Request (Multiple Texts):\"\n })\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"11\",\n language: \"json\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"json\",\n children: _jsxs(_components.code, {\n language: \"json\",\n numberOfLines: \"11\",\n children: [_jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"POST /api/v\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"3\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"/inference/embeddings\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"Headers: {\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"Authorization\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"Bearer \u003capi_key>\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\"\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"{\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"model\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"model_01kmqm4nrn9fw6r\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"input\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": [\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \" \\\"First document for semantic search\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \" \\\"Second document for clustering\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \" \\\"Third document for similarity comparison\\\"\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" ]\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })\n }), \"\\n\"]\n })\n })\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Example Request (With Dimensions):\"\n })\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"8\",\n language: \"json\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"json\",\n children: _jsxs(_components.code, {\n language: \"json\",\n numberOfLines: \"8\",\n children: [_jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"POST /api/v\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"3\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"/inference/embeddings\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"Headers: {\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"Authorization\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"Bearer \u003capi_key>\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\"\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"{\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"model\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"model_01kmqm4nrn9fw6r\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"input\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"Sample text to embed\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"dimensions\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"512\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })\n }), \"\\n\"]\n })\n })\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Example Response:\"\n })\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"16\",\n language: \"json\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"json\",\n children: _jsxs(_components.code, {\n language: \"json\",\n numberOfLines: \"16\",\n children: [_jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"{\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"id\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"embed-abc123xyz\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"object\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"embedding\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"data\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": [\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" {\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"object\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"embedding\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"embedding\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": [\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"0.00658765\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \", \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"-0.008665467\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \", \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"-0.007653789\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \", \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"0.0023\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \", \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"-0.0091\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \", \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"0.0125\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"],\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"index\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"0\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" ],\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"model\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"text-embedding-ada-002\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"created\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"1705329600.0\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"usage\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": {\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"total_tokens\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"10\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })\n }), \"\\n\"]\n })\n })\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Notes:\"\n })\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsx(_components.li, {\n children: \"Input must not exceed the maximum input tokens supported by the model\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"Input cannot be an empty string\"\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"For batch processing, pass multiple texts as an array to the \", _jsx(_components.code, {\n children: \"input\"\n }), \" field\"]\n }), \"\\n\", _jsx(_components.li, {\n children: \"The embedding vector length varies by model - check model documentation for specifics\"\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Use \", _jsx(_components.code, {\n children: \"dimensions\"\n }), \" parameter only with Matryoshka embedding models that support resizing\"]\n }), \"\\n\"]\n })]\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};\nfunction _missingMdxReference(id, component) {\n throw new Error(\"Expected \" + (component ? \"component\" : \"object\") + \" `\" + id + \"` to be defined: you likely forgot to import, pass, or provide it.\");\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":{"config":{},"pageMetadata":{"title":"Generate Embeddings","description":"Generate dense vector embeddings for input text.\n\n\nThis endpoint creates numerical vector representations (embeddings) of text using specified embedding models. Embeddings are useful for semantic search, clustering, similarity comparisons, and RAG applications.\n\n\n**Request Body:**\n\n- `model`: Model ID (required). Use your aligned model id (e.g. `model_01kmqm4nrn9fw6r`)\n- `input`: Text or list of texts to embed (required) - Single string or array of strings. Cannot be empty and must not exceed max input tokens for the model\n- `dimensions` (optional): Number of dimensions for output embeddings (only applicable for Resizable Matryoshka Embedding models)\n\n\n**Returns:**\n\n- `id`: Unique identifier for the response\n- `object`: Object type (always `embedding`)\n- `data`: List of embedding objects, each containing:\n - `object`: Object type (always `embedding`)\n - `embedding`: Vector of floats representing the text (length depends on the model)\n - `index`: Position in the input array\n- `model`: Model ID used for generation\n- `created`: Unix timestamp (seconds) when response was generated\n- `usage`: Token usage statistics containing:\n - `total_tokens`: Total number of tokens used by the request\n\n\n**Example Request (Single Text):**\n\n```json\nPOST /api/v3/inference/embeddings\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"text-embedding-xyz\",\n \"input\": \"The quick brown fox jumps over the lazy dog\"\n}\n```\n\n\n**Example Request (Multiple Texts):**\n\n```json\nPOST /api/v3/inference/embeddings\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"input\": [\n \"First document for semantic search\",\n \"Second document for clustering\",\n \"Third document for similarity comparison\"\n ]\n}\n```\n\n\n**Example Request (With Dimensions):**\n\n```json\nPOST /api/v3/inference/embeddings\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"input\": \"Sample text to embed\",\n \"dimensions\": 512\n}\n```\n\n\n**Example Response:**\n\n```json\n{\n \"id\": \"embed-abc123xyz\",\n \"object\": \"embedding\",\n \"data\": [\n {\n \"object\": \"embedding\",\n \"embedding\": [0.00658765, -0.008665467, -0.007653789, 0.0023, -0.0091, 0.0125],\n \"index\": 0\n }\n ],\n \"model\": \"text-embedding-ada-002\",\n \"created\": 1705329600.0,\n \"usage\": {\n \"total_tokens\": 10\n }\n}\n```\n\n\n**Notes:**\n\n- Input must not exceed the maximum input tokens supported by the model\n- Input cannot be an empty string\n- For batch processing, pass multiple texts as an array to the `input` field\n- The embedding vector length varies by model - check model documentation for specifics\n- Use `dimensions` parameter only with Matryoshka embedding models that support resizing","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/inference/embeddings","href":"/api-reference/inference/generate-embeddings","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Inference"],"summary":"Generate Embeddings","description":"Generate dense vector embeddings for input text.\n\n\nThis endpoint creates numerical vector representations (embeddings) of text using specified embedding models. Embeddings are useful for semantic search, clustering, similarity comparisons, and RAG applications.\n\n\n**Request Body:**\n\n- `model`: Model ID (required). Use your aligned model id (e.g. `model_01kmqm4nrn9fw6r`)\n- `input`: Text or list of texts to embed (required) - Single string or array of strings. Cannot be empty and must not exceed max input tokens for the model\n- `dimensions` (optional): Number of dimensions for output embeddings (only applicable for Resizable Matryoshka Embedding models)\n\n\n**Returns:**\n\n- `id`: Unique identifier for the response\n- `object`: Object type (always `embedding`)\n- `data`: List of embedding objects, each containing:\n - `object`: Object type (always `embedding`)\n - `embedding`: Vector of floats representing the text (length depends on the model)\n - `index`: Position in the input array\n- `model`: Model ID used for generation\n- `created`: Unix timestamp (seconds) when response was generated\n- `usage`: Token usage statistics containing:\n - `total_tokens`: Total number of tokens used by the request\n\n\n**Example Request (Single Text):**\n\n```json\nPOST /api/v3/inference/embeddings\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"text-embedding-xyz\",\n \"input\": \"The quick brown fox jumps over the lazy dog\"\n}\n```\n\n\n**Example Request (Multiple Texts):**\n\n```json\nPOST /api/v3/inference/embeddings\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"input\": [\n \"First document for semantic search\",\n \"Second document for clustering\",\n \"Third document for similarity comparison\"\n ]\n}\n```\n\n\n**Example Request (With Dimensions):**\n\n```json\nPOST /api/v3/inference/embeddings\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"input\": \"Sample text to embed\",\n \"dimensions\": 512\n}\n```\n\n\n**Example Response:**\n\n```json\n{\n \"id\": \"embed-abc123xyz\",\n \"object\": \"embedding\",\n \"data\": [\n {\n \"object\": \"embedding\",\n \"embedding\": [0.00658765, -0.008665467, -0.007653789, 0.0023, -0.0091, 0.0125],\n \"index\": 0\n }\n ],\n \"model\": \"text-embedding-ada-002\",\n \"created\": 1705329600.0,\n \"usage\": {\n \"total_tokens\": 10\n }\n}\n```\n\n\n**Notes:**\n\n- Input must not exceed the maximum input tokens supported by the model\n- Input cannot be an empty string\n- For batch processing, pass multiple texts as an array to the `input` field\n- The embedding vector length varies by model - check model documentation for specifics\n- Use `dimensions` parameter only with Matryoshka embedding models that support resizing","operationId":"inference_embeddings","requestBody":"6f712d4c-77e4-48b3-912c-b07fa4d6218b","responses":{"200":"f258b5ac-8857-4f42-860b-ef0c85b038c3","401":"310e98b1-d117-4b87-bd86-57f80b9f321c","403":"d7f3b31a-51fe-480d-b1a5-a4a9eb2d596b","422":"15fd5fa5-104b-45d1-8911-45c87c5a883b"},"security":["9ad81dd8-a707-45b7-8793-8034fa817ef1"],"x-order":37,"method":"post","type":"path","servers":["446c7e81-4e2f-48c8-990b-adca5cc36d70"],"path":"/api/v3/inference/embeddings","baseUrlOptions":["https://api.nugen.in"],"title":"Generate Embeddings","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"input.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Input","description":"Input text to embed, encoded as a string or a list of strings. To embed multiple inputs in a single request, pass a list of strings. The input must not exceed the max input tokens for the model, cannot be an empty string.\n","example":"The quick brown fox jumped over the lazy dog","isRequired":true,"uniqueKey":"input.oneOf.0","typeLabel":"string[]"},{"type":"string","title":"Input","description":"Input text to embed, encoded as a string or a list of strings. To embed multiple inputs in a single request, pass a list of strings. The input must not exceed the max input tokens for the model, cannot be an empty string.\n","example":"The quick brown fox jumped over the lazy dog","isRequired":true,"uniqueKey":"input.oneOf.1","typeLabel":"string"}],"isRequired":true,"uniqueKey":"input","typeLabel":"string[] | string"},"model":{"type":"string","title":"Model","description":"Use your aligned model id (e.g. model_01kmqm4nrn9fw6r). The same aligned id serves chat completions, completions, embeddings and reranking. Alignment shapes the model's representation space, so aligned embeddings are recommended for domain retrieval.","examples":["model_01kmqm4nrn9fw6r"],"isRequired":true,"uniqueKey":"model","typeLabel":"string"},"dimensions":{"oneOf":[{"type":"integer","title":"Dimensions","description":"(Applicable for only Resizable Matryoshka Embedding models) The number of dimensions the resulting output embeddings should have.","uniqueKey":"dimensions.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Dimensions","description":"(Applicable for only Resizable Matryoshka Embedding models) The number of dimensions the resulting output embeddings should have.","uniqueKey":"dimensions.oneOf.1","typeLabel":"null"}],"uniqueKey":"dimensions","typeLabel":"integer | null"}},"type":"object","required":["input","model"],"title":"EmbeddingRequest","description":"An embeddings request in the OpenAI format.","uniqueKey":"","typeLabel":"EmbeddingRequest · object"},"examples":{"Example":{"title":"Example","value":{"input":"The quick brown fox jumped over the lazy dog","model":"model_01kmqm4nrn9fw6r","dimensions":123}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"f258b5ac-8857-4f42-860b-ef0c85b038c3":{"description":"Vector embeddings","content":{"application/json":{"schema":{"properties":{"id":{"oneOf":[{"type":"string","title":"Id","description":"A unique identifier of the response.","isRequired":true,"uniqueKey":"id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Id","description":"A unique identifier of the response.","isRequired":true,"uniqueKey":"id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"id","typeLabel":"string | null"},"data":{"oneOf":[{"type":"array","items":{"properties":{"index":{"oneOf":[{"type":"integer","title":"Index","description":"The index of the embedding in the list of embeddings.","isRequired":true,"uniqueKey":"data.oneOf.0.items.[INDEX].index.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Index","description":"The index of the embedding in the list of embeddings.","isRequired":true,"uniqueKey":"data.oneOf.0.items.[INDEX].index.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.oneOf.0.items.[INDEX].index","typeLabel":"integer | null"},"embedding":{"oneOf":[{"type":"array","items":{"type":"number","uniqueKey":"data.oneOf.0.items.[INDEX].embedding.oneOf.0.items.[INDEX]","typeLabel":"number"},"title":"Embedding","description":"The embedding vector, which is a list of floats.","isRequired":true,"uniqueKey":"data.oneOf.0.items.[INDEX].embedding.oneOf.0","typeLabel":"number[]"},{"type":"null","title":"Embedding","description":"The embedding vector, which is a list of floats.","isRequired":true,"uniqueKey":"data.oneOf.0.items.[INDEX].embedding.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.oneOf.0.items.[INDEX].embedding","typeLabel":"number[] | null"},"object":{"oneOf":[{"type":"string","title":"Object","description":"The object type, which is always 'embedding'.","default":"embedding","const":"embedding","uniqueKey":"data.oneOf.0.items.[INDEX].object.oneOf.0","typeLabel":"string"},{"type":"null","title":"Object","description":"The object type, which is always 'embedding'.","default":"embedding","uniqueKey":"data.oneOf.0.items.[INDEX].object.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.oneOf.0.items.[INDEX].object","typeLabel":"string | null"}},"type":"object","required":["index","embedding"],"title":"EmbeddingObject","description":"One embedding vector for an input.","example":{"embedding":[0.00658765,-0.008665467,-0.007653789],"index":0,"object":"embedding"},"uniqueKey":"data.oneOf.0.items.[INDEX]","typeLabel":"EmbeddingObject · object"},"title":"Data","description":"The list of embeddings generated by the model.","isRequired":true,"uniqueKey":"data.oneOf.0","typeLabel":"EmbeddingObject · object[]"},{"type":"null","title":"Data","description":"The list of embeddings generated by the model.","isRequired":true,"uniqueKey":"data.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data","typeLabel":"EmbeddingObject · object[] | null"},"model":{"oneOf":[{"type":"string","title":"Model","description":"The name of the model used to generate the embedding.","isRequired":true,"uniqueKey":"model.oneOf.0","typeLabel":"string"},{"type":"null","title":"Model","description":"The name of the model used to generate the embedding.","isRequired":true,"uniqueKey":"model.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"model","typeLabel":"string | null"},"created":{"oneOf":[{"type":"number","title":"Created","description":"The Unix time in seconds when the response was generated.","isRequired":true,"uniqueKey":"created.oneOf.0","typeLabel":"number"},{"type":"null","title":"Created","description":"The Unix time in seconds when the response was generated.","isRequired":true,"uniqueKey":"created.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"created","typeLabel":"number | null"},"usage":{"oneOf":[{"type":"object","title":"EmbeddingUsage","description":"The usage information for the request.","required":["total_tokens"],"properties":{"total_tokens":{"type":"integer","title":"Total Tokens","description":"The total number of tokens used by the request.","isRequired":true,"uniqueKey":"usage.oneOf.0.total_tokens","typeLabel":"integer"}},"isRequired":true,"uniqueKey":"usage.oneOf.0","typeLabel":"EmbeddingUsage · object"},{"type":"null","description":"The usage information for the request.","isRequired":true,"uniqueKey":"usage.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"usage","typeLabel":"EmbeddingUsage · object | null"},"object":{"oneOf":[{"type":"string","title":"Object","description":"The object type, which is always 'embedding'.","default":"embedding","const":"embedding","uniqueKey":"object.oneOf.0","typeLabel":"string"},{"type":"null","title":"Object","description":"The object type, which is always 'embedding'.","default":"embedding","uniqueKey":"object.oneOf.1","typeLabel":"null"}],"uniqueKey":"object","typeLabel":"string | null"}},"type":"object","required":["id","data","model","created","usage"],"title":"EmbeddingResponse","description":"Embedding vectors for the input, in the OpenAI format.","example":{"created":1623645497,"data":[{"embedding":[0.007897645,-0.006754357,0.007654689],"index":0}],"id":"nugen-1234","model":"model_01kmqm4nrn9fw6r","object":"embedding","usage":{"total_tokens":25}},"uniqueKey":"","typeLabel":"EmbeddingResponse · object"},"examples":{"Example":{"title":"Example","value":{"created":1623645497,"data":[{"embedding":[0.007897645,-0.006754357,0.007654689],"index":0}],"id":"nugen-1234","model":"model_01kmqm4nrn9fw6r","object":"embedding","usage":{"total_tokens":25}}}},"exampleType":"generated"}},"exampleType":"generated"},"310e98b1-d117-4b87-bd86-57f80b9f321c":{"description":"Invalid API key","content":{"application/json":{"schema":{"description":"Body of an error response.","properties":{"detail":{"oneOf":[{"type":"string","title":"Detail","description":"Human readable explanation of the error, or an object with a message and the id of the resource concerned","example":"Model not found","isRequired":true,"uniqueKey":"detail.oneOf.0","typeLabel":"string"},{"type":"object","title":"ErrorDetail","description":"Structured error detail: a message, with the id of the resource it concerns as an extra key.","required":["message"],"example":"Model not found","properties":{"message":{"description":"Human readable explanation of the error","title":"Message","type":"string","isRequired":true,"uniqueKey":"detail.oneOf.1.message","typeLabel":"string"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"detail.oneOf.1","typeLabel":"ErrorDetail · object"}],"isRequired":true,"uniqueKey":"detail","typeLabel":"string | ErrorDetail · object"}},"required":["detail"],"title":"ErrorResponse","type":"object","uniqueKey":"","typeLabel":"ErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"detail":"Model not found"}}},"exampleType":"generated"}},"exampleType":"generated"},"d7f3b31a-51fe-480d-b1a5-a4a9eb2d596b":{"description":"Authorization header missing or not a Bearer token","content":{"application/json":{"schema":{"description":"Body of an error response.","properties":{"detail":{"oneOf":[{"type":"string","title":"Detail","description":"Human readable explanation of the error, or an object with a message and the id of the resource concerned","example":"Model not found","isRequired":true,"uniqueKey":"detail.oneOf.0","typeLabel":"string"},{"type":"object","title":"ErrorDetail","description":"Structured error detail: a message, with the id of the resource it concerns as an extra key.","required":["message"],"example":"Model not found","properties":{"message":{"description":"Human readable explanation of the error","title":"Message","type":"string","isRequired":true,"uniqueKey":"detail.oneOf.1.message","typeLabel":"string"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"detail.oneOf.1","typeLabel":"ErrorDetail · object"}],"isRequired":true,"uniqueKey":"detail","typeLabel":"string | ErrorDetail · object"}},"required":["detail"],"title":"ErrorResponse","type":"object","uniqueKey":"","typeLabel":"ErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"detail":"Model not found"}}},"exampleType":"generated"}},"exampleType":"generated"},"15fd5fa5-104b-45d1-8911-45c87c5a883b":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"oneOf":[{"type":"string","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.1","typeLabel":"integer"}],"uniqueKey":"detail.items.[INDEX].loc.items.[INDEX]","typeLabel":"string | integer"},"type":"array","title":"Location","isRequired":true,"uniqueKey":"detail.items.[INDEX].loc","typeLabel":"(string | integer)[]"},"msg":{"type":"string","title":"Message","isRequired":true,"uniqueKey":"detail.items.[INDEX].msg","typeLabel":"string"},"type":{"type":"string","title":"Error Type","isRequired":true,"uniqueKey":"detail.items.[INDEX].type","typeLabel":"string"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError","description":"One request validation problem.","uniqueKey":"detail.items.[INDEX]","typeLabel":"ValidationError · object"},"type":"array","title":"Detail","uniqueKey":"detail","typeLabel":"ValidationError · object[]"}},"type":"object","title":"HTTPValidationError","description":"Body of a request validation error.","uniqueKey":"","typeLabel":"HTTPValidationError · object"},"examples":{"Example":{"title":"Example","value":{"detail":[{"loc":["\u003cstring>"],"msg":"\u003cstring>","type":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"9ad81dd8-a707-45b7-8793-8034fa817ef1":{"ApiKeyAuth":{"type":"http","description":"Your Nugen API key, sent as a Bearer token","scheme":"bearer","bearerFormat":"API key","scopes":[],"schemeName":"ApiKeyAuth"}}},"servers":{"446c7e81-4e2f-48c8-990b-adca5cc36d70":{"url":"https://api.nugen.in","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","description":"Your Nugen API key, sent as a Bearer token","scheme":"bearer","bearerFormat":"API key","scopes":[],"schemeName":"ApiKeyAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Your Nugen API key, sent as a Bearer token","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"ApiKeyAuth","name":"Authorization"}],"title":"ApiKeyAuth"}]},"originalFileLocation":"https://api.nugen.in/openapi-public.json"},"subdomain":"courteasy","siteName":"Nugen API Reference Docs","title":"Generate Embeddings - Nugen API Reference Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-30T12:09:16.344Z","originalFileLocation":"api-reference/inference/generate-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=\"Generate dense vector embeddings for input text. This endpoint creates numerical vector representations (embeddings) of text using specified embedding models. Embeddings are useful for semantic search, clustering, similarity comparisons, and RAG applications. Request Body: - model: Model ID (required). Use your aligned model id (e.g. model_01kmqm4nrn9fw6r) - input: Text or list of texts to embed (required) - Single string or array of strings. Cannot be empty and must not exceed max input tokens for the model - dimensions (optional): Number of dimensions for output embeddings (only applicable for Resizable Matryoshka Embedding models) Returns: - id: Unique identifier for the response - object: Object type (always embedding) - data: List of embedding objects, each containing: - object: Object type (always embedding) - embedding: Vector of floats representing the text (length depends on the model) - index: Position in the input array - model: Model ID used for generation - created: Unix timestamp (seconds) when response was generated - usage: Token usage statistics containing: - total_tokens: Total number of tokens used by the request Example Request (Single Text): json POST /api/v3/inference/embeddings Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;text-embedding-xyz\u0026quot;, \u0026quot;input\u0026quot;: \u0026quot;The quick brown fox jumps over the lazy dog\u0026quot; } Example Request (Multiple Texts): json POST /api/v3/inference/embeddings Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;input\u0026quot;: [ \u0026quot;First document for semantic search\u0026quot;, \u0026quot;Second document for clustering\u0026quot;, \u0026quot;Third document for similarity comparison\u0026quot; ] } Example Request (With Dimensions): json POST /api/v3/inference/embeddings Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;input\u0026quot;: \u0026quot;Sample text to embed\u0026quot;, \u0026quot;dimensions\u0026quot;: 512 } Example Response: json { \u0026quot;id\u0026quot;: \u0026quot;embed-abc123xyz\u0026quot;, \u0026quot;object\u0026quot;: \u0026quot;embedding\u0026quot;, \u0026quot;data\u0026quot;: [ { \u0026quot;object\u0026quot;: \u0026quot;embedding\u0026quot;, \u0026quot;embedding\u0026quot;: [0.00658765, -0.008665467, -0.007653789, 0.0023, -0.0091, 0.0125], \u0026quot;index\u0026quot;: 0 } ], \u0026quot;model\u0026quot;: \u0026quot;text-embedding-ada-002\u0026quot;, \u0026quot;created\u0026quot;: 1705329600.0, \u0026quot;usage\u0026quot;: { \u0026quot;total_tokens\u0026quot;: 10 } } Notes: - Input must not exceed the maximum input tokens supported by the model - Input cannot be an empty string - For batch processing, pass multiple texts as an array to the input field - The embedding vector length varies by model - check model documentation for specifics - Use dimensions parameter only with Matryoshka embedding models that support resizing\">\u003cmeta data-mint-head name=\"application-name\" content=\"Nugen API Reference Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/courteasy/0D-fi3HjPY3grfJo/_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/courteasy/0D-fi3HjPY3grfJo/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/courteasy/0D-fi3HjPY3grfJo/_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/courteasy/0D-fi3HjPY3grfJo/_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/courteasy/0D-fi3HjPY3grfJo/_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/courteasy/0D-fi3HjPY3grfJo/_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/courteasy/0D-fi3HjPY3grfJo/_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/courteasy/0D-fi3HjPY3grfJo/_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/courteasy/0D-fi3HjPY3grfJo/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Generate Embeddings - Nugen API Reference Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Generate dense vector embeddings for input text. This endpoint creates numerical vector representations (embeddings) of text using specified embedding models. Embeddings are useful for semantic search, clustering, similarity comparisons, and RAG applications. Request Body: - model: Model ID (required). Use your aligned model id (e.g. model_01kmqm4nrn9fw6r) - input: Text or list of texts to embed (required) - Single string or array of strings. Cannot be empty and must not exceed max input tokens for the model - dimensions (optional): Number of dimensions for output embeddings (only applicable for Resizable Matryoshka Embedding models) Returns: - id: Unique identifier for the response - object: Object type (always embedding) - data: List of embedding objects, each containing: - object: Object type (always embedding) - embedding: Vector of floats representing the text (length depends on the model) - index: Position in the input array - model: Model ID used for generation - created: Unix timestamp (seconds) when response was generated - usage: Token usage statistics containing: - total_tokens: Total number of tokens used by the request Example Request (Single Text): json POST /api/v3/inference/embeddings Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;text-embedding-xyz\u0026quot;, \u0026quot;input\u0026quot;: \u0026quot;The quick brown fox jumps over the lazy dog\u0026quot; } Example Request (Multiple Texts): json POST /api/v3/inference/embeddings Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;input\u0026quot;: [ \u0026quot;First document for semantic search\u0026quot;, \u0026quot;Second document for clustering\u0026quot;, \u0026quot;Third document for similarity comparison\u0026quot; ] } Example Request (With Dimensions): json POST /api/v3/inference/embeddings Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;input\u0026quot;: \u0026quot;Sample text to embed\u0026quot;, \u0026quot;dimensions\u0026quot;: 512 } Example Response: json { \u0026quot;id\u0026quot;: \u0026quot;embed-abc123xyz\u0026quot;, \u0026quot;object\u0026quot;: \u0026quot;embedding\u0026quot;, \u0026quot;data\u0026quot;: [ { \u0026quot;object\u0026quot;: \u0026quot;embedding\u0026quot;, \u0026quot;embedding\u0026quot;: [0.00658765, -0.008665467, -0.007653789, 0.0023, -0.0091, 0.0125], \u0026quot;index\u0026quot;: 0 } ], \u0026quot;model\u0026quot;: \u0026quot;text-embedding-ada-002\u0026quot;, \u0026quot;created\u0026quot;: 1705329600.0, \u0026quot;usage\u0026quot;: { \u0026quot;total_tokens\u0026quot;: 10 } } Notes: - Input must not exceed the maximum input tokens supported by the model - Input cannot be an empty string - For batch processing, pass multiple texts as an array to the input field - The embedding vector length varies by model - check model documentation for specifics - Use dimensions parameter only with Matryoshka embedding models that support resizing\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Nugen API Reference Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.nugen.in/api-reference/inference/generate-embeddings\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://courteasy.mintlify.site/_mintlify/api/og/v2?division=Inference\u0026amp;title=Generate+Embeddings\u0026amp;description=Generate+dense+vector+embeddings+for+input+text.%0A%0A%0AThis+endpoint+creates+numerical+vector+representations+%28embeddings%29+of+text+using+specified+embedding+models.\u0026amp;theme=4bbb9e0a87338e6afdf0d548\u0026amp;signature=73022400c5c11251ce7a689ad4d696eca916564062f7bbb90f8837ec01150058\">\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=\"Generate Embeddings - Nugen API Reference Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Generate dense vector embeddings for input text. This endpoint creates numerical vector representations (embeddings) of text using specified embedding models. Embeddings are useful for semantic search, clustering, similarity comparisons, and RAG applications. Request Body: - model: Model ID (required). Use your aligned model id (e.g. model_01kmqm4nrn9fw6r) - input: Text or list of texts to embed (required) - Single string or array of strings. Cannot be empty and must not exceed max input tokens for the model - dimensions (optional): Number of dimensions for output embeddings (only applicable for Resizable Matryoshka Embedding models) Returns: - id: Unique identifier for the response - object: Object type (always embedding) - data: List of embedding objects, each containing: - object: Object type (always embedding) - embedding: Vector of floats representing the text (length depends on the model) - index: Position in the input array - model: Model ID used for generation - created: Unix timestamp (seconds) when response was generated - usage: Token usage statistics containing: - total_tokens: Total number of tokens used by the request Example Request (Single Text): json POST /api/v3/inference/embeddings Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;text-embedding-xyz\u0026quot;, \u0026quot;input\u0026quot;: \u0026quot;The quick brown fox jumps over the lazy dog\u0026quot; } Example Request (Multiple Texts): json POST /api/v3/inference/embeddings Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;input\u0026quot;: [ \u0026quot;First document for semantic search\u0026quot;, \u0026quot;Second document for clustering\u0026quot;, \u0026quot;Third document for similarity comparison\u0026quot; ] } Example Request (With Dimensions): json POST /api/v3/inference/embeddings Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;input\u0026quot;: \u0026quot;Sample text to embed\u0026quot;, \u0026quot;dimensions\u0026quot;: 512 } Example Response: json { \u0026quot;id\u0026quot;: \u0026quot;embed-abc123xyz\u0026quot;, \u0026quot;object\u0026quot;: \u0026quot;embedding\u0026quot;, \u0026quot;data\u0026quot;: [ { \u0026quot;object\u0026quot;: \u0026quot;embedding\u0026quot;, \u0026quot;embedding\u0026quot;: [0.00658765, -0.008665467, -0.007653789, 0.0023, -0.0091, 0.0125], \u0026quot;index\u0026quot;: 0 } ], \u0026quot;model\u0026quot;: \u0026quot;text-embedding-ada-002\u0026quot;, \u0026quot;created\u0026quot;: 1705329600.0, \u0026quot;usage\u0026quot;: { \u0026quot;total_tokens\u0026quot;: 10 } } Notes: - Input must not exceed the maximum input tokens supported by the model - Input cannot be an empty string - For batch processing, pass multiple texts as an array to the input field - The embedding vector length varies by model - check model documentation for specifics - Use dimensions parameter only with Matryoshka embedding models that support resizing\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://courteasy.mintlify.site/_mintlify/api/og/v2?division=Inference\u0026amp;title=Generate+Embeddings\u0026amp;description=Generate+dense+vector+embeddings+for+input+text.%0A%0A%0AThis+endpoint+creates+numerical+vector+representations+%28embeddings%29+of+text+using+specified+embedding+models.\u0026amp;theme=4bbb9e0a87338e6afdf0d548\u0026amp;signature=73022400c5c11251ce7a689ad4d696eca916564062f7bbb90f8837ec01150058\">\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/courteasy/0D-fi3HjPY3grfJo/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Nugen API Reference Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#005b96\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.nugen.in/api-reference/inference/generate-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/inference/generate-embeddings.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.nugen.in/#organization\",\"name\":\"Nugen API Reference Docs\",\"url\":\"https://docs.nugen.in\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/courteasy/YYugGl8ZAoQlnBYp/logo/light.svg?fit=max\u0026auto=format\u0026n=YYugGl8ZAoQlnBYp\u0026q=85\u0026s=f5f462b08161252f94dca4827e8055a0\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.nugen.in#website\",\"name\":\"Nugen API Reference Docs\",\"url\":\"https://docs.nugen.in\",\"publisher\":{\"@id\":\"https://docs.nugen.in/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.nugen.in/api-reference/inference/generate-embeddings#webpage\",\"url\":\"https://docs.nugen.in/api-reference/inference/generate-embeddings\",\"name\":\"Generate Embeddings\",\"description\":\"Generate dense vector embeddings for input text. This endpoint creates numerical vector representations (embeddings) of text using specified embedding models. Embeddings are useful for semantic search, clustering, similarity comparisons, and RAG applications. Request Body: - model: Model ID (required). Use your aligned model id (e.g. model_01kmqm4nrn9fw6r) - input: Text or list of texts to embed (required) - Single string or array of strings. Cannot be empty and must not exceed max input tokens for the model - dimensions (optional): Number of dimensions for output embeddings (only applicable for Resizable Matryoshka Embedding models) Returns: - id: Unique identifier for the response - object: Object type (always embedding) - data: List of embedding objects, each containing: - object: Object type (always embedding) - embedding: Vector of floats representing the text (length depends on the model) - index: Position in the input array - model: Model ID used for generation - created: Unix timestamp (seconds) when response was generated - usage: Token usage statistics containing: - total_tokens: Total number of tokens used by the request Example Request (Single Text): json POST /api/v3/inference/embeddings Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"text-embedding-xyz\\\", \\\"input\\\": \\\"The quick brown fox jumps over the lazy dog\\\" } Example Request (Multiple Texts): json POST /api/v3/inference/embeddings Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"input\\\": [ \\\"First document for semantic search\\\", \\\"Second document for clustering\\\", \\\"Third document for similarity comparison\\\" ] } Example Request (With Dimensions): json POST /api/v3/inference/embeddings Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"input\\\": \\\"Sample text to embed\\\", \\\"dimensions\\\": 512 } Example Response: json { \\\"id\\\": \\\"embed-abc123xyz\\\", \\\"object\\\": \\\"embedding\\\", \\\"data\\\": [ { \\\"object\\\": \\\"embedding\\\", \\\"embedding\\\": [0.00658765, -0.008665467, -0.007653789, 0.0023, -0.0091, 0.0125], \\\"index\\\": 0 } ], \\\"model\\\": \\\"text-embedding-ada-002\\\", \\\"created\\\": 1705329600.0, \\\"usage\\\": { \\\"total_tokens\\\": 10 } } Notes: - Input must not exceed the maximum input tokens supported by the model - Input cannot be an empty string - For batch processing, pass multiple texts as an array to the input field - The embedding vector length varies by model - check model documentation for specifics - Use dimensions parameter only with Matryoshka embedding models that support resizing\",\"dateModified\":\"2026-10-30T12:09:16.344Z\",\"isPartOf\":{\"@id\":\"https://docs.nugen.in#website\"},\"breadcrumb\":{\"@id\":\"https://docs.nugen.in/api-reference/inference/generate-embeddings#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.nugen.in/api-reference/inference/generate-embeddings#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Nugen API Reference Docs\",\"item\":\"https://docs.nugen.in\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Generate Embeddings\",\"item\":\"https://docs.nugen.in/api-reference/inference/generate-embeddings\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.nugen.in/api-reference/inference/generate-embeddings#apireference\",\"headline\":\"Generate Embeddings\",\"name\":\"Generate Embeddings\",\"description\":\"Generate dense vector embeddings for input text. This endpoint creates numerical vector representations (embeddings) of text using specified embedding models. Embeddings are useful for semantic search, clustering, similarity comparisons, and RAG applications. Request Body: - model: Model ID (required). Use your aligned model id (e.g. model_01kmqm4nrn9fw6r) - input: Text or list of texts to embed (required) - Single string or array of strings. Cannot be empty and must not exceed max input tokens for the model - dimensions (optional): Number of dimensions for output embeddings (only applicable for Resizable Matryoshka Embedding models) Returns: - id: Unique identifier for the response - object: Object type (always embedding) - data: List of embedding objects, each containing: - object: Object type (always embedding) - embedding: Vector of floats representing the text (length depends on the model) - index: Position in the input array - model: Model ID used for generation - created: Unix timestamp (seconds) when response was generated - usage: Token usage statistics containing: - total_tokens: Total number of tokens used by the request Example Request (Single Text): json POST /api/v3/inference/embeddings Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"text-embedding-xyz\\\", \\\"input\\\": \\\"The quick brown fox jumps over the lazy dog\\\" } Example Request (Multiple Texts): json POST /api/v3/inference/embeddings Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"input\\\": [ \\\"First document for semantic search\\\", \\\"Second document for clustering\\\", \\\"Third document for similarity comparison\\\" ] } Example Request (With Dimensions): json POST /api/v3/inference/embeddings Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"input\\\": \\\"Sample text to embed\\\", \\\"dimensions\\\": 512 } Example Response: json { \\\"id\\\": \\\"embed-abc123xyz\\\", \\\"object\\\": \\\"embedding\\\", \\\"data\\\": [ { \\\"object\\\": \\\"embedding\\\", \\\"embedding\\\": [0.00658765, -0.008665467, -0.007653789, 0.0023, -0.0091, 0.0125], \\\"index\\\": 0 } ], \\\"model\\\": \\\"text-embedding-ada-002\\\", \\\"created\\\": 1705329600.0, \\\"usage\\\": { \\\"total_tokens\\\": 10 } } Notes: - Input must not exceed the maximum input tokens supported by the model - Input cannot be an empty string - For batch processing, pass multiple texts as an array to the input field - The embedding vector length varies by model - check model documentation for specifics - Use dimensions parameter only with Matryoshka embedding models that support resizing\",\"url\":\"https://docs.nugen.in/api-reference/inference/generate-embeddings\",\"mainEntityOfPage\":{\"@id\":\"https://docs.nugen.in/api-reference/inference/generate-embeddings#webpage\"},\"dateModified\":\"2026-10-30T12:09:16.344Z\",\"publisher\":{\"@id\":\"https://docs.nugen.in/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.nugen.in#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Nugen API Reference Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Nugen API Reference Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/inference/generate-embeddings.md","siteName":"Nugen API Reference Docs","nav":{"global":{"anchors":[{"anchor":"API Status","icon":"bolt-lightning","href":"https://status.nugen.in"},{"anchor":"Nugen Intelligence","icon":"earth-asia","href":"https://nugen.in"}]},"tabs":[{"tab":"API Reference","groups":[{"group":"Alignment Projects","pages":[{"title":"Create Alignment","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/alignment-projects/create","href":"/api-reference/alignment-projects/create-alignment"},{"title":"List Alignment Projects","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/alignment-projects/list","href":"/api-reference/alignment-projects/list-alignment-projects"},{"title":"Get Alignment Project","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/alignment-projects/{alignment_id}","href":"/api-reference/alignment-projects/get-alignment-project"},{"title":"Delete Alignment","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json delete /api/v3/alignment-projects/{alignment_id}","href":"/api-reference/alignment-projects/delete-alignment"},{"title":"Get Alignment Status","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/alignment-projects/{alignment_id}/status","href":"/api-reference/alignment-projects/get-alignment-status"},{"title":"Stop Alignment","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/alignment-projects/{alignment_id}/stop","href":"/api-reference/alignment-projects/stop-alignment"},{"title":"Start Auto-Align","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/alignment-projects/{alignment_id}/auto-align","href":"/api-reference/alignment-projects/start-auto-align"}]},{"group":"Models","pages":[{"title":"List Base Models","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/models/base","href":"/api-reference/models/list-base-models"},{"title":"List Aligned Models","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/models/aligned","href":"/api-reference/models/list-aligned-models"},{"title":"Get Model","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/models/{model_id}","href":"/api-reference/models/get-model"},{"title":"Deploy Aligned Model","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/models/{model_id}/deployment","href":"/api-reference/models/deploy-aligned-model"},{"title":"Undeploy Model","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json delete /api/v3/models/{model_id}/deployment","href":"/api-reference/models/undeploy-model"},{"title":"Get Deployment Status","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/models/{model_id}/deployment/status","href":"/api-reference/models/get-deployment-status"},{"title":"Refresh Deployed Model","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/models/{model_id}/deployment/refresh","href":"/api-reference/models/refresh-deployed-model"},{"title":"Export to Hugging Face","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/models/{model_id}/export-hf","href":"/api-reference/models/export-to-hugging-face"},{"title":"Import from Hugging Face","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/models/base/import","href":"/api-reference/models/import-from-hugging-face"},{"title":"Get the status of a Hugging Face export","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/models/{model_id}/export-hf/status","href":"/api-reference/models/get-the-status-of-a-hugging-face-export"}]},{"group":"Documents","pages":[{"title":"Upload Documents","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/documents/create","href":"/api-reference/documents/upload-documents"},{"title":"List Documents","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/documents/list","href":"/api-reference/documents/list-documents"},{"title":"Get Document Status","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/documents/{document_id}/status","href":"/api-reference/documents/get-document-status"},{"title":"Get Document","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/documents/{document_id}","href":"/api-reference/documents/get-document"},{"title":"Delete Document","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json delete /api/v3/documents/{document_id}","href":"/api-reference/documents/delete-document"}]},{"group":"Benchmarks","pages":[{"title":"Create Benchmark","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/benchmarks/create","href":"/api-reference/benchmarks/create-benchmark"},{"title":"Upload Benchmark","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/benchmarks/upload","href":"/api-reference/benchmarks/upload-benchmark"},{"title":"List Benchmarks","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/benchmarks/list","href":"/api-reference/benchmarks/list-benchmarks"},{"title":"Get Benchmark","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/benchmarks/{benchmark_id}","href":"/api-reference/benchmarks/get-benchmark"},{"title":"Delete Benchmark","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json delete /api/v3/benchmarks/{benchmark_id}","href":"/api-reference/benchmarks/delete-benchmark"},{"title":"Get Benchmark Status","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/benchmarks/{benchmark_id}/status","href":"/api-reference/benchmarks/get-benchmark-status"},{"title":"Get Generated Benchmark","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/benchmarks/{benchmark_id}/data","href":"/api-reference/benchmarks/get-generated-benchmark"}]},{"group":"Evaluations","pages":[{"title":"Create Evaluation","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/evaluations/create","href":"/api-reference/evaluations/create-evaluation"},{"title":"List User Evaluations","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/evaluations/list","href":"/api-reference/evaluations/list-user-evaluations"},{"title":"Get Evaluation","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/evaluations/{evaluation_id}","href":"/api-reference/evaluations/get-evaluation"},{"title":"Delete Evaluation","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json delete /api/v3/evaluations/{evaluation_id}","href":"/api-reference/evaluations/delete-evaluation"},{"title":"Get Evaluation Status","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/evaluations/{evaluation_id}/status","href":"/api-reference/evaluations/get-evaluation-status"},{"title":"Get Evaluation Results","description":"Retrieve the complete results of a finished evaluation.\n\nThis endpoint returns detailed evaluation metrics and scores for a completed evaluation. Works for both single model evaluations and comparison mode evaluations.\n\n**Path Parameters:**\n\n- `evaluation_id`: Unique evaluation identifier\n\n**Returns:**\n\n- `evaluation_id`: The evaluation identifier\n- `raw_responses_count`: Number of raw responses generated during evaluation\n- `method` (optional): Evaluation method (`eval` for single model, `eval-compare` for comparison)\n- `metrics` (optional): Evaluation metrics and scores (single model only)\n- `baseline_model_id` (optional): Baseline model ID (comparison mode only)\n- `model` (optional): Aligned model results (comparison mode only)\n- `baseline` (optional): Baseline model results (comparison mode only)\n- `comparison` (optional): Comparison results between models (comparison mode only)\n\nIdentity, status, and timestamps are served by `GET /{evaluation_id}`.\n\n**Raises:**\n\n- `404`: If evaluation not found or doesn't belong to the authenticated user\n- `400`: If evaluation is not yet completed, or FAILED with no results\n\n**Example Request:**\n\n```json\nGET /api/v3/evaluations/evaluation_01k4x9m2p7q3r7b1/results\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n```\n\n**Example Response (Single Model):**\n\n```json\n{\n \"evaluation_id\": \"evaluation_01k4x9m2p7q3r7b1\",\n \"method\": \"eval\",\n \"raw_responses_count\": 10,\n \"metrics\": {\n \"accuracy\": 0.92,\n \"relevance\": 0.88,\n \"average_score\": 0.90,\n \"n_samples\": 10,\n \"correct_answers\": 9\n }\n}\n```\n\n**Example Response (Comparison Mode):**\n\n```json\n{\n \"evaluation_id\": \"evaluation_01k4x9m2p7q3r7b1\",\n \"baseline_model_id\": \"model_01kmqm4nrn9fw6r\",\n \"method\": \"eval-compare\",\n \"raw_responses_count\": 20,\n \"model\": {\n \"model_id\": \"model_01kmqm4nrn9fw6r\",\n \"average_score\": 0.92,\n \"n_samples\": 10\n },\n \"baseline\": {\n \"model_id\": \"Qwen/Qwen2.5-0.5B-Instruct\",\n \"average_score\": 0.85,\n \"n_samples\": 10\n },\n \"comparison\": {\n \"winner\": \"Qwen/Qwen2.5-0.5B-Instruct\",\n \"score_difference\": 0.07,\n \"statistical_significance\": true\n }\n}\n```","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/evaluations/{evaluation_id}/results","href":"/api-reference/evaluations/get-evaluation-results"}]},{"group":"Inference","pages":[{"title":"Generate Embeddings","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/inference/embeddings","href":"/api-reference/inference/generate-embeddings"},{"title":"Generate Chat Completions","description":"Generate conversational responses with streaming support and multimodal capabilities.\n\n\nThis endpoint generates chat completions using language models, supporting both text-only conversations and vision inputs. Includes support for function calling, streaming responses, and automatic conversation tracking.\n\n\n**Request Body:**\n\n- `model`: Model ID (required). Use your aligned model id (e.g. `model_01kmqm4nrn9fw6r`); base text models (e.g. `model_01kmqm4nrn9fw6r`) also work if you have not aligned a model yet. For reserved capacity pass `ptm_id:model_id`\n- `messages`: Array of message objects (required, minimum 1), each containing:\n - `role`: Message role (`system`, `user`, or `assistant`)\n - `content`: Text string OR array of content objects (for multimodal)\n - Text: `{\"type\": \"text\", \"text\": \"your message\"}`\n - Image URL: `{\"type\": \"image_url\", \"image_url\": {\"url\": \"https://...\"}}`\n - Image Base64: `{\"type\": \"image_url\", \"image_url\": {\"url\": \"data:image/jpeg;base64,...\"}}`\n - `name` (optional): Author name (a-z, A-Z, 0-9, underscores, max 64 chars)\n- `max_tokens` (optional): Maximum tokens to generate in completion\n- `prompt_truncate_len` (optional): Size to truncate chat prompts (default: 1500)\n- `temperature` (optional): Sampling temperature between 0 and 2 (default: 1)\n- `stream` (optional): Stream the response as server-sent events (default: `true`). Set `stream: false` for one JSON response.\n > **Tip:** For prompts where you expect a long output (e.g., `max_tokens > 500`), keep streaming on to avoid HTTP 504 gateway timeouts on slow or large responses.\n- `tools` (optional): List of tools/functions available to the model\n- `tool_choice` (optional): Tool selection mode (`auto`, `none`, or specific tool)\n- `top_p` (optional): Nucleus sampling parameter\n- `top_k` (optional): Top-k sampling parameter\n- `n` (optional): Number of completions to generate (default: 1)\n- `reasoning` (optional): Reasoning configuration object with:\n - `effort`: Reasoning effort level (`xhigh`, `high`, `medium`, `low`, `minimal`, `none`)\n - `max_tokens`: Token limit for reasoning\n - `exclude`: Set true to exclude reasoning tokens from response\n - `enabled`: Enable reasoning with default parameters\n\n\n**Optional Headers:**\n\n- `X-Session-ID`: Session identifier for multi-turn conversation tracking\n\n\n**Returns:**\n\n**Non-streaming mode** -\n- `id`: Unique identifier for the response\n- `object`: Object type (always `chat.completion`)\n- `created`: Unix timestamp when completion was created\n- `model`: Model used for chat completion\n- `choices`: List of completion choices, each containing:\n - `index`: Index of the choice\n - `message`: Response message with:\n - `role`: Role of the author (always `assistant`)\n - `content`: Generated response text\n - `tool_calls` (optional): Tool calls made by the model (for function calling)\n - `finish_reason`: Reason model stopped (`stop` for natural stop, `length` if max tokens reached)\n- `usage`: Token usage statistics:\n - `prompt_tokens`: Number of tokens in the prompt\n - `completion_tokens`: Number of tokens generated\n - `total_tokens`: Total tokens used (prompt + completion)\n- `confidence_score` (optional): Confidence score, 0-100, on aligned models; null on base models\n\n**Streaming mode** - `ChatCompletionChunk` stream with:\n- `id`: Unique identifier\n- `created`: Timestamp\n- `model`: Model ID\n- `choices`: List of chunk choices with:\n - `index`: ChatCompletionChoice index\n - `delta`: Delta content with `role` and `content`\n - `finish_reason`: Reason for stopping (only in final chunk)\n- `usage` (optional): Only present in final chunk\n\n\n**Example Request (Text Chat):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_tokens\": 500,\n \"temperature\": 0.7,\n \"stream\": false\n}\n```\n\n\n**Example Response (Text Chat):**\n\n```json\n{\n \"id\": \"nugen-abc123\",\n \"object\": \"chat.completion\",\n \"created\": 1704123600.0,\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The capital of France is Paris.\"\n },\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 20,\n \"completion_tokens\": 8,\n \"total_tokens\": 28\n },\n \"confidence_score\": 89.5454\n}\n```\n\n\n**Example Request (Using Domain-Aligned Model):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"How do I return a product?\"\n }\n ],\n \"max_tokens\": 500,\n \"temperature\": 0.7,\n \"stream\": false\n}\n```\n\n\n**Example Response (Domain-Aligned Model):**\n\n```json\n{\n \"id\": \"nugen-abc456\",\n \"object\": \"chat.completion\",\n \"created\": 1704123700.0,\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"To return a product, please visit our returns portal within 30 days of purchase with your order number and receipt.\"\n },\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 15,\n \"completion_tokens\": 25,\n \"total_tokens\": 40\n },\n \"confidence_score\": 95.8\n}\n```\n\n**How to get your aligned model ID:**\n1. Create an alignment project using `POST /api/v3/alignment-projects/create`\n2. Poll `GET /api/v3/alignment-projects/{id}/status` until status is `READY`\n3. Use the `model_id` field from the response (e.g., `\"model_01kmqm4nrn9fw6r\"`)\n4. Deploy the model using `POST /api/v3/models/{model_id}/deployment` (optional - for evaluation/production use)\n5. Use the `model_id` in the `model` parameter for inference requests\n\n\n**Example Request (Vision - Image URL):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Describe what you see in this image.\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/image.jpg\"\n }\n }\n ]\n }\n ],\n \"max_tokens\": 1000,\n \"stream\": false\n}\n```\n\n\n**Example Request (Vision - Base64 Image):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's in this image?\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n }\n }\n ]\n }\n ],\n \"stream\": false\n}\n```\n\n\n**Example Request (Function Calling):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\"role\": \"user\", \"content\": \"What is the status of INC-4821?\"}\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_incident\",\n \"description\": \"Get incident status\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"incident_id\": {\"type\": \"string\"}\n }\n }\n }\n }\n ],\n \"tool_choice\": \"auto\",\n \"stream\": false\n}\n```\n\n\n**Example Request (Streaming):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [{\"role\": \"user\", \"content\": \"Tell me a story\"}],\n \"stream\": true\n}\n```\n\n\n**Example Response (Streaming):**\n\n```\ndata: {\"id\":\"nugen-abc123\",\"created\":1704123600.0,\"model\":\"model_01kmqm4nrn9fw6r\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"Once\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"nugen-abc123\",\"created\":1704123600.0,\"model\":\"model_01kmqm4nrn9fw6r\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" upon\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"nugen-abc123\",\"created\":1704123600.0,\"model\":\"model_01kmqm4nrn9fw6r\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" a time\"},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":10,\"completion_tokens\":5,\"total_tokens\":15}}\n\ndata: [DONE]\n```\n\n\n**Provisioned throughput:**\n\nReserve inference capacity for production workloads. Pass your provisioned id in `model` as `ptm_id:model_id` in place of the plain `model_id`. The request and response surface is identical, so your application code stays as it is once capacity is reserved. Available for aligned models on the Enterprise Edition.\n\n**Notes:**\n\n- Supports both text-only and vision/multimodal inputs depending on the model\n- **Using Domain-Aligned Models**: Pass the `model_id` from your completed alignment project as the `model` parameter. Get your aligned model IDs from `GET /api/v3/alignment-projects/{id}/status` or `GET /api/v3/models/aligned`\n- Function calling enables models to invoke external tools via `tools` and `tool_choice` parameters\n- `confidence_score` (0-100) comes from inference-time alignment: uncertainty is quantified across the generation trajectory, flagging any drift from your domain. Available on aligned models only; always null for base models. In streaming mode, confidence arrives as its own `{\"object\": \"confidence\", ...}` events interleaved with content chunks, one per generated span, rather than a single value on the final chunk\n- For streaming, usage statistics are included only in the final chunk\n- Conversations are automatically saved to S3 if enabled in user settings\n- Include `X-Session-ID` header for multi-turn conversation tracking\n- Use `prompt_truncate_len` to control context window usage for long conversations\n- The `reasoning` parameter enables advanced reasoning capabilities for supported models","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/inference/chat/completions","href":"/api-reference/inference/generate-chat-completions"},{"title":"OpenAI-compatible Responses","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/inference/responses","href":"/api-reference/inference/openai-compatible-responses"},{"title":"Rerank Documents","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/inference/reranker","href":"/api-reference/inference/rerank-documents"},{"title":"Inference Settings","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/inference/capture","href":"/api-reference/inference/inference-settings"}]},{"group":"BYOC","pages":[{"title":"Deploy in your own cloud or cluster","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/byoc/clusters","href":"/api-reference/byoc/deploy-in-your-own-cloud-or-cluster"},{"title":"Get Cluster Health","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/byoc/clusters/{cluster_id}/status","href":"/api-reference/byoc/get-cluster-health"}]},{"group":"Health","pages":[{"title":"API Health","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /health","href":"/api-reference/health/api-health"}]}]}]},"basePath":"","title":"Generate Embeddings - Nugen API Reference Docs","buildId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","deploymentId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CybtLBIt.js","utils-BMLj2fvV.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-B6In562Y.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Dr8Mfhp9.js","snippetPresets-2rmQvMVl.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-WMqJYdZj.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CJ-MlPHu.js","shallow-dY3TMRCk.js","getApiPlaygroundDisplay-v-1B2bKm.js","CodeSnippet-BDhiTB7U.js","CodeSnippets-D9hnzQcS.js","Page-C4GwDT3_.js","getPastedJson-Th2V45jI.js","icon-BQXch1W9.js","MethodPill-BCqUneP3.js","DuplicateIcon-Q_-bhurZ.js","createIcon-DUjLHRqp.js","DynamicMarkdown-B-f2cqXQ.js","SectionHeading-Da5NsV4v.js","axios-vUo_bRtp.js","Markdown-D13FWkIM.js","clsx-D3Isdib3.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-C-XZBk9h.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink--qIqmmVG.js"]}