Generate embeddings for code
morph-embedding-v4 model.
morph-embedding-v4 for the best performance on code retrieval tasks. This model offers:
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model ID to use for embedding generation. Use morph-embedding-v4 (latest). |
input | string or array | Yes | The text to generate embeddings for. Can be a string or an array of strings. |
encoding_format | string | No | The format in which the embeddings are returned. Options are float and base64. Default is float. |
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Embedding generation request
ID of the model to use for embedding generation
"morph-embedding-v4"
The text to generate embeddings for. Can also be an array of strings for batch processing.
"function calculateSum(a, b) { return a + b; }"
The format in which the embeddings are returned
float, base64