Embeddings API¶
Generate vector embeddings for text. Compatible with the OpenAI Embeddings API.
Base URL¶
Authentication¶
When authentication is enabled, include your token in the Authorization header:
Embeddings¶
Create vector embeddings for semantic search and similarity.
POST /embeddings¶
Create embeddings for the given input text. The model must support embedding generation.
Authentication: Required when auth is enabled. Uses wallet-based API keys.
Headers¶
| Header | Required | Description |
|---|---|---|
Authorization |
Yes | Bearer token for authentication |
Content-Type |
Yes | Must be application/json |
Request Body¶
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
model |
string |
Yes | Embedding model ID (e.g., 'embeddinggemma-300m-qat-Q8_0') |
input |
string|array |
Yes | Text to generate embeddings for. Can be a string or array of strings. |
dimensions |
integer |
No | Reduce output to first N dimensions (for Matryoshka models). Must be <= model's native dimensions. |
Response¶
Returns an embedding object with vector data.
Content-Type: application/json
Examples¶
Generate embeddings for text:
curl -X POST https://api.getkawai.com/v1/embeddings \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "embeddinggemma-300m-qat-Q8_0",
"input": "Why is the sky blue?"
}'