# Embed text for search and RAG

> POST /api/v1/embeddings takes the OpenAI request shape. Embedding models bill per input token, or run on your own provider key.

OpenAI-compatible embeddings for search and RAG

**Slug**: `embeddings-search`  
**URL**: https://anyrouter.dev/use-cases/embeddings-search  
**Markdown**: https://anyrouter.dev/use-cases/embeddings-search.md  
**Short link**: https://anyrouter.dev/u/embeddings-search  

## Why use this

A retrieval pipeline needs an embeddings endpoint next to the chat one, and a second provider means a second key and base URL.

## Set it up

1. Pick an embedding model on /models, or start with nvidia/nemotron-3.5-embed-1b.
2. Send one string or an array in input. Vectors come back in request order.
3. Store the vectors, and embed queries with the same model.

## Code

### curl · embeddings

```bash
curl https://anyrouter.dev/api/v1/embeddings \
  -H "Authorization: Bearer $ANYROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nvidia/nemotron-3.5-embed-1b",
    "input": ["How do I reset my password?", "Billing questions"]
  }'
```

## Limits

- Use an sk-ar-v1- key. Management keys (ak_) are not accepted.
- dimensions only works when the upstream model supports truncation.

## Related

- [openai-sdk](https://anyrouter.dev/use-cases/openai-sdk)
- [ai-sdk](https://anyrouter.dev/use-cases/ai-sdk)
- [cheapest-llm-api](https://anyrouter.dev/use-cases/cheapest-llm-api)
