Create Embeddings
Creates an embedding vector for the provided input. Compatible with the OpenAI Embeddings API.
The open-source gateway does not implement it — pointing this at a self-hosted instance returns 404. Self-hosting covers Chat Completions, Responses, Anthropic Messages, Gemini and model discovery.
Self-hosting guide →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. Image model availability differs by deployment: the self-hosted gateway serves this endpoint with any image-output model you configure, and `GET /v1/models` lists what is currently available on the instance you are calling. With `stream=true`, the response is a Server-Sent Events stream of partial and completed image events for `gpt-image-*` models; any other model rejects the streaming ask with a 400.