Embed up to 256 texts (``data.vectors``) on the configured embedding model; metered as AI credits.
URL
- Service tierhttps://agents.mattering.io/api/internal/v1/knowledge/embed/
Body keys (JSON)
| Key | Required | Default |
|---|---|---|
dimensions | optional or conditional | none |
model | optional or conditional | none |
purpose | optional or conditional | none |
reference_id | optional or conditional | none |
texts | optional or conditional | none |
Keys the view reads. A key not in this list is ignored by the view. Where a key is required only for some actions (for example the action dispatch), the description above says which.
Responses
200 data and meta envelope
{
"data": {
"vectors": "...",
"model": "...",
"dimensions": "...",
"tokens": "...",
"tokens_estimated": true,
"cost_cents": 0.0,
"provider": "..."
}
}
Field names come from the code; values are placeholders (... is a string, 0 a number, dates are ISO 8601).
Errors
| Status | Code |
|---|---|
| 400 | texts_required |
| 400 | too_many_texts |
| 400 | unknown_model_price |
| 502 | embeddings_failed |
| 503 | embeddings_unavailable |
Example
curl -X POST "https://agents.mattering.io/api/internal/v1/knowledge/embed/" \
-H "X-Internal-Secret: $MATTERING_INTERNAL_API_SECRET" \
-H "X-Internal-Org-Id: $ORG_ID" \
-H "X-Internal-User-Email: you@example.com" \
-H "Content-Type: application/json" \
-d '{
"dimensions": "...",
"model": "...",
"purpose": "...",
"reference_id": "...",
"texts": "..."
}'
Source: MatterCore/knowledge_api.py (knowledge_api.knowledge_embed)