页面简介
Converts text into vector representations. Supports batch input, multiple models, and configurable output dimensions.
正文摘录
cURLSingle Inputcurl --request POST \ --url https://api.octen.ai/embedding \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "input": [ "What is vector search?" ], "model": "octen-embedding-8b", "dimension": 4096, "input_type": "query" } '200400401403429500{ "code": 0, "msg": "success", "request_id": "req_abc123def456", "data": { "results": [ { "index": 0, "embedding": [ 0.0123, -0.0456, 0.0789 ] }, { "index": 1, "embedding": [ -0.0011, 0.0234, 0.0567 ] } ], "model": "octen-embedding-0.6b" }, "meta": { "usage": { "input_tokens": 128 }, "latency": 167, "warning": "Input was truncated for one or more items." } }POST/embeddingTry itcURLSingle Inputcurl --request POST \ --url https://api.octen.ai/embedding \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "input": [ "What is vector search?" ], "model": "octen-embedding-8b", "dimension": 4096, "input_type": "query" } '200400401403429500{ "code": 0, "msg": "success", "request_id": "req_abc123def456", "data": { "results": [ { "index": 0, "embedding": [ 0.0123, -0.0456, 0.0789 ] }, { "index": 1, "embedding": [ -0.0011, 0.0234, 0.0567 ] } ], "model": "octen-embedding-0.6b" }, "meta": { "usage": { "input_tokens": 128 }, "latency": 167, "warning": "Input was truncated for one or more items." } }AuthorizationsbearerAuthapiKeyAuthAuthorizationstringheaderrequiredBearer token used for request authentication. Alternatively, you can send the API key in the x-api-key header. Note: A payment method is required to use the API.Bodyapplication/jsoninputstring[]requiredThe text to be converted into embeddings. Maximum characters per element: 10000. Maximum request body size: 2MBMaximum array length: 1000modelenum<string>default:octen-embedding-4bThe embedding model used for this request. octen-embedding-0.6b (max dim: 1024) for cost/throughput priority; octen-embedding-4b (max dim: 2560) for most applications; octen-embedding-8b (max dim: 4096) for accuracy-critical tasks.Available options: octen-embedding-0.6b, octen-embedding-4b, octen-embedding-8b dimensionintegerThe dimensionality of the output embedding vectors. Defaults to the model's max dimension (0.6b: 1024, 4b: 2560, 8b: 4096). If set to a value smaller than the model default, the embedding will be truncated to the first N values. Any positive integer ≤ model default dimension is allowed.input_typeenum<string> | nullSpecifies whether the input is a query or a document for retrieval. Different values apply different internal prompts: query → "Represent the query for retrieving supporting" (prepended and counted in input_tokens); document and null mean no special prompt is applied.Available options: query, document Response200application/jsonSuccessful embedding responserequest_idstringrequiredThe unique identifier for this request.codeintegerBusiness status code. 0 indicates success.msgstringA message describing the result.dataobjectThe main embedding response payload.Show child attributesmetaobjectAdditional metadata for the embedding request.Show child attributesWas this page helpful?YesNo