Skip to Content
Launching the open-source gateway

Embeddings

Create embeddings with OpenAI, Gemini, Mistral, Fireworks and Together models through one API.

The gateway turns text into vectors at https://gateway.respan.ai/v1/embeddings, and the answer comes back in OpenAI’s shape. See All API formats.

Quickstart

Terminal
curl https://gateway.respan.ai/v1/embeddings \ -H "Authorization: Bearer $RESPAN_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "text-embedding-3-small", "input": "Where is my order?"}'

Respan parameters work here as on chat: see Respan parameters. Tag embedding calls with the same customer_identifier as their chat calls to see a customer’s full spend.

Models and providers

ProviderEmbeddings
OpenAIYes
GeminiYes
MistralYes
FireworksYes
Together AIYes

OpenRouter models are not served for embeddings, because OpenRouter’s vendor on the gateway speaks chat only.

To find a model, filter by output type embeddings on the model catalog . Set it in model, such as text-embedding-3-small or mistral-embed. To keep a model on one provider, prefix it, as in mistral/mistral-embed. See Models.

Input, dimensions and encoding

OptionDescription
inputA text, an array of texts, or an array of token ids. One vector comes back per text.
dimensionsOutput size, where the model supports it. The model’s default if left out.
encoding_formatfloat (default) or base64.

Send the request as JSON. A form-encoded body is refused with 400.

Pricing and logs

  • Each call is one trace with one embedding row, priced on its input tokens. The row keeps the input texts (input_text or input_texts), not the vectors.
  • Before a call on Respan’s credits is sent, the gateway holds credits for the input at the model’s input rate.
  • On Respan’s credits, a model without an input price is refused with 400 before anything is held or sent.
  • An answer on Respan’s credits that reports no input tokens is refused with 502 no_billable_usage and charged nothing.
  • Embeddings pass the same checks as chat (limit policies, RPM, key usage cap, customer budgets), with no TPM limit and no customer rate limit.
  • Embedding requests are not redacted, so an organization with PII redaction on is refused.