Skip to Content
Launching the open-source gateway

Embeddings

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

The gateway serves OpenAI’s Embeddings API at /v1/embeddings. The model routes to any provider that embeds, on your own key or Respan’s credits, and the answer comes back in OpenAI’s shape.

Pick a model: filter by output type embeddings on the model catalog , or read Models.

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": ["How do I reset my password?", "Where is my order?"] }'

Options

ParameterTypeDefaultDescription
modelstringrequiredThe embedding model.
inputstring, array of strings, or array of token idsrequiredThe text to embed.
dimensionsintegermodel defaultOutput size, where the model supports it.
encoding_formatstringfloatfloat or base64.

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

Providers

ProviderEmbeddings
OpenAIYes
GeminiYes
MistralYes
FireworksYes
TogetherYes
AWS BedrockYes, Cohere and Titan embedding models

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

Respan parameters

Add customer_identifier, metadata and the other Respan parameters in the body (or extra_body) or the X-Data-Respan-Params header, as on chat. Tagging embedding calls with the same customer as their chat calls lets you see a customer’s full spend. See Respan parameters.

Python
result = client.embeddings.create( model="text-embedding-3-small", input="Where is my order?", extra_body={"customer_identifier": "user_123"}, )

Embedding requests are not redacted, so an organization with PII redaction on is refused.

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.

Next steps