Embeddings

Create embeddings

Generates embedding vectors for one or more text inputs using the server's configured embedding model. Provide input for a single text or inputs for a batch. At least one is required. Returns embedding when input is used, and embeddings when inputs is used.

project_id names the project the call's token usage is metered against, so embedding spend reaches the usage rollup and the project's cost_usd / tokens quotas. A project-scoped credential supplies its own project; a call that names none and is bound to none is 400 VALIDATION_FAILED.

post/v1/projects/{project_id}/embeddings

Request

  • Base URL: https://api.naturali.ai
  • URL: https://api.naturali.ai/v1/projects/{project_id}/embeddings
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://api.naturali.ai/authorize, token URL https://api.naturali.ai/token, scopes: mcp:access)

Request body

inputstring

Single text to embed.

inputsstring[]

Batch of texts to embed. At most 256 per request — each input is one call to the embedding model, so a larger batch is refused (VALIDATION_FAILED) rather than queued. Split it across requests.

Example request

{
  "input": "The quick brown fox jumps over the lazy dog.",
  "inputs": [
    "The quick brown fox.",
    "Pack my box with five dozen liquor jugs."
  ]
}

Response

Embeddings generated successfully

embeddingnumber[]

Embedding vector for the single input text.

Example response

{
  "embedding": [
    0.123,
    -0.456,
    0.789
  ],
  "embeddings": [
    [
      0.123,
      -0.456,
      0.789
    ],
    [
      0.321,
      -0.654,
      0.987
    ]
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.