Skip to main content
POST
https://app.firmware.ai
/
api
/
v1
/
embeddings
Embeddings
curl --request POST \
  --url https://app.firmware.ai/api/v1/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "input": {},
  "encoding_format": "<string>",
  "dimensions": 123
}
'
{
  "object": "list",
  "data": [
    {
      "index": 0,
      "object": "embedding",
      "embedding": [0.0023064255, -0.009327292, 0.015797347]
    }
  ],
  "model": "text-embedding-3-small",
  "usage": {
    "prompt_tokens": 9,
    "total_tokens": 9
  }
}
Create an embedding vector from a text input. Compatible with the OpenAI embeddings API.

Authenticate

Use an API key in the Authorization header.
curl https://app.firmware.ai/api/v1/embeddings \
  -H "Authorization: Bearer $FIRMWARE_API_KEY"

Request body

model
string
required
Embedding model ID to use. See available embedding models for the full list.Examples: text-embedding-3-small, text-embedding-3-large, voyage-4, voyage-4-large
input
string | array
required
Text to embed. Pass a string for a single input or an array of strings for batch embedding.
["The quick brown fox", "jumped over the lazy dog"]
encoding_format
string
default:"float"
Format for the returned embeddings. Options: float, base64.
dimensions
integer
Number of dimensions for the output embedding. Supported on text-embedding-3-small and text-embedding-3-large.

Response

object
string
Always list.
data
array
Array of embedding objects.
model
string
The model used to generate the embeddings.
usage
object
Token usage statistics.

Examples

curl https://app.firmware.ai/api/v1/embeddings \
  -H "Authorization: Bearer $FIRMWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-small",
    "input": "The quick brown fox jumped over the lazy dog"
  }'
{
  "object": "list",
  "data": [
    {
      "index": 0,
      "object": "embedding",
      "embedding": [0.0023064255, -0.009327292, 0.015797347]
    }
  ],
  "model": "text-embedding-3-small",
  "usage": {
    "prompt_tokens": 9,
    "total_tokens": 9
  }
}