API Reference

Create Embeddings

Creates an embedding vector for the provided input. Compatible with the OpenAI Embeddings API.

POST
/v1/embeddings

Authorization

ApiKeyAuth
AuthorizationBearer <token>

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"
  }
}