Skip to main content
Planned for deprecation. The Embedding API will be removed in a future release. For code search, use WarpGrep instead. WarpGrep is a search agent that handles retrieval, ranking, and file reading in one call, replacing the need to manage embeddings, vector databases, and reranking pipelines yourself.

Overview

Morph provides an OpenAI-compatible API for generating embeddings from code and text. State of the art on code retrieval tasks with our latest morph-embedding-v4 model.

Example Request

Model Selection

We recommend using morph-embedding-v4 for the best performance on code retrieval tasks. This model offers:
  • State-of-the-Art Performance: Achieves SoTA results across all coding benchmarks for accuracy:speed ratio
  • 1536 Dimensions: Optimal dimensionality for rich semantic representation while maintaining efficiency
  • Unmatched Speed: Fastest inference in the market - no embedding model comes close on accuracy:speed
  • Enhanced Context: Superior handling of longer code snippets and complex codebases

Input Format

The request accepts the following parameters:

Batch Processing Example

Response Format

When multiple inputs are provided, the response includes embeddings for each input:

Usage with Vector Databases

Embeddings can be stored in vector databases for efficient similarity searching: