This model is in preview. Contact us for production or latency sensitive specs.

You can generate embeddings for text using the intent-embed model. Intent Embed is a mdoel that generates embeddings for text, specifically to represent the user intent. Potential use cases include:

  • User Intent classification
  • Intent similarity
  • Out of topic exclusion
  • Intent clustering and analytics
  • And more

Read the technical paper here: Phospho Intent Embeddings.


Create an account on and get your API key. You need to have setup a billing method. You can add a it in the Settings of your dashboard here.


Using the OpenAI client

The phospho embedding endpoint is OpenAI compatible. You can use the OpenAI client to send requests to the phospho API.

from openai import OpenAI

client = OpenAI(

response = client.embeddings.create(
    input="I want to use the phospho intent embeddings api",


For now, the input must be a single string. Passing more than one string will result in an error.

Using the API directly

To send a request, add:

  • text: The text to embed, usually a user query or message.
  • model: must be set to intent-embed.

Optionally, to link this embedding to one of your projects, you can specify the following optional parameters:

  • project_id: The project id you want to link this embedding to.

curl -X 'POST' \
  '' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer YOUR_PHOSPHO_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "input": "Your text to embed here",
  "model": "intent-embed"

You will get a response with the embeddings for the input text. The embeddings are a list of floats.

  "object": "list",
  "data": [
      "object": "embedding",
      "embedding": [
      "index": 0
  "model": "intent-embed",
  "usage": {
    "prompt_tokens": 3,
    "total_tokens": 3

These embeddings can stored in vector databases like Pinecone, Milvus, Chroma, Qdrand, etc. for similarity search, clustering, and other analytics.


The pricing is based on the number of tokens in the input text.

Note: You need to have a billing method setup to use the model. Acces your billing portal to add one.

Model namePrice per 1M input tokens

You are billed in $1 increment.

Contact us for high volume pricing.