Create Embeddings
Creates an embedding vector for the provided input. Compatible with the OpenAI Embeddings API.
Authorization
ApiKeyAuth Your Yolo Router API key. Format: Authorization: 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": "<embedding-model-id>", "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 Image POST
Creates an image given a prompt. Compatible with the OpenAI Images API. Automatically routes to the best available provider. No image generation models are currently online — check `GET /v1/models` for current availability before relying on this endpoint.