Skip to main content
Menu
Build / Embeddings
Build

Embeddings

Turn texts into vectors for search and retrieval with a model of kind embedding.

3 minute readUpdated 13 November 2026curl · Python · TypeScript

Create embeddings#

POST /v1/embeddings returns one vector per input, in the order of the inputs. input is one text or a list of up to 2048 texts. The OpenAI SDKs' embeddings call works with the base URL and key changed.

Embeddings are served Routed only. A request for the Sealed tier (by panward-tier, or by default) is refused with 400 unsupported_parameter naming panward-tier; the samples send panward-tier: routed.

No model of kind embedding is offered yet
The model catalog has no model of this kind today, so this endpoint answers 404 model_not_found for every model id. The samples below show the request for when one is offered.

Set PANWARD_EMBEDDING_MODEL to the id of a model of kind embedding from the model catalog. An id that is not a canonical id answers 404 model_not_found.

cat > body.json <<EOF
{"model": "$PANWARD_EMBEDDING_MODEL", "input": ["Discharge note, ward 4", "Referral letter, cardiology"]}
EOF

curl https://api.panward.ai/v1/embeddings \
  -H "Authorization: Bearer $PANWARD_API_KEY" \
  -H "Content-Type: application/json" \
  -H "panward-tier: routed" \
  --data-binary @body.json

Request fields#

FieldRequiredValuesLimitsNotes
modelYesstringCanonical id of a model of kind `embedding`.
inputYesstring | array of stringOne text or up to 2048 texts.
encoding_formatNofloat, base64
dimensionsNointegermin 1Shorten the vectors, for models that support it.
userNostringmax length 256Accepted for compatibility and ignored. Never stored, never forwarded upstream.

Each input must fit the model's context; a longer one is refused with 400 context_length_exceeded.

Receipts and billing#

The response carries the same headers as a chat completion, among them panward-receipt-id, panward-tier and panward-region, and the request has a receipt like any other (Receipts and verification). panward-hold-until-verified: true is accepted: the response waits until the verification level is known and the answer is 503 verification_unavailable instead of an unverified one.

Embeddings are billed on input tokens.

Was this page helpful?Suggest an edit