Create Embeddings
Creates an embedding vector for the provided input. Compatible with the OpenAI Embeddings API.
Authorization
ApiKeyAuth Your Yolo Router API key. Format: Bearer sk-...
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://api.yolorouter.com/v1/embeddings" \ -H "Content-Type: application/json" \ -d '{ "model": "text-embedding-3-small", "input": "The quick brown fox" }'{
"object": "list",
"model": "string",
"data": [
{
"index": 0,
"object": "embedding",
"embedding": [
0.1
]
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_api_key",
"message": "Invalid API key"
}
}{
"error": {
"type": "insufficient_quota",
"code": "insufficient_quota",
"message": "Quota exceeded"
}
}Create Completion POST
Creates a text completion for the provided prompt. Compatible with the OpenAI Completions API.
Create Message POST
Creates a model response using the Anthropic Claude Messages API format. Supports streaming via `stream: true`. Automatically routes to the best available provider (Anthropic, Google, OpenAI-compatible). Set `ANTHROPIC_BASE_URL` to this server's base URL in Claude Code or any Anthropic SDK to use Yolo Router as a drop-in replacement.