Embeddings
POST /v1/embeddings is OpenAI's embeddings endpoint. The model is
<provider>/<model>, for example openai/text-embedding-3-small,
cohere/embed-v4.0 or openrouter/voyageai/voyage-4.
| Provider | Models |
|---|---|
openai | text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002 |
cohere | embed-v4.0, embed-english-v3.0, embed-multilingual-v3.0. Text only, at most 96 inputs per request. input_type defaults to search_document. |
openrouter | OpenAI, Google Gemini, Voyage, Mistral, Qwen and open models. GET /v1/models lists them. |
1curl https://api.aile.sh/v1/embeddings \2-H "Authorization: Bearer $AILE_KEY" \3-H "Content-Type: application/json" \4-d '{ "model": "openai/text-embedding-3-small", "input": ["first text", "second text"] }'
input is a string, an array of strings, or token arrays (not on Cohere).
openrouter/voyageai/voyage-multimodal-3.5 and openrouter/google/gemini-embedding-2
also take OpenRouter's multimodal shape, input: [{ "content": [parts] }], with
text, image_url and (Gemini) input_audio parts.
dimensionsor Voyage'soutput_dimensionsets the vector size where the model supports it.encoding_format: "base64"is honoured on every provider.- On
openroutermodels only the documented embeddings fields are forwarded. OpenRouter routing fields are dropped. usagecarries token counts only. OpenRouter's cost fields are removed.
Billing
- Billed per input token, at list price × the serving lender's margin. The cheapest lender is tried.
- Image and audio input bill at their own published rates where the model has them.
- The hold is an estimate. The charge is the token count the provider reports, up to the hold.
- A $AILE discount tab applies, as on chat.
- A key's pins and the routing headers choose the lender here too, and
x-aile-providermust match the model's prefix.x-aile-max-priceand a key's price limit are checked against each lender's price, at the dearest input tier the request carries. - A response with no vectors, a vector count that does not match the inputs, or no token count is a
502and is not charged. - A provider refusal you can fix (
400,404,413,422…) passes through. One about the lender's account is a502saying you were not charged. A502or504arrives as503with the real code inx-aile-status. - An API key is required. Keyless x402 does not cover embeddings.