Embedding API
Text vectorization service based on BAAI/bge-small-zh-v1.5 model.
Endpoints
| Method | Path | Auth |
|---|---|---|
| POST | /embed | Bearer Token |
| GET | /health | None |
Request Parameters
| Param | Type | Description |
|---|---|---|
| texts | string array | List of texts to vectorize |
Response Fields
| Field | Type | Description |
|---|---|---|
| embeddings | float[][] | 512-dimension vectors |
| model | string | Model name |
| tokens_used | integer | Tokens consumed |
Quick Test
Get token:
curl -X POST https://api.hubnode.uk/oauth2/token -H 'Content-Type: application/json' -d 'client_id=YOUR_ID&client_secret=YOUR_SECRET&grant_type=client_credentials'
Call API:
curl -X POST https://api.hubnode.uk/embed -H 'Authorization: Bearer TOKEN' -H 'Content-Type: application/json' -d 'texts=hello+world'